Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix Javascript syntax #611

Merged
merged 1 commit into from
Jun 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Expand Up @@ -498,15 +498,15 @@ OpenApiValidator.middleware({
validate: (value: any) => boolean,
}],
unknownFormats: ['phone-number', 'uuid'],
serDes: [{
serDes: [
OpenApiValidator.serdes.dateTime,
OpenApiValidator.serdes.date,
{
format: 'mongo-objectid',
deserialize: (s) => new ObjectID(s),
serialize: (o) => o.toString(),
},
}],
],
operationHandlers: false | 'operations/base/path' | { ... },
ignorePaths: /.*\/pets$/,
fileUploader: { ... } | true | false,
Expand All @@ -521,7 +521,7 @@ OpenApiValidator.middleware({
Specifies the path to an OpenAPI 3 specification or a JSON object representing the OpenAPI 3 specification

```javascript
apiSpec: './path/to/my-openapi-spec.yaml';
apiSpec: './path/to/my-openapi-spec.yaml',
```

or
Expand Down Expand Up @@ -556,7 +556,7 @@ Determines whether the validator should validate requests.

```javascript
validateRequests: {
allowUnknownQueryParameters: true;
allowUnknownQueryParameters: true,
}
```

Expand Down Expand Up @@ -594,7 +594,7 @@ Determines whether the validator should validate requests.

```javascript
validateRequests: {
coerceTypes: true;
coerceTypes: true,
}
```

Expand All @@ -611,7 +611,7 @@ Determines whether the validator should validate requests.

```javascript
validateRequests: {
removeAdditional: true;
removeAdditional: true,
}
```

Expand All @@ -637,7 +637,7 @@ Determines whether the validator should validate responses. Also accepts respons

```javascript
validateResponses: {
removeAdditional: 'failing';
removeAdditional: 'failing',
}
```

Expand Down Expand Up @@ -742,7 +742,7 @@ Defines how the validator should behave if an unknown or custom format is encoun
e.g.

```javascript
unknownFormats: ['phone-number', 'uuid'];
unknownFormats: ['phone-number', 'uuid'],
```

- `"ignore"` - to log warning during schema compilation and always pass validation. This option is not recommended, as it allows to mistype format name and it won't be validated without any error message.
Expand All @@ -755,10 +755,10 @@ e.g.

```javascript
// If `serDes` is not specified, the following behavior is default
serDes: [{
serDes: [
OpenApiValidator.serdes.dateTime.serializer,
OpenApiValidator.serdes.date.serializer,
}],
],
```

To create custom serializers and/or deserializers, define:
Expand Down Expand Up @@ -887,7 +887,7 @@ Specifies the options to passthrough to multer. express-openapi-validator uses m

```javascript
fileUploader: {
dest: 'uploads/';
dest: 'uploads/',
}
```

Expand All @@ -904,7 +904,7 @@ e.g.

```javascript
$refParser: {
mode: 'bundle';
mode: 'bundle',
}
```

Expand Down