Forum Discussion

rishabagal's avatar
rishabagal
Occasional Visitor
3 years ago

Swagger UI Yaml file

i am trying to create a swagger API response be like below :
{
"items":
[
{
"policyType": "IGNORE",
"deviceCount": 1,
"policyId": "6468ba74-6c55-42f2-8569-ade76a44ee06",
"createdDate": "2022-08-01T06:32:13.463",
"datasources":
[
{
"type": "DNAC",
"name": "40.40.40.1",
"mgmtSystemId": "5829f212-7ff9-46c7-b86c-dfd520a46bd4",
"mgmtSystemAddr": "40.40.40.1"
},
{
"type": "DDC",
"name": "Direct Device Connector (NON-CONTROLLER)",
"mgmtSystemId": "5829f212-7ff9-46c7-b86c-dfd520a46bd4",
"mgmtSystemAddr": "40.40.40.1"
}
],
"description": "Not scanable item AIR-CT5508-K9",
"lastUpdateDate": "2022-08-01T06:33:18.349"
}
]
}

 

here is my yaml file :

responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/PolicyInventoryResponseModel'
type: array
description: OK
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found

 

  • Ujwala2's avatar
    Ujwala2
    New Contributor

    Are you not getting the schema in your output html?