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

fix generator for swagger_model when no property required #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FLemon
Copy link

@FLemon FLemon commented Sep 1, 2016

Before the fix, the generator is assigning null to required field,
which raises error

swagger-ui.js:2362 Uncaught TypeError: Swagger 2.0 does not support null types ([object Object]).  See https://github.com/swagger-api/swagger-spec/issues/229.

This fix will instead not to create a required field for the json, as to match the way how swagger_ui has done it, see https://github.com/swagger-api/swagger-ui/blob/master/test/specs/v1.2/petstore/store.json#L113

Before the fix, the generator is assigning null to `required` field,
which raises error
```
swagger-ui.js:2362 Uncaught TypeError: Swagger 2.0 does not support null types ([object Object]).  See OAI/OpenAPI-Specification#229.
```

This fix will instead not to create a `required` field for the json, as to match the way how swagger_ui has done it, see https://github.com/swagger-api/swagger-ui/blob/master/test/specs/v1.2/petstore/store.json#L113
@FLemon
Copy link
Author

FLemon commented Sep 2, 2016

@richhollis can you have a look at this PR fix please :)

@FLemon
Copy link
Author

FLemon commented Oct 31, 2016

@richhollis just to follow up this PR, I am keen to know if the fix is not appropriate, is there something i missed, looking forward to hear from you about your thoughts, thank you

@FLemon
Copy link
Author

FLemon commented Jan 13, 2017

hello @richhollis , just to follow up this PR, is this something else you would want to check/done with this PR?

@FLemon
Copy link
Author

FLemon commented Oct 25, 2017

@richhollis ^...wondering if this PR still valid?

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.

1 participant