Skip to content

Commit

Permalink
doc: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Feb 15, 2021
1 parent 5984250 commit 3cbcba9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ app.use(
OpenApiValidator.middleware({
apiSpec: './api.yaml',
validateResponses: true, // <-- to validate responses
// unknownFormats: ['my-format'] // <-- to provide custom formats
}),
);

Expand Down Expand Up @@ -755,7 +754,7 @@ serDes: [{
```
To create custom serializers and/or deserializers, define:
- `format` (required) - a custom schema format that triggers the serializer and/or deserializer
- `format` (required) - a custom 'unknown' format that triggers the serializer and/or deserializer
- `deserialize` (optional) - upon receiving a request, transform a string property to an object. Deserialization occurs _after_ request schema validation.
- `serialize` (optional) - before sending a response, transform an object to string. Serialization occurs _after_ response schema validation
Expand All @@ -774,8 +773,14 @@ serDes: [{
}
}],
```
The mongo serializers will trigger on the following schema:
```yaml
type: string
format: mongo-objectid
```
The [mongo-serdes-js](https://github.com/pilerou/mongo-serdes-js) package provides additional (de)serializers including MongoDB `ObjectID`, `UUID`, ...
See [mongo-serdes-js](https://github.com/pilerou/mongo-serdes-js) for additional (de)serializers including MongoDB `ObjectID`, `UUID`, ...
### ▪️ operationHandlers (optional)
Expand Down

0 comments on commit 3cbcba9

Please sign in to comment.