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

Maximum and Minimum are omitted if set to zero #124

Open
alexis-miakouikila opened this issue Jan 9, 2020 · 0 comments
Open

Maximum and Minimum are omitted if set to zero #124

alexis-miakouikila opened this issue Jan 9, 2020 · 0 comments

Comments

@alexis-miakouikila
Copy link

alexis-miakouikila commented Jan 9, 2020

Given a definition of the type:

FinanceConfiguration:
      commission:
        type: number
        format: double
        maximum: 100
        minimum: 0

The value of minimum is lost because it has been set to zero.

I believe the issue comes from: https://github.com/nytimes/openapi2proto/blob/master/openapi/interface.go#L161
where maximum and minimum are omitted if "empty".

EDIT:
My bad. I am using a third party that relies on this code to generate JSON schemas. This issue will not affect the creation of proto files. I won't close the ticket yet though as I believe it remains a valid comment.

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

No branches or pull requests

1 participant