If you have a referenced object and a definition type of this object, the plugin is not able to generate code. For example:
...
components:
schemas:
...
customerProductHolding:
type: object
properties:
...
account:
$ref: "#/components/schemas/account"
type: object <------------------------------------------------ This is the definition that crash
...
account:
type: object
properties:
accountId:
type: string
...
The error showed is:
----
FTL stack trace ("~" means nesting-related):
- Failed at: #if field.dataType?has_content && (fi... [in template "templateSchema.ftlh" at line 121, column 3]
----
at freemarker.core.InvalidReferenceException.getInstance (InvalidReferenceException.java:134)
at freemarker.core.EvalUtil.compare (EvalUtil.java:198)
at freemarker.core.EvalUtil.compare (EvalUtil.java:115)
at freemarker.core.ComparisonExpression.evalToBoolean (ComparisonExpression.java:78)
What is expected?
The generator should ignored all sibling of #ref node in account and create an account object. The specification of OpenApi says:
What happens?
If you have a referenced object and a definition
type
of this object, the plugin is not able to generate code. For example:The error showed is:
What is expected?
The generator should ignored all sibling of
#ref
node in account and create an account object. The specification of OpenApi says: