KaiZen-OpenAPI-Editor icon indicating copy to clipboard operation
KaiZen-OpenAPI-Editor copied to clipboard

Swagger 2.0 should show schema templates in subschema contexts

Open tedepstein opened this issue 8 years ago • 2 comments

When editing OpenAPI 3.0, I can see schema templates wherever a subschema is allowed. At least, I have confirmed that this works with a property subschema:

image

It should also work with array items, allOf, and other subschema contexts, though I haven't verified.

But it does not work on property subschemas in Swagger 2.0 documents:

image

Swagger 2.0 editing is still important, so we should fix this.

tedepstein avatar Sep 27 '17 13:09 tedepstein

@tedepstein , this is because OpenApi3ContextTypeProvider is based on JSON Schema and SwaggerContextType is based on regex. I see you assigned this issue to the Next Sprint. We will migrate SwaggerContextType to JSON Schema in the next sprint then.

tfesenko avatar Sep 27 '17 13:09 tfesenko

@tfesenko , I've applied the new "Next Sprint" label to this, as I don't want to distract from completing OAS3 support.

IIRC, you introduced a new way of dynamically computing context, using JSON schema validation. This is lower-maintenance and less error-prone than specifying regular expressions for each context.

Did you only introduce that change for OAS3, not OAS2? How much work would it be to back-port that new schema-based context logic to OAS2?

(Note: our messages crossed. Just read your note above about OpenApi3ContextTypeProvider vs. SwaggerContextType, which is exactly what I was referring to. Next sprint, we can evaluate the work required to make this change.)

tedepstein avatar Sep 27 '17 13:09 tedepstein