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

openapi: support nullable attribute with temporary generator image #1747

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

bonifaido
Copy link
Member

@bonifaido bonifaido commented Feb 13, 2019

Q A
Bug fix? no
New feature? yes
API breaks? no
Deprecations? no
Related tickets OpenAPITools/openapi-generator#1869
License Apache 2.0

What's in this PR?

The OpenAPI specification gives support for nullable fields via the nullable attribute but this feature has not landed yet in the official generator CLI, thus I have updated the image built from the PR branch until the feature arrives.

Why?

It's not possible to use pointer fields for example *time.Time is not achievable, however null and time.Time = 0 is very different.

Additional Context

oneOf was broken (made no effect on the generated code, it still generated map[string]interface{}) previously as well, but now it becomes broken (the hard way) since it references a type called OneOfAorBorC but that actual type is not generated (results in compile time error). For the time being, I have commented out the broken oneOf parts from the API specification.

Checklist

  • Implementation tested (with at least one cloud provider)
  • Error handling code meets the guideline
  • Logging code meets the guideline (TODO)
  • OpenAPI and Postman files updated, client regenerated (make generate-client) (if needed)
  • User guide and development docs updated (if needed)
  • Related Helm chart(s) updated (if needed)

@bonifaido bonifaido self-assigned this Feb 13, 2019
@bonifaido bonifaido changed the title openapi: support nullable attribute with temporary generator image [WIP] openapi: support nullable attribute with temporary generator image Feb 13, 2019
@bonifaido bonifaido changed the title [WIP] openapi: support nullable attribute with temporary generator image openapi: support nullable attribute with temporary generator image Feb 13, 2019
Copy link
Member

@sagikazarmark sagikazarmark left a comment

Choose a reason for hiding this comment

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

One of a kind!

@baluchicken baluchicken merged commit bc61083 into master Feb 13, 2019
@baluchicken baluchicken deleted the openapi-nullable branch February 13, 2019 15:04
@ackintosh
Copy link

FYI: OpenAPITools/openapi-generator#1869 has been merged into master. 😉

@sagikazarmark
Copy link
Member

Thanks for the heads up @ackintosh !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants