Support propertyNames
Describe the problem to be solved
I would like to use JSON Schema's propertyNames key to restrict the names of an object type's additionalProperties:
steps:
type: object
propertyNames:
enum:
- prop1
- prop2
additionalProperties:
type: string
However, Redoc ignores propertyNames:
Describe the solution you'd like
Redoc should use the propertyNames key when rendering the possible additional properties.
Describe alternatives you've considered
Redoc already supports patternProperties, which I could use to restrict the supported properties. However, in my actual use case, the propertyNames references a shared enum definition. I would like to avoid the manual process of keeping both definitions in-sync.
Additional context
The same example expressed using patternProperties:
propertyNames could be displayed similarly, by putting the propertyNames type in the left column.
this is dependent on the OAS version you are using.
OpenAPI 3.0.x does not support patternProperties or propertyNames as they are not supported by the OpenAPI Schema object. https://spec.openapis.org/oas/v3.0.4#json-schema-keywords
These are only supported if you are using OAS 3.1.x or later as the Schema Object now fully supports JSON Schema Draft 2020-12.
Our schema uses OpenAPI 3.1.1