google / google/gnostic

protoc-gen-openapi: reference to imported file

Open
#357 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Hi guys, I have a case that wants to refer to a schema from an imported file from a proto file. Since the `_ref` value on the `Reference` message is in `JSON Reference Spec`, I can't refer to the imported proto file, because the imported file not generated to the openapi schema using the `JSON reference spec`.

https://github.com/google/gnostic/blob/05a0ef713d66efb7cef8d4fd3e93b8961edf9d0b/openapiv3/OpenAPIv3.proto#L485-L487

Currently, i'm using the `protoc-gen-openapiv2` from `grpc-gateway`, they provide a JSON ref schema from the imported file by defining the package and the message name on https://github.com/grpc-ecosystem/grpc-gateway/blob/5d41954a8eb8075aef0c72842296da38a151411d/protoc-gen-openapiv2/options/openapiv2.proto#L428-L429.

Is possible / any workaround to refer to the imported proto file when generating the schema from proto fiile? I hope the `protoc-gen-openapi` from gnostic also can refer to the imported profo file.

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.