Skip to content

Commit b4c4895

Browse files
author
Mika Kunnas
committed
update README
1 parent aa9210a commit b4c4895

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ If set to `true` and `x-patternProperties` property is present, change `x-patter
102102

103103
#### `patternPropertiesHandler` (function)
104104

105-
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`.
105+
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

107107
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`. 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.
108108

109+
See `test/pattern_properties.js` for examples how this works.
110+

0 commit comments

Comments
 (0)