Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 22, 2019
1 parent 3fcfddf commit 7f07d85
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ new OpenApiMiddleware({

```javascript
new OpenApiMiddleware({

// required: path to an openapi 3 spec
apiSpecPath: './openapi.yaml',
// default is true
// validates the openapi spec, throws if invalid

// default true: validates the openapi spec, throws if invalid
validateApiDoc: true,
// default is true
// attempts to coerce a value's type to that defined in the openapi spec

// default: trueattempts to coerce a value's type to that defined in the openapi spec
enableObjectCoercion: true,
// default is undefined
// provide a custom error transform to customize how errors are shaped

// optional: provide a custom error transform to customize how errors are shaped
errorTransform: validationResult => ({
// the http status code to return
statusCode: validationResult.status,
Expand Down

0 comments on commit 7f07d85

Please sign in to comment.