Before fixing this issue, if fq_schema_naming = false and there were duplicates of schema names traversed and formatted from all imported proto files, the wrong message could be selected, even if it was not actually used.
Now, when a message of fully-qualified schema named foo.Contact is going to be generatd, at the same time, a duplicate short schema like Contact formatted from bar.Contact is found (used), so the fully-qualified foo.Contact will be used.
fixes #392
Before fixing this issue, if
fq_schema_naming = false
and there were duplicates of schema names traversed and formatted from all imported proto files, the wrong message could be selected, even if it was not actually used.Now, when a message of fully-qualified schema named
foo.Contact
is going to be generatd, at the same time, a duplicate short schema likeContact
formatted frombar.Contact
is found (used), so the fully-qualifiedfoo.Contact
will be used.sample:
protoc
arguments:--openapi_opt naming=proto,fq_schema_naming=false,default_response=false
Before:
```yaml # ellipsis ... paths: /book/bar: get: # ellipsis ... responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/Book' /book/foo: get: # ellipsis ... responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/Book' components: schemas: Book: type: object properties: id: type: string name: type: string publisher: type: string ```After: