Hi all,
After creating a new API in PM (see JSON code) and Add Collection → Generate from definition the requestBody duplicates the proparray
indexes and deleted
array is not printed.
When importing same file to Swagger of Insomnia it produces the correct array.
See screenshots below.
Please help.
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Sample API",
"description": "Example of API"
},
"servers": [
{
"url": "exampleapi.com/"
}
],
"paths": {
"/exampleapi/": {
"parameters": [
{
"name": "userId",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "John Doe"
}
}
],
"put": {
"tags": [
"testapi"
],
"summary": "testing the api",
"requestBody": {
"description": "testing the api",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/reqbody"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"reqbody": {
"type": "object",
"properties": {
"prop1": {
"type": "string",
"example": "prop1value"
},
"prop2": {
"type": "string",
"example": ""
},
"proparray": {
"type": "array",
"items": {
"properties": {
"proparray1": {
"type": "string",
"example": "proparray1value"
},
"proparray2": {
"type": "string",
"example": "proparray2value"
},
"proparray3": {
"type": "string",
"example": ""
}
}
}
},
"deleted": {
"type": "array",
"items": {
"properties": {}
}
},
"mark": {
"type": "string",
"example": ""
}
}
},
"ApiResponse": {
"type": "object",
"properties": {
"succes": {
"type": "string",
"example": "true"
},
"errorCode": {
"type": "string",
"example": "200"
},
"errorMessage": {
"type": "string",
"example": "OK"
}
}
},
"Error": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"description": "A human readable error message",
"type": "string"
}
}
}
}
}
}