-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The request body was validated only when it had already been read, since the request had already been sent. As kin-openapi is expected to be used on the server side, the GetBody function was not used as it's expected to be nil. Allowing for proper body validation by setting the body explicitly back to the original by using `GetBody` when recording the request/response. Add more tests for the base cases.
- Loading branch information
1 parent
57d2937
commit cf7dd4a
Showing
8 changed files
with
293 additions
and
41 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
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
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,21 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: ping test | ||
version: '1.0' | ||
servers: | ||
- url: 'http://localhost:8000/' | ||
paths: | ||
/mini: | ||
get: | ||
responses: | ||
"201": | ||
content: | ||
"application/json": | ||
schema: | ||
type: object | ||
properties: | ||
number: | ||
type: integer | ||
required: | ||
- number | ||
description: A number! |
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,23 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: ping test | ||
version: '1.0' | ||
servers: | ||
- url: 'http://localhost:8000/' | ||
paths: | ||
/req: | ||
post: | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
input: | ||
type: string | ||
required: | ||
- input | ||
responses: | ||
"204": | ||
description: "Just an empty response" |
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,35 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: ping test | ||
version: '1.0' | ||
servers: | ||
- url: 'http://localhost:8000/' | ||
paths: | ||
/ping: | ||
get: | ||
responses: | ||
"200": | ||
content: | ||
"application/json": | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
required: | ||
- message | ||
description: The pongness | ||
/other: | ||
get: | ||
responses: | ||
"200": | ||
content: | ||
"application/json": | ||
schema: | ||
type: object | ||
properties: | ||
thing: | ||
type: string | ||
required: | ||
- thing | ||
description: The other one! |
Oops, something went wrong.