openapi-tools / swagger-maven-plugin

Maven plugin to activate the Swagger Core library to generate OpenAPI documentation.
MIT License
72 stars 46 forks source link

Allow ObjectMapperProcessor to customise JSON mapping #33

Open seanf opened 5 years ago

seanf commented 5 years ago

Is your feature request related to a problem? Please describe. I need to use an ObjectMapperProcessor to customise JSON mappings (to support Scala's Option type, among other things), but the schemas generated by io.openapitools.swagger:swagger-maven-plugin don't reflect the mappings configured by the ObjectMapperProcessor because there is no way to tell the plugin about my ObjectMapperProcessor.

Describe the solution you'd like Please add an option to specify the classname of the ObjectMapperProcessor implementation, which would affect the schema generation so that it matches the runtime behaviour when the ObjectMapperProcessor is installed.

Describe alternatives you've considered I tried switching to io.swagger.core.v3:swagger-maven-plugin because it has a configuration option objectMapperProcessorClass, but it doesn't seem to work as expected: https://github.com/swagger-api/swagger-core/issues/3247

Additional context Swagger's objectMapperProcessorClass configuration option is documented here: https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Integration-and-Configuration#configuration-properties