Skip to content

Commit 670adcc

Browse files
fix: add readme explanation about ajv coerceTypes configuration
1 parent 9319528 commit 670adcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Arguments, options and response are the same as for the `buildSchemaSync` method
160160

161161
- Objects - it is important to set any objects with the property `type: object` inside your swagger file, although it isn't a must in the Swagger (OpenAPI) spec in order to validate it accurately with [ajv](https://www.npmjs.com/package/ajv) it must be marked as `object`
162162
- Response validator does not support readOnly attribute
163-
163+
- The Ajv flag `coerceTypes: "array"` enables type coercion for fields defined as arrays in the schema. It will attempt to parse values into arrays when possible (e.g., `1``[1]`, `"[1,2,3]"``[1,2,3]`).
164164
## Open api 3 - known issues
165165
- supporting inheritance with discriminator , only if the ancestor object is the discriminator.
166166
- The discriminator supports in the inheritance chain stop when getting to a child with no discriminator (a leaf in the inheritance tree), meaning a leaf can't have a field which starts a new inheritance tree.

0 commit comments

Comments
 (0)