Merged swagger outputs only require info of first proto file that is input
#2622 opened on Apr 1, 2022
Description
🐛 Bug Report
Thanks for the great help and guide, I could merge swagger outputs of different services.
By the way, the problem is that the merged output only shows the service info of the proto file that is used as the first input. If I don't write down service info of first proto file into .swagger.yaml file, swagger output (.swagger.json) does not show any info.
I'm curious about the intended behavior and the best practice. For example, if I have many services in an API group, and let's assume that new proto files are added, I should be aware of the first proto file(first in the alphabetic order) that is used for making swagger output. Moreover, the first proto file is not always a neutral one that represents whole proto files in an API group.
To Reproduce
There are a.proto, b.proto, c.proto
If swagger.yaml doesn't describe a.proto file like the following examples, any info will not show up in the swagger.json file.
openapiOptions:
file:
- file: "api/v1/b.proto"
option:
info:
title: API
version: "v1"
schemes:
- HTTPS
- HTTP
consumes:
- application/json
produces:
- application/json
openapiOptions:
file:
- file: "api/v1/a.proto"
- file: "api/v1/b.proto"
option:
info:
title: API
version: "v1"
schemes:
- HTTPS
- HTTP
consumes:
- application/json
produces:
- application/json
- file: "api/v1/c.proto"
Expected behavior
While merging swagger output, every possible service info is showed up
Actual Behavior
While merging swagger output, only service info that is input as the first proto file is showed up
Your Environment
macOS go1.16 darwin/amd64