Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not handle patternProperties #49

Closed
ecyrbe opened this issue Oct 28, 2021 · 4 comments
Closed

Does not handle patternProperties #49

ecyrbe opened this issue Oct 28, 2021 · 4 comments

Comments

@ecyrbe
Copy link

ecyrbe commented Oct 28, 2021

OpenApiV3 currently does not handle patternProperties.
See exemple from open api from GitHub : https://github.com/OAI/OpenAPI-Specification/tree/main/schemas/v3.0
This is standard JsonSchema: https://json-schema.org/understanding-json-schema/reference/object.html#patternproperties

Maybe i can help fix it.

@glademiller
Copy link
Owner

It is interesting it shows up in their examples because if you look at this page https://swagger.io/docs/specification/data-models/keywords/ it says that patternProperties is unsupported. Looking through the specification https://swagger.io/specification/#schema-object seems to support that it isn't supported by OpenAPI 3.

@ecyrbe
Copy link
Author

ecyrbe commented Oct 28, 2021

Oh, you are right. What i tested was wrong. You can close.

@glademiller
Copy link
Owner

Thank you.

@ahl
Copy link
Collaborator

ahl commented Oct 28, 2021

Curiously the official docs make no mention of patternProperties
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md

The file you linked to (https://github.com/OAI/OpenAPI-Specification/tree/main/schemas/v3.0) is actually the schema for OpenAPI v3.0.x documents and note that it doesn't include patternProperties:

$ jq <schemas/v3.0/schema.json '.definitions.Schema.properties | keys'
[
  "additionalProperties",
  "allOf",
  "anyOf",
  "default",
  "deprecated",
  "description",
  "discriminator",
  "enum",
  "example",
  "exclusiveMaximum",
  "exclusiveMinimum",
  "externalDocs",
  "format",
  "items",
  "maxItems",
  "maxLength",
  "maxProperties",
  "maximum",
  "minItems",
  "minLength",
  "minProperties",
  "minimum",
  "multipleOf",
  "not",
  "nullable",
  "oneOf",
  "pattern",
  "properties",
  "readOnly",
  "required",
  "title",
  "type",
  "uniqueItems",
  "writeOnly",
  "xml"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants