swagger-docs icon indicating copy to clipboard operation
swagger-docs copied to clipboard

fix generator for swagger_model when no property required

Open FLemon opened this issue 8 years ago • 4 comments

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

FLemon avatar Sep 01 '16 16:09 FLemon

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

FLemon avatar Sep 02 '16 13:09 FLemon

@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 avatar Oct 31 '16 11:10 FLemon

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

FLemon avatar Jan 13 '17 13:01 FLemon

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

FLemon avatar Oct 25 '17 09:10 FLemon