What does the `=` mean within the Swagger path parameters?

20 views
Skip to first unread message

John Tipper

unread,
Sep 16, 2019, 2:28:26 PM9/16/19
to Grafeas Developers

What does the "=" mean within the path parameter of the following OpenApi / Swagger spec?

https://github.com/grafeas/grafeas/blob/master/proto/v1beta1/swagger/grafeas.swagger.json#L18

Here is an excerpt (converted to YAML from JSON for readability):

swagger: '2.0'



info
:

  title
: grafeas.proto

  version
: version not set

schemes
:

 
- http

 
- https

consumes
:

 
- application/json

produces
:

 
- application/json

paths
:

 
'/v1beta1/{name=projects/*/notes/*}':

   
get:

      summary
: Gets the specified note.

      operationId
: GetNote

      responses
:

       
'200':

          description
: A successful response.

          schema
:

            $ref
: '#/definitions/v1beta1Note'

      parameters
:

       
- name: name

          description
: |-

           
The name of the note in the form of

           
`projects/[PROVIDER_ID]/notes/[NOTE_ID]`.

         
in: path

          required
: true

          type
: string

      tags
:

       
- GrafeasV1Beta1



The path is defined as /v1beta1/{name=projects/*/notes/*} and a parameter called name is defined, but when I put the whole .json into https://editor.swagger.io, I get errors of the form:

Declared path parameter "name=projects/*/notes/*" needs to be defined as a path parameter at either the path or operation level

Aysylu Greenberg

unread,
Sep 20, 2019, 4:32:46 PM9/20/19
to Grafeas Developers
The issue here is the lack of full compatibility between OpenAPI and GoogleAPI. Some of the issues have been fixed, e.g. https://github.com/grpc-ecosystem/grpc-gateway/issues/702, but there are still lots of quirks remaining. 
Reply all
Reply to author
Forward
0 new messages