openapi-typescript
openapi-typescript copied to clipboard
default-non-nullable does not seem to work for query parameters.
I'm using the cli tool like this
npx openapi-typescript --default-non-nullable openapi.yml --prettier-config .prettierrc --output typeApi.ts
But still the query parameters with a default value are optional type properties.
Yes I believe --default-non-nullable should probably enforce the behavior you’re describing, unless it conflicts with another test. Would love for someone to open a PR if they’re able to!
Are there any updates on this issue?
I'm not sure this change makes sense in line with what REST and swagger are actually communicating. From swagger: "The default value is the one that the server uses if the client does not supply the parameter value in the request". If this change is implemented, the default value would never be used because typescript would require the client to always define it.
@npbenjohnson We use the types at the server actually.
This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.