Open mwilliams-tyro opened 3 years ago
With the update to 5.2.0
and the latest kotlin-spring templates this has now also broken required field bean validation as the native NotNull
annotation has been removed entirely and all the non null handling has been moved inside the jackson specific annotation
I have exactly the same problem. I guess serializationLibrary is always ignored. In our company we are not allowed to use jackson so we have to use another serialization library.
Same issue with generator = "kotlin-spring" library = "kotlinx_serialization"
"serializationLibrary" to "kotlinx_serialization", is ignored and instead Jackson impl is generated
Bug Report Checklist
Description
When using the
kotlin-spring
generator in theopenapi-generator-maven-plugin
and setting theserializationLibrary
property togson
, the JSON serialization annotations used in the generated model classes are Jackson annotations. This is causing issues as we need to have the property name in Pascal case due to a contract with a 3rd party system, so are reliant on the JSON property name annotations (@SerializedName
in the case of gson).There are possibly 2 bugs at play here:
serializationLibrary
to gson is seemingly ignoredserializationLibrary
is documented as beingmoshi
(see https://openapi-generator.tech/docs/generators/kotlin-spring and search forserializationLibrary
)openapi-generator version
openapi-generator-maven-plugin:5.1.0
OpenAPI declaration file content or url
Generation Details
Plugin configured in pom.xml:
Steps to reproduce
Run
mvn generate-sources