-
Notifications
You must be signed in to change notification settings - Fork 679
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
Partial namespace in SchemaId #333
Comments
Unfortunately the only way to do this right now would be with a DocumentFilter. You would have to replace the "definitions" dictionary, transforming the keys accordingly as well as iterating and updating all Schema refs throughout the document. You may be quicker to submit a PR. In this, you could update the generator options to include a strategy (lambda) for schemaIds then wire up a default implementation that uses the existing approach |
I also need this feture so have added PR #377 |
I would like this feature but would like the strategy to take the Type and return a string for the Id. PR #377 only lets you change the transformed id. My use case is to combine class names for nested types but ignore namespaces. But you might want to use attributes etc to define your ids. |
@domaindrivendev do you have a date when 5.2.2 is likely to be released? |
Available in v5.2.2. See SchemaId option in the config API |
I have many complex models in my API.
They have full type names like this:
As you can see I have two different types with the class name Type1, so currently I'm using UseFullTypeNameInSchemaIds() configuration to avoid collision.
But I want to make my SchemaIds shorter like this:
How could I achieve this?
I have tried to create a custom ISchemaFilter, but I could not find a way to change the SchemaId.
The text was updated successfully, but these errors were encountered: