Hello,
I might not understand something properly but I found something weird when generating my documentation. When using “$ref” inside an “items” and if using other references inside the item schema it is resulting in “undefined entity” inside the documentation generated by postman with the message “Entity definition not found”. I am using postman 10.12.13.
Is this a bug or am I not understanding something?
Here is a schema I created to outline the issue (I am using Open API 3.0.0) :
{
"$id": "someid",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Schema to filter image based on DICOM parameters.",
"type": "object",
"definitions": {
"numericalCriterionEqual": {
"title": "Numerical criterion equal",
"properties": {
"value": {
"type": "number"
},
"operator": {
"properties": {
"label": {
"enum": [
"="
]
},
"value": {
"enum": [
"equals"
]
},
"type": {
"type": "string",
"enum": [
"NUMERICAL_OPERATOR"
]
},
"variant": {
"type": "string",
"enum": [
"SINGLE_VALUE",
"ALL_ELEMENT",
"ANY_ELEMENT"
]
}
}
}
}
},
"criterion": {
"description": "Criterion",
"type": "object",
"properties": {
"operator": {
"description": "The selected operator",
"type": "object",
"required": [
"type",
"value",
"label"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": [
"NUMERICAL_OPERATOR",
"TEXTUAL_OPERATOR"
]
},
"variant": {
"type": "string",
"enum": [
"SINGLE_VALUE",
"ALL_ELEMENT",
"ANY_ELEMENT"
]
},
"value": {
"type": "string"
},
"label": {
"type": "string"
}
}
},
"value": {
"description": "Value for the criterion."
}
},
"required": [
"operator",
"value"
],
"additionalProperties": false,
"oneOf": [
{
"$ref": "#/definitions/numericalCriterionEqual"
}
]
},
"criteriaAPI2": {
"description": "List of criteria in the expression",
"type": "array",
"items": {
"$ref": "#/definitions/criterion"
}
},
"criteriaAPI": {
"description": "List of criteria in the expression",
"type": "array",
"items": {
"description": "Criterion",
"type": "object",
"properties": {
"operator": {
"description": "The selected operator",
"type": "object",
"required": [
"type",
"value",
"label"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": [
"NUMERICAL_OPERATOR",
"TEXTUAL_OPERATOR"
]
},
"variant": {
"type": "string",
"enum": [
"SINGLE_VALUE",
"ALL_ELEMENT",
"ANY_ELEMENT"
]
},
"value": {
"type": "string"
},
"label": {
"type": "string"
}
}
},
"value": {
"description": "Value for the criterion."
}
},
"required": [
"operator",
"value"
],
"additionalProperties": false,
"oneOf": [
{
"$ref": "#/definitions/numericalCriterionEqual"
}
]
}
},
"expressionAPI": {
"description": "An expression",
"type": "object",
"properties": {
"criteria": {
"$ref": "#/definitions/criteriaAPI"
}
},
"required": [
"logicalOperator",
"criteria",
"expressions"
]
},
"expressionAPI2": {
"description": "An expression",
"type": "object",
"properties": {
"criteria": {
"$ref": "#/definitions/criteriaAPI2"
}
},
"required": [
"logicalOperator",
"criteria",
"expressions"
]
},
"test": {
"type": "object",
"properties": {
"filter": {
"description": "The filter (an expression)",
"$ref": "#/definitions/expressionAPI"
},
"filter2": {
"description": "The filter (an expression)",
"$ref": "#/definitions/expressionAPI2"
}
},
"additionalProperties": false,
"required": [
"filter",
"name"
]
}
}
}
And there is the documentation generated by postman (you can see the behavior described in the filter2 property) :