Example 4 - Multiple inputs example

This example shows how multiple input files can be merged together to form a single output file, without requiring the use of $xref references

Input

input.yaml

paths:
  /thing:
    get:
      operationId: getThings
      description: get all the things
      parameters:
      responses:
        200:
        schema:
          type: object
          title: getThingsOKResponse
          properties:
            status:
              description: OK
              type: string
            thing:
              type: array
              items:
                $ref: 'objects.yaml#/definitions/ThingObject'

input-2.yaml

paths:
  /thing:
    post:
      operationId: addThing
      description: |
        Adds a new `Thing`.
        * Things must be uniquely identifiable by `name`.
        * The `id` of the thing must be empty; the newly created `id` will be returned in the response object.
      parameters:
        thing:
          $ref: 'objects.yaml#/definitions/ThingObject'
      responses:
        200:
        schema:
          type: object
          title: getThingsOKResponse
          properties:
            status:
              description: OK
              type: string
            thing:
              type: array
              items:
                $ref: 'objects.yaml#/definitions/ThingObject'

Output

---
paths:
  /thing:
    post:
      operationId: addThing
      description: |
        Adds a new `Thing`.
        * Things must be uniquely identifiable by `name`.
        * The `id` of the thing must be empty; the newly created `id` will be returned in the response object.
      responses:
        200: null
        schema:
          type: object
          title: getThingsOKResponse
          properties:
            thing:
              type: array
              items:
                $ref: objects.yaml#/definitions/ThingObject
            status:
              type: string
              description: OK
      parameters:
        thing:
          $ref: objects.yaml#/definitions/ThingObject
    get:
      operationId: getThings
      description: get all the things
      responses:
        200: null
        schema:
          type: object
          title: getThingsOKResponse
          properties:
            thing:
              type: array
              items:
                $ref: objects.yaml#/definitions/ThingObject
            status:
              type: string
              description: OK
      parameters: null

Back to top

Reflow Maven skin by Andrius Velykis.