I realize this may be a bit of an esoteric issue, but right now, openapi3 structures are not compatible with github.com/go-openapi/jsonpointer. Functionally that means that you can't take a jsonpointer reference + an openapi3.Swagger and get reliably get a valid result.
The crux of the problem is the *Ref values. Using the petstore example and trying to get /paths/~1pet/put/responses/200/content fails as /paths/~1pet/put/responses/200 resolves to a ResponseRef value which doesn't have a content field
One approach would be by adding JSONLookup functions to all the ref structures, but the nieve approach (as outlined in how go-openapi deals with similar situations) introduces a dependency on github.com/go-openapi/jsonpointer which I'm not sure would be wanted
In addition to play nice with jsonpointer references, something like /components/schemas/Foobar should return a *Schema or struct{Ref string} depending on if Foobar is a Schema Object or a Request Object. Which would require a bunch of additional types like Schemas Headers Parameters and so on
I'm almost certainly going to need to solve this problem myself, but if I did so in a way that was upstreamable that would be a bonus
I realize this may be a bit of an esoteric issue, but right now, openapi3 structures are not compatible with github.com/go-openapi/jsonpointer. Functionally that means that you can't take a jsonpointer reference + an openapi3.Swagger and get reliably get a valid result.
The crux of the problem is the *Ref values. Using the petstore example and trying to get
/paths/~1pet/put/responses/200/contentfails as/paths/~1pet/put/responses/200resolves to aResponseRefvalue which doesn't have acontentfieldOne approach would be by adding JSONLookup functions to all the ref structures, but the nieve approach (as outlined in how go-openapi deals with similar situations) introduces a dependency on
github.com/go-openapi/jsonpointerwhich I'm not sure would be wantedIn addition to play nice with jsonpointer references, something like
/components/schemas/Foobarshould return a*Schemaorstruct{Ref string}depending on if Foobar is a Schema Object or a Request Object. Which would require a bunch of additional types likeSchemasHeadersParametersand so onI'm almost certainly going to need to solve this problem myself, but if I did so in a way that was upstreamable that would be a bonus