I am trying to configure swagger for my application. Being new to this field I went to different tutorials and tried to convert the below json to YAML but it's giving errors like bad indentation, response missing etc. The main problem I am facing is in recognizing syntax to represent array of list in YAML format, then to add block in YAML which shows expected values for a particular block.
JSON Format to be converted to YAML:
{
"abc":[
{
"xyz":[ //array of list
{
"id":"",
"name":"",
"relation":[ //array of list
{
"first":{
"xxx":"",
"xxx":"",
"xxx":[ //array of string
""
]
},
"second":{
"xxx":"",
"xxx":"",
"xxx":[
""
],
"type":""
}
},
{
"first":{
"xxx":"",
"xxx":"",
"xxx":[ //array of string
""
]
},
"second":{
"xxx":"",
"xxx":"",
"xxx":[
""
],
"type":""
}
}
],
"rows":[
]
}
]
}
YAML is as below:
swagger: "2.0"
info:
version: 1.0.0
title: xxxx
description: xxxx
schemes:
- https
host: xxxx
basePath: xxxx
paths:
/xxx:
post:
summary: xxxx
consumes:
- application/json
produces:
- application/json
parameters:
abc:
- xyz:
id: string
name: string
relation: string
- first:
id: string
name: string
relation: string
second:
id: string
name: string
relation: string
- first:
id: string
name: string
relation: string
second:
id: string
name: string
relation: string
responses:
'200':
description: Created