feat(RequestBody): validation support for required fields (#6223)
fixes #5181 * application/json * application/xml * application/x-www-form-urlencoded * Set requestBodyValue values to be an immutable Map, as "value". Previously stored as a normal String. * This enables adding "errors" to the Map, for validation use * note: getOAS3RequiredRequestBodyContentType requires state.spec, * which is not available to state.oas3
This commit is contained in:
27
test/e2e-cypress/static/documents/bugs/5181.yaml
Normal file
27
test/e2e-cypress/static/documents/bugs/5181.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
info:
|
||||
title: Required parameter missing, doesn't block request from executing.
|
||||
version: '1'
|
||||
openapi: 3.0.0
|
||||
servers:
|
||||
- url: http://httpbin.org/anything
|
||||
paths:
|
||||
/foos:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
# application/json:
|
||||
# application/xml:
|
||||
schema:
|
||||
properties:
|
||||
foo:
|
||||
type: string
|
||||
bar:
|
||||
type: string
|
||||
required:
|
||||
- foo
|
||||
type: object
|
||||
required: true # Note this doesn't have an impact
|
||||
responses:
|
||||
default:
|
||||
description: ok
|
||||
@@ -415,4 +415,4 @@ components:
|
||||
api_key:
|
||||
type: apiKey
|
||||
name: api_key
|
||||
in: header
|
||||
in: header
|
||||
|
||||
Reference in New Issue
Block a user