-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Not so nice behavior when generating client with trim-unused-schema #557
Comments
@kirides removing unused discriminated values sounds better. You had me at "less generated code" 😄 |
Possible issues include a fully abstract endpoint that returns SomeContract would not generate all possibly returned types, same with input parameters. |
@kirides Could we perhaps provide an option to use one or the other? |
Best would be some kind of Per-Operation configuration overrides, but that doesn't exist yet. A simpler "KeepDiscriminatedSchema" would be a one or none switch to support 1. & 2. Globally. Before going into PR i'd like a suggestion which direction to head into ;) |
@kirides I can't see myself using a per-operation configuration override, and in scenarios where I would see this, the entire OpenAPI spec would be full of these examples. I'm of course, speaking only for myself I would, personally, go for a one-or-none switch to support scenario 1 or 2 |
I've got some code to do that. Will open a PR after holidays |
Describe the bug
A bunch of "Anonymous" classes get generated.
This is due to the SchemaCleaner not handling
DiscriminatorObject.Mapping
Now we have two ways to solve it:
DiscriminatorObject.Mapping
, leading to less generated code@christianhelle What would you prefer?
Always generate full inheritance hierarchy/sum types or remove the unused discriminated values?
OpenAPI Specifications
a snippet of the issue causing schema:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: