-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: check unsupported bodyRequest format
- Loading branch information
Showing
4 changed files
with
311 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...tures/SwaggerServiceTest/documentation/invalid_format__request_body__invalid_content.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Invalid API" | ||
}, | ||
"paths": { | ||
"/users/{id}": { | ||
"post": { | ||
"consumes": [], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"image/png": { | ||
"items": [] | ||
} | ||
}, | ||
"required": true, | ||
"description": "" | ||
}, | ||
"responses": { | ||
"default": { | ||
"description": "hello world" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
256 changes: 256 additions & 0 deletions
256
tests/fixtures/SwaggerServiceTest/documentation/invalid_format__response__invalid_items.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,256 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Swagger Petstore 2.0" | ||
}, | ||
"host": "petstore.swagger.io", | ||
"basePath": "/v2", | ||
"tags": [ | ||
{ | ||
"name": "pet", | ||
"description": "Everything about your Pets", | ||
"externalDocs": { | ||
"description": "Find out more", | ||
"url": "http://swagger.io" | ||
} | ||
}, | ||
{ | ||
"name": "store", | ||
"description": "Access to Petstore orders" | ||
}, | ||
{ | ||
"name": "user", | ||
"description": "Operations about user", | ||
"externalDocs": { | ||
"description": "Find out more about our store", | ||
"url": "http://swagger.io" | ||
} | ||
} | ||
], | ||
"schemes": [ | ||
"https", | ||
"http" | ||
], | ||
"paths": { | ||
"/users/{id}": { | ||
"post": { | ||
"tags": [ | ||
"pet" | ||
], | ||
"summary": "Finds Pets by status", | ||
"description": "Multiple status values can be provided with comma separated strings", | ||
"operationId": "findPetsByStatus", | ||
"produces": [ | ||
"application/xml", | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "successful operation", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Pet" | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Invalid status value" | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"petstore_auth": [ | ||
"write:pets", | ||
"read:pets" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"securityDefinitions": { | ||
"petstore_auth": { | ||
"type": "oauth2", | ||
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog", | ||
"flow": "implicit", | ||
"scopes": { | ||
"write:pets": "modify pets in your account", | ||
"read:pets": "read your pets" | ||
} | ||
}, | ||
"api_key": { | ||
"type": "apiKey", | ||
"name": "api_key", | ||
"in": "header" | ||
} | ||
}, | ||
"definitions": { | ||
"Order": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"petId": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"quantity": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"shipDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "Order Status", | ||
"enum": [ | ||
"placed", | ||
"approved", | ||
"delivered" | ||
] | ||
}, | ||
"complete": { | ||
"type": "boolean", | ||
"default": false | ||
} | ||
}, | ||
"xml": { | ||
"name": "Order" | ||
} | ||
}, | ||
"Category": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"xml": { | ||
"name": "Category" | ||
} | ||
}, | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"username": { | ||
"type": "string" | ||
}, | ||
"firstName": { | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"type": "string" | ||
}, | ||
"email": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"phone": { | ||
"type": "string" | ||
}, | ||
"userStatus": { | ||
"type": "integer", | ||
"format": "int32", | ||
"description": "User Status" | ||
} | ||
}, | ||
"xml": { | ||
"name": "User" | ||
} | ||
}, | ||
"Tag": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"xml": { | ||
"name": "Tag" | ||
} | ||
}, | ||
"Pet": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"photoUrls" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"category": { | ||
"$ref": "#/definitions/Category" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "doggie" | ||
}, | ||
"photoUrls": { | ||
"type": "array", | ||
"xml": { | ||
"name": "photoUrl", | ||
"wrapped": true | ||
}, | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"tags": { | ||
"type": "array", | ||
"xml": { | ||
"name": "tag", | ||
"wrapped": true | ||
}, | ||
"items": { | ||
"$ref": "#/definitions/Tag" | ||
} | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "pet status in the store", | ||
"enum": [ | ||
"available", | ||
"pending", | ||
"sold" | ||
] | ||
} | ||
}, | ||
"xml": { | ||
"name": "Pet" | ||
} | ||
} | ||
} | ||
} |