-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Remove unused schema definitions (e.g. --remove-unreferenced-schema
)
#170
Comments
@kirides Thanks for taking the time to investigate and suggest this This could be really interesting as an option but definitely not as the default behavior. I have on multiple occasions used an OpenAPI spec for the sole purpose of generating contracts Looks like you already have the code, if you create a pull request and all the tests pass then I'll approve so can get this in 😄 |
Will be looking at it. This is mainly useful for people like me/company where we filter endpoints and only want the minimum required OpenApi spec parts in an assembly/module. Reason being that breaking changes in contracts become easier to manage, due to less clutter after re-generating the endpoints and contracts. |
Is @christianhelle |
i like that suggestion, it's easy to implement and reason about |
@all-contributors please add @jods4 for ideas |
I've put up a pull request to add @jods4! 🎉 |
I was gonna say don't bother, but you're too quick! |
To reduce the amount of generated Contracts, we could walk the
path
s and remove and non-referenced schemaAs we already are able to filter paths, we can make use of that to clean up the spec and generate less code.
Example code for cleaning up the schema definitions
The text was updated successfully, but these errors were encountered: