Open petriashev opened 3 years ago
We will probably have to make some changes to the OpenApiSchema model as we implement OpenAPI 3.1 support and support for JSON Schema 2020-12 draft. We can consider an interface then.
Wouldn't it just be easier to create a factory that creates an OpenAPISchema from an NJsonSchema parameter?
Wouldn't it just be easier to create a factory that creates an OpenAPISchema from an NJsonSchema parameter?
Yes it is another option. This case I need convert NJsonSchema -> OpenAPISchema and back. At this moment I think more easy is to create some schema adapter with functionality I need. But I don't want to create Yet Another Interface That Common to other existing :)
Third option is to support two branches for OpenApi and NJsonSchema separately.
I am a supporter of MicroElements.Swashbuckle.FluentValidation project and I want to support NJsonSchema (NSwag).
Issue: https://github.com/micro-elements/MicroElements.Swashbuckle.FluentValidation/issues/63 One of the possible solutions is to adapt NJsonSchema to OpenApiSchema but it is a concrete type.
Can we extract IOpenApiSchema interface?