Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ref conflict #318

Closed
wants to merge 1 commit into from
Closed

Conversation

tonybase
Copy link
Contributor

@tonybase tonybase commented Mar 16, 2022

Fixed the same schema name in different packages:

$ref: '#/components/schemas/Book'
->
$ref: '#/components/schemas/.library.v1.Book'

Example:

# Generated with protoc-gen-openapi
# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi

openapi: 3.0.3
info:
    title: Greeter API
    description: The greeting service definition.
    version: 0.0.1
paths:
    /helloworld/{name}:
        get:
            tags:
                - Greeter
            description: Sends a greeting
            operationId: Greeter_SayHello
            parameters:
                - name: name
                  in: path
                  required: true
                  schema:
                    type: string
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/.helloworld.v1.HelloReply'
components:
    schemas:
        .helloworld.v1.HelloReply:
            type: object
            properties:
                message:
                    type: string
            description: The response message containing the greetings
tags:
    - name: Greeter

fix #309

@tonybase tonybase requested a review from a team as a code owner March 16, 2022 15:43
@jeffsawatzky
Copy link
Contributor

@timburks this can be closed due to #324

@timburks
Copy link
Contributor

timburks commented Apr 2, 2022

@jeffsawatzky @tonybase thanks! Closing this now based on @jeffsawatzky's comment.

@timburks timburks closed this Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting duplicate models (different packages) in protoc-gen-openapi
3 participants