-
Notifications
You must be signed in to change notification settings - Fork 234
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
TypeScript types generated as optional but should be required #3244
Comments
Hi @nonameolsson
More generally we should implement some kind of generated signal to avoid triggering linters for generated code, if this is available for eslint/ts parser. In the meantime we could fix that ad-hoc redundancy, would you be willing to submit a pull request for that? The code that emits the property is located here
|
As per the generated annotation, this can be done through comments /* eslint-disable */
/* generated by ... */
...
/* eslint-enable */ This would need to be implemented here (and in enum and in interface and in function)
As well as the closing equivalent |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Assigning to myself and moving to 1.7 since @nonameolsson doesn't seem to want to submit a pull request. |
Authored #3318 to address the concerns above. |
@nonameolsson There's a follow-up issue at #3911, please upvote if you're still interested. |
Hi @baywet, thanks for the reply. Anyway to keep some fields required ? (.e.g. Id in this case ) |
Not today no |
anything in the roadmap? |
yes #3911 |
First of all, I want to thank you for building a really great tool that wilI make development easier 👍
I am using Kiota to generate TypeScript code. It is really easy to use, but I am getting problems with the generated types.
OpenAPI schema
OpenAPI schema with nullable
Swagger

Kiota generated types
Notice that both

id
andname
are defined as:name?: string | undefined
.Questions
?
andundefined
Thank you so much for an awesome tool! I do appreciate all feedback on this, so that I an progress.
Additional references
openapi-generator-cli
to generate, this works as expected.The text was updated successfully, but these errors were encountered: