-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
swagger-gradle-plugin - Support for ModelConverter #2971
Comments
refs #2971 - adds modelConverterClasses and objectMapperProcessorClass to config
#2973 (available in 2.0.6-SNAPSHOT) introduces config properties In your case something like:
this will apply properties to objectMapper used by default by ModelResolver and other swagger components (e.g. the reader, etc). If you only want to process the mapper used by ModelResolver to resolve schemas, applying a converter like the one you shared, via the closing ticket, please reopen if you're still experiencing issues |
@frantuma I gave it a try with the latest released version 2.0.6 and I run into a problem when running the resolve task. I have implemented the ObjectMapperProcessor in default gradle When I run the
I would expect that the resolve task uses this special gradle |
Please add the buildSrc classpath to |
Thanks! I got a little bit further. Now I have the problem, that the change to the mapper actually affects the swagger internal json serialization schema as well and not just the payload data. The swagger keyword
|
Thanks for reporting, it is indeed a bug :( this should be fixed in #3038 (latest 2.0-7-SNAPSHOT) which limits the scope of custom ObjectMapper to default resolver; for 2.0.6, applying ModelConverter as in your example via
|
ref #2971 - fix ObjectMapperProcessor scope of action
Using the modelConverterClasses implementation worked as expected. Looking forward to 2.0.7! |
I am experimenting with the new Swagger Gradle plugin and it works very well!
One important feature I am missing, is the possibility to add custom ModelConverter through the gradle resolve{} task configuration. There are configuration options for filterClass, readerClass and scannerClass but not for (multiple) ModelConverter classes.
Background:
I am using dropwizard with PropertyNamingStrategy.SNAKE_CASE for the ObjectMapper and want to generate a static openapi.yaml file through the gradle resolve{} task.
Code example:
Something that I am trying to achieve through the gradle task configuration could be similar to:
Custom Converter:
The text was updated successfully, but these errors were encountered: