forked from kogosoftwarellc/open-api
-
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.
openapi-request-validator: Allow to use request validation without pa…
…rameters (kogosoftwarellc#382) * openapi-request-validator: Not throw an error if parameters are not defined Closes kogosoftwarellc#381 * openapi-request-validator: add a test to check that works without parameters
- Loading branch information
Showing
2 changed files
with
54 additions
and
15 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
32 changes: 32 additions & 0 deletions
32
packages/openapi-request-validator/test/data-driven/accept-no-parameters.js
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,32 @@ | ||
module.exports = { | ||
validateArgs: { | ||
requestBody: { | ||
description: 'a test body', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
$ref: '#/components/schemas/Test1' | ||
} | ||
} | ||
} | ||
}, | ||
schemas: { | ||
Test1: { | ||
properties: { | ||
foo: { | ||
type: 'string' | ||
} | ||
}, | ||
required: ['foo'] | ||
} | ||
} | ||
}, | ||
request: { | ||
body: { | ||
foo: 'asdf' | ||
}, | ||
headers: { | ||
'content-type': 'application/json' | ||
} | ||
} | ||
}; |