My question:
On what basis Postman is building the request body part?
Why Postman is deciding that the request body is application/x-www-form-urlencoded?
The expected result is application/json with json request body.
Details (like screenshots):
OpenAPI version: 2.0
Schema for one request
“/api/v{version:apiVersion}/ActivityTypesAdmin”: {
“post”: {
“tags”: [
“ActivityTypeAdmin”
],
“operationId”: “ActivityTypeAdmin_Add”,
“consumes”: [
“text/json”,
“application/xml”,
“text/xml”,
“application/x-www-form-urlencoded”,
“application/json”
],
“produces”: [
“application/json”,
“text/json”,
“application/xml”,
“text/xml”
],
“parameters”: [
{
“name”: “activityTypeModel”,
“in”: “body”,
“required”: true,
“schema”: {
“$ref”: “#/definitions/Web.Models.ActivityTypeModel”
}
},
{
“name”: “version:apiVersion”,
“in”: “path”,
“required”: true,
“type”: “string”
}
],
“responses”: {
“200”: {
“description”: “OK”,
“schema”: {
“$ref”: “#/definitions/Web.Models.ActivityTypeModel”
}
}
}
}
},
Definition
“Web.Models.ActivityTypeModel”: {
“type”: “object”,
“properties”: {
“Id”: {
“format”: “int32”,
“type”: “integer”
},
“Name”: {
“type”: “string”
},
“ShowInHistory”: {
“type”: “boolean”
},
“ShowFirmAttendees”: {
“type”: “boolean”
},
“ShowExternalAttendees”: {
“type”: “boolean”
},
“ShowComments”: {
“type”: “boolean”
},
“CanBeDeleted”: {
“type”: “boolean”
}
}
},
Effect in the Postman after import: