Description
Is your feature request related to a problem? Please describe.
OpenApi.Net v2 allows example
properties to be set with a JsonNode value. This is a very welcome improvement as the 1.6 release required examples to be set using types from the OpenApi.Any package.
Unfortunately, it appears that spec extensions require values that are IOpenApiExtension
s, which means that they cannot have values that are JsonNode
s but must be wrapped in an OpenApiAny
object, like this:
schema.Extensions["x-dictionaryKey"] = // an object with $ref to the key schema
new OpenApiAny( new JsonObject() {["$ref"] = $"#/components/schemas/{keyType.Name}" });
Describe the solution you'd like
Like examples
, I'd like to be able to use simple JsonNode
values as the value of an Extension setting, like this:
schema.Extensions["x-dictionaryKey"] = // an object with $ref to the key schema
new JsonObject() {["$ref"] = $"#/components/schemas/{keyType.Name}" };
Describe alternatives you've considered
I can use OpenApiAny
-- it's just cumbersome and difficult to discover and inconsistent with the way examples
can be defined.