OpenAPITools / OpenAPITools/openapi-generator
Enhancement: Set isFreeFormObject property
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
A free-form object field in a model can be hard to distinguish from other types in the mustache template. Making this an explicit property would be helpful
openapi-generator version
3.3.1
OpenAPI declaration file content or url
"object_field": {
"type":"object"
}
Command line used for generation
This does not seem to be specific to any generator, although different generators deal with "object" differently -- some consider it to be a primitive type and others do not.
Steps to reproduce
Process any OpenAPI definition file with model containing a field like above.
Related issues/PRs
none
Suggest a fix/enhancement
For free-form object fields, set an isFreeFormObject property to true. Add this property field to CodegenParameter and CodegenProperty, as a peer to isString, isPrimitiveType, etc. I am not yet clear what logic should be used to set this field.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading CodegenParameter and CodegenProperty alongside the existing isString and isPrimitiveType fields, then trace how object fields are classified during generation. Determine the logic for identifying free-form objects and verify that the new property is populated and available to mustache templates across the relevant generators.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100