Post with String in body is failing string validation
See original GitHub issueThis is my first app using open-api. Love it where numbers are concerned, but string validation on this path are failing. Unsure if bug, or me being dumb.
Environment
- express-openapi - 3.6.0
- node - 10.15.0
Api Call (from chrome Network panel)
Url: http://localhost:3000/app/121/toggle_setting
Body: {"settingName":"isLocked","val":false}
Api Definition
[
"/app/{id}/toggle_setting": {
"post": {
"description": "Toggles a single setting for one app. Returns app full state",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "number"
}
},
{
"in": "body",
"name": "settingName",
"schema": {
"type": "string"
}
},
{
"in": "body",
"name": "val",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "A app's configuration.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/appFull"
}
}
}
}
}
}
}
]
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
HTTP Post with request body failed when using Regex to ...
HTTP Post with request body failed when using Regex to validate body parameter ... I'm testing an Express API using the post method....
Read more >Validate Request Body in RESTful Web Service
In this tutorial, you will learn how to validate the request body of an HTTP Post request sent to a RESTful Web Service...
Read more >Help need with validating response that it is a string and ...
I have a response for a PUT request as below which is an array and can have 2 elements in the array. Response....
Read more >How to validate Json Post Request body aginest a schema ...
TIA , I'm receiving fallowing sample data to my AZURE APIM Api as a request body. I want to validate Json body againest...
Read more >Resolve template validation or template format errors in ... - AWS
In the following example JSON and YAML templates, the condition in the resource EC2RouteA is specified as a list of strings instead of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks guys, really appreciate the followup. Wish I’d more time to do the same since opening. Will do in the coming weeks and re-open (with better details) if I find something amiss.
@relativityboy please submit a PR