-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add x-www-form-urlencoded media type examples support (#67)
* Add x-www-form-urlencoded media type * ditch querystring dependency * escape keys and values * add test * fix: replace all '%20' occurrences * fix: use replace function with wildcard instead of replaceAll * improve syntax Co-authored-by: Diogo Silva <[email protected]>
- Loading branch information
1 parent
b999cd0
commit 52b9e66
Showing
3 changed files
with
101 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Sample API", | ||
"description": "A sample API to demonstrate x-www-form-encoded request body example" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://auth.io/api" | ||
} | ||
], | ||
"paths": { | ||
"/auth/token": { | ||
"post": { | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/x-www-form-urlencoded": { | ||
"schema": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"secret" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"example": "id example value" | ||
}, | ||
"secret": { | ||
"type": "string", | ||
"example": "secret example value" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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