Skip to content

Commit 3bae781

Browse files
committed
update README
1 parent 29c8353 commit 3bae781

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
@@ -104,7 +104,7 @@ If set to `true` and `x-patternProperties` property is present, change `x-patter
104104

105105
Provide a function to handle pattern properties and set `supportPatternProperties` to take effect. The function takes the schema where `x-patternProperties` is defined on the root level. At this point `x-patternProperties` is changed to `patternProperties`. It must return the modified schema.
106106

107-
If the handler is not provided, the default handler is used. If `additionalProperties` is set and is an object, the default handler sets it to false if the root level `type` is the same as one of the types in `patternProperties` unless `type` is `object` or `array`. This is because we might want to define `additionalProperties` in OpenAPI spec file, but want to validate against a pattern. The pattern would turn out to be useless if `additionalProperties` of the same type were allowed.
107+
If the handler is not provided, the default handler is used. If `additionalProperties` is set and is an object, the default handler sets it to false if the `additionaProperties` object has deep equality with a pattern object inside `patternProperties`. This is because we might want to define `additionalProperties` in OpenAPI spec file, but want to validate against a pattern. The pattern would turn out to be useless if `additionalProperties` of the same structure were allowed. Create you own handler to override this functionality.
108108

109109
See `test/pattern_properties.js` for examples how this works.
110110

0 commit comments

Comments
 (0)