-
Notifications
You must be signed in to change notification settings - Fork 25
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
Error with UnmarshalYAML() using http/bearer auth scheme #100
Comments
Thank you for raising this issue, it should be fixed now in |
Awesome! Thanks for fixing this so quickly! |
@vearutop However, this doesn't work same before. components:
securitySchemes:
basicAuth: # <-- arbitrary name for the security scheme
type: http
scheme: basic
security:
- basicAuth: [] # <-- use the same name here Reference - Authentication in OpenAPI |
@devleejb I'm not sure if I understand, could you explain in more detail the case and your expectations (maybe a reproducer)? |
@vearutop func TestSpec_MarshalYAML_3(t *testing.T) {
var s openapi31.Spec
spec := `openapi: 3.1.0
info:
title: MyProject
description: "My Project Description"
version: v1.0.0
components:
securitySchemes:
basicAuth: # <-- arbitrary name for the security scheme
type: http
scheme: basic
security:
- basicAuth: [] # <-- use the same name here
paths:
`
require.NoError(t, s.UnmarshalYAML([]byte(spec)))
} |
Ah, I see, thanks, let me quickly fix that. 😅 |
I was also confused at first! Here's the resulting error just for history:
|
Please check |
Thank you very much! |
Describe the bug
I get an error when unmarshaling an openapi v3 spec that includes "bearer" as the scheme and has a bearerFormat value:
To Reproduce
Run
github.com/swaggest/openapi-go/openapi31.Schema.Unmarshal()
with this input:Go Playground: https://go.dev/play/p/TpF1raEIANk
Expected behavior
I expected the scheme to parse without an error and have these assertions hold true of the resulting schema:
Additional context
github.com/swaggest/openapi-go v0.2.47
sudorandom/protoc-gen-connect-openapi#5
The text was updated successfully, but these errors were encountered: