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

Parameter type not supported (nullable) #106

Open
erictuvesson opened this issue Nov 19, 2019 · 2 comments
Open

Parameter type not supported (nullable) #106

erictuvesson opened this issue Nov 19, 2019 · 2 comments
Assignees

Comments

@erictuvesson
Copy link

Hello,

The parameter type nullable is not supported.

Location:
https://github.com/mtennoe/swagger-typescript-codegen/blob/master/src/view-data/parameter.ts#L89

parameter:

{"name":"product_code","description":"product_code","required":false,"in":"nullable","type":"string"}

It would be nice if the exception contains the failed type too, it makes it a lot easier to debug an issue like this. 😄

@ghost ghost added the Needs: triage 🔍 label Nov 19, 2019
@mtennoe
Copy link
Owner

mtennoe commented Nov 21, 2019

Yo, and thanks for reaching out!

The codegenerator definitely lacks nullable support, however it is currently only supporting Swagger 2.0, where nullable parameter types are not part of the spec. I.e. it is possible to add it, but that would break with the 2.0 spec, while ofc. adding some value. I am a bit uncertain what I prefer here as it's important to follow the spec. Would love to hear people's opinion (@Markionium for instance).

Either way I think we need to figure out a story to eventually support the Swagger/OpenAPI 3.0 spec, and nullable should definitely be part of that

@mtennoe mtennoe self-assigned this Nov 22, 2019
@erictuvesson
Copy link
Author

I agree it would be best to follow the Swagger 2.0 specs, one potential solution could be to add an extended version. I am not sure how many more types that are not in the Swagger 2.0 spec which could potentially be used.

Related: #102

erictuvesson added a commit to erictuvesson/swagger-typescript-codegen that referenced this issue Mar 10, 2020
Making it clear that the abstraction is designed with purpose.
mtennoe#106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants