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

Use references to common schema instead of inline schema #2

Open
looloosha opened this issue Aug 21, 2024 · 0 comments
Open

Use references to common schema instead of inline schema #2

looloosha opened this issue Aug 21, 2024 · 0 comments

Comments

@looloosha
Copy link

looloosha commented Aug 21, 2024

I'm trying to use NSwag, an Open API to C# language client generator but am running into issues because of how the Open API spec is defined. The goal is to quickly get a C# SDK generated so I can interact with the CMS in my C# azure applications.

Because the spec doesn't use references for common schema across endpoints, my code generator is generating many duplicate objects for request and response objects and child objects.

For example, FieldData, FieldData1, FieldData2, ... etc. is being generated by my code generator because references aren't being used in the spec. This makes code generations very basically impossible/unusable. I would recommend that references be used throughout the spec instead of duplicate inline schema being defined.

Here is the documentation on references: https://swagger.io/docs/specification/using-ref/

Let me know if you'd like the generated code so you can see where duplication is occurring. It's happening all over the place.

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