OpenAPITools / OpenAPITools/openapi-generator
[BUG][ALL] Array of object not generated
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
openapi-generator version
v5.1.0
I got this error:
[main] INFO o.o.codegen.DefaultGenerator - Model ListOfVariables not generated since it's an alias to array (without property) and `generateAliasAsModel` is set to false (default)
I tried with the config generateAliasAsModel but it generates an empty model
I got this model:
ListOfVariables:
type: array
items:
type: object
properties:
name:
type: string
value:
type: string
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 at DefaultGenerator.java around line 487 and reproduce the issue with the supplied ListOfVariables array-of-object schema on v5.1.0. Trace how array aliases and generateAliasAsModel are handled, then verify that generation produces a non-empty model representing the inline object's name and value properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100