Skip to content

Commit 209b9e3

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

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-
- 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]`).
163+
- It uses the Ajv `coerceTypes: "array"` flag, which enables type coercion for fields defined as arrays in the schema. This means values will be automatically parsed into arrays when possible. For example, `1` becomes `[1]`, and `"[1,2,3]"` becomes `[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)