Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass swagger options to swagger-js Operation#execute method #1112

Merged
merged 2 commits into from
May 8, 2015

Conversation

aurelian
Copy link
Contributor

@aurelian aurelian commented Apr 1, 2015

As in subject, Operation#execute from swagger-js expects swaggerOptions by the look of this code: https://github.com/swagger-api/swagger-js/blob/develop_2.0/lib/types/operation.js#L542-L544 and swagger-js tests.

@@ -313,7 +313,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
if (isFileUpload) {
return this.handleFileUpload(map, form);
} else {
return this.model['do'](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
return this.model.execute(map, this.options.swaggerOptions, this.showCompleteStatus, this.showErrorStatus);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, this.options is undefined and should be this.opts (src/main/javascript/view/OperationView.js#L16). Also, should you change this.options.swaggerOptions to this.options.swaggerOptions || {} just to be safe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This object OperationView is created here: https://github.com/swagger-api/swagger-ui/blob/develop_2.0/src/main/javascript/view/ResourceView.js#L52-L59

Basically, this.options is Backbone.js stuff that gets passed around. Good idea to add the guard to empty {}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aurelian added a commit to 3scale/swagger-ui that referenced this pull request Apr 16, 2015
fehguy added a commit that referenced this pull request May 8, 2015
Pass swagger options to swagger-js Operation#execute method
@fehguy fehguy merged commit ba855e3 into swagger-api:develop_2.0 May 8, 2015
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this pull request Aug 19, 2016
Pass swagger options to swagger-js Operation#execute method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants