openapi-generator
openapi-generator copied to clipboard
[BUG][SPRING] Snake_case parameter gets converted to camelCase in api
Bug Report Checklist
- [x] Have you provided a full/minimal spec to reproduce the issue?
- [x] Have you validated the input using an OpenAPI validator (example)?
- [x] Have you tested with the latest master to confirm the issue still exists?
- [x] Have you searched for related issues/PRs?
- [x] What's the actual output vs expected output?
- [ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When generating an open api spec with a request parameter in snake_case form e.g. house_nr we have found the functionality of the api generated requires the parameter to be of the form houseNr. This is causing issues for us since 1. the spec is inconsistent with functionality, 2. Due to preexisting constraints we require the form to be house_nr.
openapi-generator version
6.1.0
OpenAPI declaration file content or url
If you post the code inline, please wrap it with
in: query
name: address
description: xyz
required: true
style: form
schema:
type: object
properties:
house_nr:
description: The house number of the location.
type: string
example: 200
Generation Details
openApiGenerate {
generatorName = "spring"
inputSpec = "src/docs/openapi/openapi_bundled.yaml".toString()
templateDir = "${project.projectDir}/src/main/resources/openapi/templates"
outputDir = "$buildDir/generated/raw/openapi".toString()
apiPackage = "com.{}.generated.api"
invokerPackage = "com.{}.generated"
modelPackage = "com.{}.generated.api.model"
configOptions = [
interfaceOnly : "true",
skipDefaultInterface: "true",
useTags : "true",
dateLibrary : "java8"
]
}