[KOTLIN/CORE] [SPRING] Invalid default value for form requests.

Open
#1,108 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, kotlin, spring
Domain
api, backend, tooling

Research direction

Start with the generated requestBody methods in samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt and samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java, focusing on the defaultValue="null" entries for application/x-www-form-urlencoded. Trace these outputs back to the core implementation and confirm that properties without defaults no longer receive a string null value.

Written by the indexing model from the issue text.

Description

Description

In requestBody, when using application/x-www-form-urlencoded content type, each property is defaulted with null as a string, even if no default is set. See here and note the defaultValue="null".

It is possible that it could be a bug in the core implementation as it seems to happen in the java spring sample as well.

openapi-generator version

Latest release - org.openapitools:openapi-generator:2.3.2

Dominant language
Java
Stars
26.8k
Forks
7.7k
Avg merge
1d 6h
Merged PRs (30d)
100

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.

More from OpenAPITools/openapi-generator

All issues in OpenAPITools/openapi-generator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.