OpenAPITools / OpenAPITools/openapi-generator

properties name changed specific name

Open
#15,906 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Announcement
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

While I use swagger tool to make component at that time, I have to define some parameters or what kind of value that component have. So problem was like I don't get defined property/field name in auto-generated component. I need just 'values' instead of 'propertyValues'.

In autogenerated class my field name changed to 'propertyValues' even if I given name like just 'values'

using this plugin

id("org.openapi.generator")
in gradle

my config in gralde

openApiGenerate {
generatorName.set("kotlin-spring")
library.set("spring-boot")
inputSpec.set("${projectDir}/src/main/resources/openapi/schema.yml")
outputDir.set("${buildDir}/generated")
apiPackage.set("${basePackageName}.api")
invokerPackage.set("${basePackageName}.invoker")
modelPackage.set("${basePackageName}.model")
configOptions.set(
mapOf(
"dateLibrary" to "java8",
"interfaceOnly" to "true",
"useTags" to "true",
"useSpringBoot3" to "true",
"documentationProvider" to "springdoc",
"serverPort" to "8081",
"enumPropertyNaming" to "UPPERCASE",
"groupId" to "${project.group}",
"modelMutable" to "true"
)
)
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the schema.yml used by the openApiGenerate task and the kotlin-spring generator configuration shown in the issue. Reproduce the generated model and trace why a property declared as "values" becomes "propertyValues". Done means the generated component preserves the declared property name, with coverage for the reported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, openapi, spring-boot
Domain
api, backend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.