-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panicking on unresolved ref #324
Comments
So to recap https://globalsteam.online/api/globalsteam.json seems to be a valid OpenAPIv3 spec according to https://editor.swagger.io/ Your code uses kin-openapi v0.37.0 https://github.com/deepmap/oapi-codegen/blob/26bb06c00b13ddc6c26107402b8fa398be98ea29/go.mod#L5 try using the latest tag as it has changes related to refs v0.37.0...master Your code calls https://github.com/deepmap/oapi-codegen/blob/3e0fd9593a08e23613736071c8938ed4cbdde704/pkg/codegen/templates/inline.tmpl#L24 which calls kin-openapi/openapi3/swagger_loader.go Line 151 in 0ef6b18
Note: this code should also be calling kin-openapi/openapi3/swagger.go Line 49 in 0ef6b18
Please see about the two points in italics. |
Thanks! I got kin-openapi updated in oapi-codegen. It still panicked inside Running my Swagger{} through openapi3.NewSwaggerLoader().ResolveRefsIn(swagger, nil) before parsing it into My code is basically just:
The reason it can't find the route is because r.URL.Scheme & r.URL.Host were empty so it couldnt compare to the server addresses inside my |
Ended up using this middleware:
as the scheme/host are not always set but kin-openapi seems to require them to be. |
cc #118 |
Hi, I am calling openapi3filter.ValidateRequest() (via https://github.com/deepmap/oapi-codegen/blob/master/pkg/chi-middleware/oapi_validate.go#L23) and I am getting
If I remove the places that use
product-price-schema
, the same thing happens tostat-schema
. As far as I can tell the JSON is according to spec.The OpenAPI3 JSON is here (https://globalsteam.online/api/globalsteam.json), both the schemas exist inside
#/components/schemas/
Any ideas? Thanks.
The text was updated successfully, but these errors were encountered: