OpenAPITools / OpenAPITools/openapi-generator
[Question] What is vars and allVars used for?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
More of a question than a bug report: I discovered in the addVars method of the DefaultCodegen the following code snippet
if (allProperties != null) {
Set<String> allMandatory = allRequired == null ? Collections.emptySet()
: new TreeSet<>(allRequired);
// update "vars" with parent's properties (all, required)
addVars(m, m.allVars, allProperties, allMandatory);
m.allMandatory = allMandatory;
}
Why is vars updated with the properties from allVars? Doesn't vars contain only the properties from the schema objects properties-block in contrast to allVars, which contains cumulatively all properties from the parents plus the own properties?
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 with the DefaultCodegen.addVars method and trace how vars, allVars, allProperties, and allMandatory are populated. Check the related model-generation flow to determine whether the current behavior is intentional. Done means documenting the distinction and explaining why parent properties are passed through addVars.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100