Skip to content

Commit

Permalink
fix: add readme explanation about ajv coerceTypes configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gal-cohen-payu-gpo committed Jan 13, 2025
1 parent 9319528 commit 670adcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Arguments, options and response are the same as for the `buildSchemaSync` method

- 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`
- Response validator does not support readOnly attribute

- 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]`).
## Open api 3 - known issues
- supporting inheritance with discriminator , only if the ancestor object is the discriminator.
- 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.
Expand Down

0 comments on commit 670adcc

Please sign in to comment.