Hi, 

It's possible I'm doing something unsupported - but at least the Swagger.io 
Editor does not REJECT it as being formally wrong. However, the Swagger.io 
UI seems to get confused in a variety of ways.

In the example below, with the yellow "$ref" commented out, the UI will 
show the two distinct paths as expected.

However, when I make the $ref active (attempting to reuse the 
/sources/{uid} definition as "least common denominator", and extend it with 
*additional 
(non-conflicting)* definitions from /source/{neighbors}_{uid}), the result 
in the UI is rather unpredictable/unexpected:

   - Suddenly the second path disappears.
   - The first path has the parameters from the SECOND path.
   - If you leave out the "operationID", then the second path magically 
   re-appears - but the first path still has the parameters of the second path.

openopenapi: "3.0.0"
info:
  version: 1.0.0
  title: Test
servers:
  - url: http://api.test.com/v1
paths:
  /sources/{uid}:
    get:
      summary: Retrieve one individual Source object.
      operationId: Sources->get
      parameters:
        - $ref: "#/components/parameters/Path_uid"
      responses:
        default:
          description: Default Response
  /sources/{neighbor}_{uid}:
*#   $ref: "#/paths/~1sources~1{uid}"*
    get:
      summary: Retrieve the neighbor of one individual Source object.
      parameters:
        - $ref: "#/components/parameters/Path_neighbor"
      responses:
        '200': # OK
          description: Test Response
components:
  parameters:
    Path_uid:
      name: uid
      in: path
      description: The unique ID of the object to be accessed, or "first" 
or "last".
      required: true
      schema:
        oneOf: 
        - type: integer
        - type: string
          enum: [first, last]
    Path_neighbor:
      name: neighbor
      in: path
      description: The direction, either "before" or "after", relative to 
the unique ID.
      required: true
      schema:
        type: string
        enum: [before,after]




-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to