My question:
I imported an OpenAPI spec via the postman directly and in that collection, all header parameters are by default enabled. In the OpenAPI spec, I have clearly defined that the relevant parameters are optional.
Details (like screenshots):
Headers defined as optional in OpenApi spec,
"parameters": [
{
"name": "If-Match",
"in": "header",
"description": "E-Tag",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "Prefer",
"in": "header",
"description": "Prefer: return=minimal",
"required": false,
"schema": {
"uniqueItems": true,
"type": "array",
"items": {
"type": "string",
"enum": [
"return=minimal"
]
}
}
}
]
Corresponding output when importing the spec in Postman,
Expected result,
I’ve already tried:
I tried converting the same OpenApi spec through openapi-to-postmanv2 tool. And then after importing the collection, I was able to see the same unexpected result as mentioned above.
I went through the collection.json which was the output by the openapi-to-postmanv2 tool and I could observe the following highlighted property which must be true in order to disable the optional header parameters.
.