Closed hagagps closed 3 months ago
Hello @hagagps
Could you please provide the swagger file example and screenshots from your developer portal and your expected result.
{
"openapi": "3.0.1",
"info": {
"title": "API",
"description": "Find ...",
"version": "2.0"
},
"servers": [
{
"url": ""
}
],
"paths": {
"/": {
"get": {
"summary": "Find",
"description": "#### Find ...",
"operationId": "Find",
"parameters": [
{
"name": "tag",
"in": "query",
"description": "Tag",
"schema": {
"type": "string"
}
},
{
"name": "pageNumber",
"in": "query",
"description": "Format - int32.",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "pageSize",
"in": "query",
"description": "Format - int32.",
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "List",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseArray"
},
"example": [
{
"$type": "string",
"id": "string"
}
]
}
}
}
}
}
}
},
"components": {
"schemas": {
"AbstractResponse": {
"type": "object",
"properties": {
"$type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"discriminator": {
"propertyName": "$type"
}
},
"ImplementationResponse1": {
"type": "object",
"allOf": [
{
"$ref": "#/components/schemas/AbstractResponse"
}
],
"properties": {
"type": {
"type": "string"
}
}
},
"ImplementationResponse2": {
"type": "object",
"allOf": [
{
"$ref": "#/components/schemas/AbstractResponse"
}
],
"properties": {
"label": {
"type": "string"
}
}
},
"ResponseArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AbstractResponse"
}
}
}
}
}
The portal only shows ResponseArray
and AbstractResponse
.
Would expect to see both implementation schemas.
It could even call out abstract to associate them.
Please log managed portal issues to Azure support team using Support + Help link in Azure portal and select Problem Type = Developer portal.
Bug description
We use polymorphic responses with an abstract class and discriminator property
$type
where value is name of implementation class. We automatically include all implementation schemas of the abstract class in our swagger doc. Uploading and downloading the doc from APIM shows all the schemas, however the portal neither shows the schemas nor the properties/descriptions that come along with them.AbstractResponse
classImplementationResponse
classReproduction steps
AbstractResponse
andImplementationResponse
shown aboveAbstractResponse
schema is shown in portalExpected behavior
All schemas in swagger doc are shown, along with properties and descriptions.
Is your portal managed or self-hosted?
Managed