yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator
MIT License
625 stars 147 forks source link

Add support for nullable attribute #165

Closed raphaeloliveira closed 5 years ago

yonaskolb commented 5 years ago

Great, thanks @raphaeloliveira! Could you:

raphaeloliveira commented 5 years ago

Hey @yonaskolb, I added an entry on changelog, updated the spec with a new scheme that contains nullable properties and regenerated the fixtures. Let me know if something is missing.

One thing which is not clear for me yet is how to run the tests per see, and what is being verified against what.

Thanks!

raphaeloliveira commented 5 years ago

As a side note, I pasted https://github.com/yonaskolb/SwagGen/blob/master/Specs/TestSpec/spec.yml on Swagger Editor and the following errors were raised:

Semantic error at paths./multiple-path-params{petID}
Declared path parameter "petID" needs to be defined as a path parameter at either the path or operation level
Jump to line 55
Structural error at components.schemas.Zoo.properties.schemaAnimals.items
should be object
Jump to line 301
Semantic error at components.schemas.Zoo.properties.schemaAnimals.items
`items` must be an object
Jump to line 301

Not sure how relevant they are.

yonaskolb commented 5 years ago

Thanks! I meant to say run swift test above which generates all the fixtures. It fails if something has changed and will tell you so, but if you rerun it it will pass. The generated files are used on CI to see if after generation there is a diff. You can see that in https://github.com/yonaskolb/SwagGen/blob/master/.circleci/config.yml and the actual build itself on CircleCI https://circleci.com/gh/yonaskolb/SwagGen/351?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

raphaeloliveira commented 5 years ago

Ah cool, would be probably nice to add some documentation about the tests, unless there is some and I missed it.

Thanks for the help!