Extension Field Registry
x-jsonschema-patternProperties - A map of regular expressions to schemas for matching property names, used when targeting OpenAPI versions that do not directly support patternProperties.
JSON Schema draft-03 introduced the patternProperties keyword to map regular expressions to schemas for matching property names.
The x-jsonschema-patternProperties extension mirrors the JSON Schema patternProperties keyword by serializing it as x-jsonschema-patternProperties when targeting OpenAPI versions where patternProperties is not directly available.
Use this extension only with JSON Schema versions before draft-03; draft-03 and later define patternProperties directly.
It can appear as a property in the following objects: ["Schema Object"].
Used by: (informational)
- Microsoft.OpenApi (.NET OpenAPI library)
Schema
{"type"=>"object", "additionalProperties"=>{"$ref"=>"#/$defs/schemaObject"}}
Example
openapi: 3.0.4
info:
title: My API
version: 1.0.0
paths: {}
components:
schemas:
User:
type: object
x-jsonschema-patternProperties:
"^S_":
type: string