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

Unreferenced schema types are not generated [c#] #4512

Closed
MihaMarkic opened this issue Apr 18, 2024 · 5 comments
Closed

Unreferenced schema types are not generated [c#] #4512

MihaMarkic opened this issue Apr 18, 2024 · 5 comments
Labels
generator Issues or improvements relater to generation capabilities. Needs: Attention 👋
Milestone

Comments

@MihaMarkic
Copy link

A provider I wish to communicate with has a callback feature where it POSTs some data to my server. The data type is defined in schema as an object but, I guess, because this particular type is not directly referenced in schema paths (methods), the model is not generated.
When I alter the schema to reference said type, model is generated.

I think all schema types should be generated regardless whether they are referenced, or at least, provide a CLI switch to generate them all.

@github-project-automation github-project-automation bot moved this to Todo 📃 in Kiota Apr 18, 2024
@baywet
Copy link
Member

baywet commented Apr 19, 2024

Hi @MihaMarkic
Thanks for using kiota and for reaching out.
I'd rule that a feature more than an issue. What do you need the orphan types for?
The only valid scenario which is not covered today we're aware off is the webhooks scenario: i.e. the API describes types it will send out as a result of an event on a subscription. This is something that can now be described with OAS 3.1, which kiota doesn't support yet but plans to support as soon as our parsing library does.

@baywet baywet added this to the Backlog milestone Apr 19, 2024
@baywet baywet added question generator Issues or improvements relater to generation capabilities. labels Apr 19, 2024
@MihaMarkic
Copy link
Author

@baywet Yes, that's exactly what I'm facing. Getting events. But still, can't kiota just generate all schema types regardless since this are real world scenarios and schemas written with OAS3.0?

@baywet
Copy link
Member

baywet commented Apr 19, 2024

no, and that's by design. We're unlikely to change that at this point, we'd rather invest in 3.1 and webhooks support to properly support this scenario.
This is tracked by #3914
Let us know if you have any other question/concern.

@MihaMarkic
Copy link
Author

I'm out of concerns. In meantime I'll be tweaking OAS3.0 with fake methods that reference these event schemas - to force generation of said types.

@baywet
Copy link
Member

baywet commented Apr 22, 2024

Thanks for confirming! closing

@baywet baywet closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
@github-project-automation github-project-automation bot moved this from Todo 📃 to Done ✔️ in Kiota Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Issues or improvements relater to generation capabilities. Needs: Attention 👋
Projects
Archived in project
Development

No branches or pull requests

2 participants