sudorandom / protoc-gen-connect-openapi

Plugin for generating OpenAPIv3 from protobufs matching the Connect RPC interface
MIT License
103 stars 7 forks source link

google.api.http.get path segment can't start with . #20

Closed iamnoah closed 4 months ago

iamnoah commented 4 months ago

minimal example:

service Foo {
  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {
    option idempotency_level = NO_SIDE_EFFECTS;
    option (google.api.http) = {
      get: "/.well-known/jwks.json"
    };
  }
}

Results in:

WRN unable to parse template pattern error="unrecognized word at position: 1: .well-known" template=/.well-known/jwks.json

And the resulting OpenAPI spec has a post with path /package.Foo/Foo instead of the given path.

A . elsewhere in the path doesn't seem to cause issues, just at the start of a segment.

sudorandom commented 4 months ago

@iamnoah thanks for reporting this! I changed the parser to allow for this and released this as v0.8.6. Let me know if you see any other issues like this!