Open WizMe-M opened 1 week ago
@WizMe-M nice find, yeah we should definitely resolve this. I'll take a look this weekend, I imagine we'd have to use custom types and encode differently based on the value but it's been a while so I might be off here.
Reproduce
Minimal repro structure
![image](https://github.com/user-attachments/assets/46b2f0d7-5163-4fb4-a77e-a26be69646a1)foo.proto
:option go_package = 'example.com/example/foo';
service FooService { rpc FooBar(FooRequest) returns (FooResponse); }
message FooRequest { }
message FooResponse { }
buf.gen.yaml
:plugins:
Actual behavior
Generated files
### YAML ```yaml paths: /foo: post: ... security: - MyJwtBearer: [] ``` ### JSON ```json "paths": { "/foo": { "post": { .... "security": [ { "MyJwtBearer": null } ] } ```If we take a look into gemerated apidocs we will see that:
[]
) forMyJwtBearer
in/foo
endpointnull
scope forMyJwtBearer
in/foo
endpointIf we check them out in Swagger Editor we will see, that json spec (with null scope) is invalid and editor misses auth for the endpoint.
Broken auth img
![image](https://github.com/user-attachments/assets/47e31cca-7165-42c7-a502-66a0973467fd)Expected behavior
Both
yaml
andjson
specs (output formats) will have the same identical scope value (empty array[]
)