[
{
"subject": "req/res",
"schema": {
"openapi": "3.0.0",
"info": { "title": "Nullable", "version": "" },
"paths": {
"/company/{company}/pets": {
"parameters": [
{
"name": "company",
"in" : "path",
"schema" : {
"type" : "string",
"enum": [ "google", "amazon", "skbkontur" ]
},
"required": true
}
],
"post": {
"parameters": [
{
"name": "X-VERSIon",
"in" : "header",
"schema" : {
"type" : "string",
"enum": [ "7.3Rev2", "7.3Rev3" ]
},
"required": true
},
{
"name": "params",
"in" : "query",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/params"
}
}
},
"required": true
},
{
"name": "optional_param",
"in" : "query",
"schema" : {
"type" : "string",
"enum" : ["optional"]
},
"required": false
},
{
"name": "deprecated_param",
"in" : "query",
"schema" : {
"type" : "string",
"enum" : ["deprecated"]
},
"deprecated": true
},
{
"name": "int_param",
"in" : "query",
"schema" : {
"$ref" : "#/components/schemas/"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref" : "#/components/schemas/Pet"
}
}
}
},
"responses": {
"200": {
"description" : "Pets list",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"params": {
"$ref" : "#/components/schemas/params"
},
"pets" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Pet"
}
}
}
}
}
},
"headers" : {
"X-SERVER-sUPPoRTED-vERSIONs" : {
"required" : true,
"content" : {
"application/json" : {
"schema" : {
"type" : "array",
"items" : {
"type" : "integer"
}
}
}
}
}
}
},
"202" : {
"description" : "created"
},
"default": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"get" : {
"deprecated": true,
"parameters" : [
{
"name": "number",
"in" : "query",
"schema" : {
"type" : "string",
"enum": [ 1 ]
}
}
],
"responses" : {
"200" : {
"description" : "success"
}
}
}
},
"/encoding/common": {
"post" : {
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"info" : {
"type" : "object",
"properties" : {
"grade" : {
"type" : "integer"
},
"age" : {
"type" : "integer"
}
}
}
}
},
"encoding" : {
"info" : {
"contentType" : "application/json"
}
}
}
}
},
"responses" : {
"200" : {
"description" : ""
}
}
}
},
"/encoding/default": {
"post" : {
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"surname" : {
"type" : "string"
},
"info" : {
"type" : "object",
"properties" : {
"grade" : {
"type" : "integer"
},
"age" : {
"type" : "integer"
}
}
}
}
}
}
}
},
"responses" : {
"200" : {
"description" : ""
}
}
}
}
},
"components": {
"schemas": {
"" : {
"type" : "integer",
"format" : "int32"
},
"params": {
"type" : "object",
"properties" : {
"theme" : {
"type" : "string",
"enum" : ["butterfly", "alligator"]
},
"offset": {
"type" : "integer",
"writeOnly": true
}
},
"required" : [ "theme", "offset" ]
},
"Pet": {
"type": "object",
"discriminator": {
"propertyName": "petType"
},
"properties": {
"name": {
"type": "string"
},
"petType": {
"type": "string"
},
"id": {
"type": "integer",
"readOnly": true
},
"like" : {
"type": "string",
"enum": ["fish", "bone", "meat"]
}
},
"required": [ "name", "petType", "id"]
},
"Cat": {
"allOf": [
{
"$ref": "#/components/schemas/Pet"
},
{
"type": "object",
"properties": {
"huntingSkill": {
"type": "string",
"enum": [
"lazy",
"adventurous",
"aggressive"
]
}
},
"required": [ "huntingSkill" ]
}
]
},
"Dog": {
"allOf": [
{
"$ref": "#/components/schemas/Pet"
},
{
"type": "object",
"properties": {
"packSize": { "type": "integer" }
},
"required": [ "packSize" ]
}
]
},
"Error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}
},
"tests": [
{
"description": "complex test ok",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional",
"int_param" : "123"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
"params" : {
"theme" : "butterfly"
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"like" : "fish",
"huntingSkill" : "aggressive",
"id" : 10
},
{
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"header_res" : {
"X-SERVER-sUPPoRTED-vERSIONs" : [ 2, 3 ]
},
"valid_req": true,
"valid_res": true
},
{
"description": "complex test ok without optional params and wrong deprecated field value which validation skipped",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"warnings" : true,
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"deprecated_param" : "another value"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
"params" : {
"theme" : "butterfly"
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"huntingSkill" : "aggressive",
"id" : 10
},
{
"petType" : "Dog",
"name" : "Ilya",
"packSize" : "123",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"header_res" : {
"X-SERVER-sUPPoRTED-vERSIONs" : [ 2, 3 ]
},
"valid_req": true,
"valid_res": true
},
{
"description": "complex test wrong, required params offset, pet.id",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\" }",
"optional_param" : "optional"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
"params" : {
"theme" : "butterfly"
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"like" : "fish",
"huntingSkill" : "aggressive"
},
{
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"header_res" : {
"X-SERVER-sUPPoRTED-vERSIONs" : [ 2, 3 ]
},
"valid_req": false,
"valid_res": false
},
{
"description": "complex test wrong, required params compony, pet.packSize",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
"params" : {
"theme" : "butterfly"
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"like" : "fish",
"huntingSkill" : "aggressive",
"id" : 10
},
{
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"header_res" : {
"X-SERVER-sUPPoRTED-vERSIONs" : [ 2, 3 ]
},
"valid_req": false,
"valid_res": false
},
{
"description": "complex test wrong, required X-VERSION, wrong status",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional"
},
"header_req" : {
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "201",
"body_res" : {
"params" : {
"theme" : "butterfly"
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"like" : "fish",
"huntingSkill" : "aggressive",
"id" : 10
},
{
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"valid_req": false,
"valid_res": false
},
{
"description": "complex test wrong, readOnly and writeOnly params",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123",
"id" : 11
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
"params" : {
"theme" : "butterfly",
"offset": 10
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"like" : "fish",
"huntingSkill" : "aggressive",
"id" : 10
},
{
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"header_res" : {
"X-SERVER-sUPPoRTED-vERSIONs" : [ 2, 3 ]
},
"valid_req": false,
"valid_res": false
},
{
"description": "complex test ok, match response error",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "500",
"body_res" : {
"code" : 12345,
"message" : "some error occured"
},
"ctype_res" : "application/json",
"valid_req": true,
"valid_res": true
},
{
"description": "test ok, skip deprecated operation object, so param number is not validated",
"method" : "get",
"openapi_path" : "/company/{company}/pets",
"warnings" : true,
"path" : {
},
"query" : {
"number" : "2"
},
"header_req" : {
},
"body_req" : {
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
},
"ctype_res" : "application/json",
"valid_req": true,
"valid_res": true
},
{
"description": "test format, wrong int parameter",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional",
"int_param" : "123.2"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : {
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123"
},
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {
"params" : {
"theme" : "butterfly"
},
"pets" : [
{
"petType" : "Cat",
"name" : "Vanya",
"like" : "fish",
"huntingSkill" : "aggressive",
"id" : 10
},
{
"petType" : "Dog",
"name" : "Ilya",
"like" : "bone",
"packSize" : "123",
"id" : 11
}
]
},
"ctype_res" : "application/json",
"header_res" : {
"X-SERVER-sUPPoRTED-vERSIONs" : [ 2, 3 ]
},
"valid_req": false,
"valid_res": true
},
{
"description": "request with null body and response with empty body; github issue 9",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional",
"int_param" : "123"
},
"header_req" : {
"X-VERSION" : "7.3Rev2"
},
"body_req" : null,
"ctype_req" : "application/json",
"status" : "202",
"body_res" : {},
"ctype_res" : "application/json",
"valid_req": true,
"valid_res": true
},
{
"description": "ctype url-encoded/form-data and property has encoding option; incorrect; github issue 8",
"method" : "post",
"openapi_path" : "/encoding/common",
"path" : { },
"query" : { },
"header_req" : { },
"body_req" : {
"name" : "Anna",
"info" : "{\"grade\" : 5, \"age\": {}}"
},
"ctype_req" : "application/x-www-form-urlencoded",
"status" : "200",
"body_res" : null,
"ctype_res" : "application/json",
"valid_req": false,
"valid_res": true
},
{
"description": "ctype url-encoded/form-data and property has encoding option; correct; github issue 8",
"method" : "post",
"openapi_path" : "/encoding/common",
"path" : { },
"query" : { },
"header_req" : { },
"body_req" : {
"name" : "Anna",
"info" : "{\"grade\" : 5, \"age\": 12}"
},
"ctype_req" : "application/x-www-form-urlencoded",
"status" : "200",
"body_res" : null,
"ctype_res" : "application/json",
"valid_req": true,
"valid_res": true
},
{
"description": "ctype url-encoded/form-data and property has encoding option; not json; github issue 8",
"method" : "post",
"openapi_path" : "/encoding/common",
"path" : { },
"query" : { },
"header_req" : { },
"body_req" : {
"name" : "Anna",
"info" : "not json"
},
"ctype_req" : "application/x-www-form-urlencoded",
"status" : "200",
"body_res" : null,
"ctype_res" : "application/json",
"valid_req": false,
"valid_res": true
},
{
"description": "ctype url-encoded/form-data and property has encoding option; default incorrect; github issue 8",
"method" : "post",
"openapi_path" : "/encoding/default",
"path" : { },
"query" : { },
"header_req" : { },
"body_req" : {
"name" : "Anna",
"info" : "{\"grade\" : 5, \"age\": {}}"
},
"ctype_req" : "application/x-www-form-urlencoded",
"status" : "200",
"body_res" : null,
"ctype_res" : "application/json",
"valid_req": false,
"valid_res": true
},
{
"description": "ctype url-encoded/form-data and property has encoding option; default correct; github issue 8",
"method" : "post",
"openapi_path" : "/encoding/default",
"path" : { },
"query" : { },
"header_req" : { },
"body_req" : {
"name" : "Anna",
"info" : "{\"grade\" : 5, \"age\": 12}"
},
"ctype_req" : "application/x-www-form-urlencoded",
"status" : "200",
"body_res" : null,
"ctype_res" : "application/json",
"valid_req": true,
"valid_res": true
},
{
"description": "failure to specify \"header\" parameter fails validation on schemas that contain them; github issue 29",
"method" : "post",
"openapi_path" : "/company/{company}/pets",
"path" : {
"company" : "skbkontur"
},
"query" : {
"params" : "{ \"theme\" : \"butterfly\", \"offset\" : 10 }",
"optional_param" : "optional",
"int_param" : "123"
},
"body_req" : null,
"ctype_req" : "application/json",
"status" : "200",
"body_res" : {},
"ctype_res" : "application/json",
"valid_req": false,
"valid_res": false
}
]
}
]