github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/fixtures/enhancements/184/fixture-184.yaml (about)

     1  swagger: '2.0'
     2  
     3  info:
     4    title: Markdown generator demo
     5    version: 1.0.0
     6    description: |
     7      A spec to demonstrate the markdown generator.
     8  
     9      All swagger fields supported by the doc generator are examplified below.
    10    termsOfService: free to use
    11    license:
    12      name: Apache 2.0
    13      url: http://www.apache.org/licenses/LICENSE-2.0.html
    14    contact:
    15      name: fred
    16      url: https://github.com/go-swagger/go-swagger
    17      email: fred@example.com
    18  
    19  externalDocs:
    20    description: More information
    21    url: https://goswagger.io
    22  
    23  tags:
    24    - name: greeters
    25      description: define several ways to greet someone
    26      externalDocs:
    27        url: https://welcome.example.com/greet
    28    - name: ousters
    29      description: define several ways to (tactfully) get rid of someone
    30      externalDocs:
    31        description: more about ousters
    32        url: https://welcome.example.com/oust
    33  
    34  securityDefinitions:
    35    api_key:
    36      type: apiKey
    37      description: Authentication via API key header
    38      name: x-api-key
    39      in: header
    40  
    41    password:
    42      type: basic
    43      description: Authentication with password
    44  
    45    token:
    46      type: oauth2
    47      description: Authentication with oauth2 token
    48      flow: accessCode
    49      authorizationUrl: https://app/auth/authorize
    50      tokenUrl: https://app/auth/token
    51      scopes:
    52        'read:greeters': Scope to access all greeters
    53        'write:greeters': Scope to create or modify greeters
    54  
    55  security:
    56    - password: []
    57    - api_key: []
    58  
    59  schemes:
    60    - http
    61    - https
    62  x-schemes:
    63    - unix
    64    - wss
    65  
    66  consumes:
    67    - application/json
    68  produces:
    69    - application/json
    70  
    71  paths:
    72    /greetings:
    73      parameters:
    74        - in: query
    75          name: filter
    76          type: string
    77          default: none
    78        - in: query
    79          name: since
    80          type: string
    81          format: date-time
    82        - in: query
    83          name: max
    84          type: integer
    85          default: 100
    86        - in: query
    87          name: offset
    88          type: integer
    89          format: int32
    90          default: 0
    91        - in: query
    92          name: byID
    93          type: string
    94          format: uuid
    95        - in: query
    96          description: specifies multiple outputs
    97          name: multi
    98          type: array
    99          collectionFormat: pipes
   100          items:
   101            type: string
   102            format: byte
   103      get:
   104        tags: [greeters]
   105        summary: |
   106          Retrieve all ways to say hello
   107        description: |
   108          Retrieve greeters according to language or other optional filter
   109        externalDocs:
   110          description: More here
   111          url: https://www.greetings.io/greeters
   112        produces:
   113          - application/json
   114          - text/plain
   115        parameters:
   116          - in: query
   117            description: a filter on the language
   118            name: language
   119            type: string
   120        responses:
   121          200:
   122            description: A hello world collection
   123            headers:
   124              x-rate-limit:
   125                description: The number of allowed requests in the current period
   126                type: integer
   127                default: 50
   128              x-max-items:
   129                description: The maximum number of returned items
   130                type: integer
   131                default: 1024
   132            schema:
   133              type: array
   134              items:
   135                $ref: '#/definitions/greeter'
   136            examples:
   137              application/json:
   138                id: xyz
   139                name: hello
   140                language: en
   141                strength: 3
   142              text/plain: |
   143                '{"id": "xyz", "name": "hello", "language": "en", "strength": 3}'
   144  
   145      post:
   146        tags: [greeters]
   147        summary: Makes a greeter
   148        description: |
   149          Builds a new greeter from a description
   150        parameters:
   151          - in: body
   152            name: greeterContent
   153            description: The description of the new greeter
   154            required: true
   155            schema:
   156              $ref: '#/definitions/greeter'
   157        consumes:
   158          - application/json
   159          - text/plain
   160        responses:
   161          201:
   162            description: Created
   163  
   164      put:
   165        tags: [greeters]
   166        summary: Updates a greeter
   167        schemes:
   168          - https
   169        x-schemes:
   170          - unix
   171        parameters:
   172          - in: body
   173            name: newGreeterContent
   174            schema:
   175              $ref: '#/definitions/greeter'
   176        responses:
   177          200:
   178            description: Modified
   179            schema:
   180              description: |
   181                When modifiying things, a report about the actual
   182                updates performed is returned.
   183              type: array
   184              items:
   185                description: Modification report item
   186                externalDocs:
   187                  description: A modification report
   188                  url: https://www.greetings.io/reports
   189                type: object
   190                required: [id, modified]
   191                properties:
   192                  id:
   193                    type: string
   194                  modified:
   195                    type: boolean
   196          204:
   197            description: Nothing done
   198            schema:
   199              externalDocs:
   200                description: Inline reliased primitive test
   201                url: https://www.greetings.io/realiased
   202              type: array
   203              items:
   204                $ref: '#/definitions/realiased'
   205  
   206    /oustings:
   207      parameters:
   208        - in: query
   209          name: filters
   210          type: array
   211          items:
   212            type: string
   213          collectionFormat: pipes
   214      get:
   215        tags: [ousters]
   216        summary: |
   217          Retrieve all ways to say goodbye
   218        description: |
   219          Retrieve ousters according to language or other optional filter
   220        externalDocs:
   221          description: More here
   222          url: https://www.greetings.io/ousters
   223        consumes:
   224          - application/json
   225          - text/plain
   226        produces:
   227          - application/json
   228          - text/plain
   229        parameters:
   230          - in: query
   231            description: a filter on the harshness of the ousting
   232            name: severity
   233            type: integer
   234            format: int64
   235        responses:
   236          200:
   237            description: Farewell messages
   238            schema:
   239              type: array
   240              items:
   241                $ref: '#/definitions/ouster'
   242  
   243    /all:
   244      get:
   245        summary: Retrieve all things
   246        security:
   247          - token: ['read:greeters']
   248        responses:
   249          200:
   250            description: All in one
   251            schema:
   252              type: array
   253              items:
   254                $ref: '#/definitions/anyObject'
   255    /some:
   256      get:
   257        summary: Retrieve some things
   258        responses:
   259          200:
   260            description: some items
   261            schema:
   262              $ref: '#/definitions/aliasedArray'
   263          203:
   264            description:  nested items
   265            schema:
   266              type: array
   267              items:
   268                $ref: '#/definitions/aliasedArray'
   269  
   270      post:
   271        summary: Make some things
   272        description: |
   273          A more long-winded version on how to make things.
   274  
   275        parameters:
   276          - in: body
   277            description: an inlined primitive body param
   278            name: inlined body
   279            required: true
   280            schema:
   281              type: array
   282              items:
   283                type: string
   284                format: uuid
   285        responses:
   286          201:
   287            description: uuid created
   288            schema:
   289              type: object
   290              additionalProperties: true
   291      put:
   292        summary: Modify some things
   293        parameters:
   294          - in: body
   295            name: inlined complex body
   296            required: true
   297            schema:
   298              externalDocs:
   299                description: an inlined complex body param
   300                url: https://www.greetings.io/models/zzz
   301              type: object
   302              required: [z]
   303              properties:
   304                z:
   305                  type: string
   306                  format: uuid
   307                  example: c6bcc97c-a363-4bd0-9ded-8874e6616206
   308                zz:
   309                  type: integer
   310                  format: int32
   311                  default: 15
   312                  example: 20
   313  
   314        responses:
   315          201:
   316            description: additional properties
   317            schema:
   318              type: object
   319              additionalProperties: true
   320          default:
   321            description: default response
   322            schema:
   323              type: array
   324              items:
   325                externalDocs:
   326                  description: generic error
   327                  url: https://www.greetings.io/models/errors-generic
   328                type: object
   329                required: [ code ]
   330                properties:
   331                  code:
   332                    type: integer
   333                  message:
   334                    type: string
   335                additionalProperties:
   336                  type: string
   337  
   338    /more:
   339      get:
   340        summary: Retrieve more things
   341        responses:
   342          200:
   343            description: more items
   344            schema:
   345              type: array
   346              items:
   347                type: string
   348                format: byte
   349  
   350      put:
   351        parameters:
   352          - in: body
   353            name: inlined map body
   354            required: true
   355            schema:
   356              description: define an inlined map
   357              externalDocs:
   358                description: an inlined map body param
   359                url: https://www.greetings.io/models/map-uuid
   360              type: object
   361              additionalProperties:
   362                type: string
   363                format: uuid
   364        responses:
   365          201:
   366            description: object with additional properties
   367            schema:
   368              type: object
   369              description: define an inlined object with additionalProperties
   370              required: [a]
   371              properties:
   372                a:
   373                  $ref: '#/definitions/greeter'
   374              additionalProperties: true
   375  
   376          204:
   377            description: map of defined model
   378            schema:
   379              type: object
   380              description: define a map of a model type
   381              additionalProperties:
   382                $ref: '#/definitions/greeter'
   383  
   384          401:
   385            description: map with additionalProperties
   386            schema:
   387              type: object
   388              description: define a map of objects with additional properties
   389              additionalProperties:
   390                type: object
   391                description: property of map container
   392                properties:
   393                  b:
   394                    type: integer
   395                additionalProperties: true
   396  
   397          403:
   398            description: map with constrained additionalProperties
   399            schema:
   400              type: object
   401              description: define a map of objects with constrained additional properties
   402              additionalProperties:
   403                type: object
   404                description: property of constrained map container
   405                properties:
   406                  b:
   407                    type: integer
   408                additionalProperties:
   409                  type: array
   410                  items:
   411                    type: object
   412                    properties:
   413                      c:
   414                        type: integer
   415                    additionalProperties: true
   416  
   417      delete:
   418        parameters:
   419          - in: body
   420            name: inlined map body
   421            required: true
   422            schema:
   423              description: define an inlined map
   424              externalDocs:
   425                description: an inlined map body param, from model
   426                url: https://www.greetings.io/models/map-model
   427              type: object
   428              additionalProperties:
   429                $ref: '#/definitions/greeter'
   430        responses:
   431          204:
   432            description: empty
   433            schema:
   434          401:
   435            description: complex object
   436            schema:
   437              $ref: '#/definitions/objectWithComplexProps'
   438  
   439  definitions:
   440    greeter:
   441      externalDocs:
   442        description: more about greeters
   443        url: https://www.greetings.io/models/greeter
   444      type: object
   445      required: [id,name]
   446      properties:
   447        id:
   448          type: string
   449          externalDocs:
   450            url: https://www.greetings.io/models/uniqueIDs
   451          example: xyz
   452        name:
   453          type: string
   454          example: hello
   455        language:
   456          type: string
   457          example: "en"
   458        strength:
   459          type: integer
   460          format: int32
   461          default: 0
   462          example: 3
   463  
   464    ouster:
   465      type: object
   466      required: [uid,uname]
   467      properties:
   468        uid:
   469          type: string
   470          format: uuid
   471        uname:
   472          type: string
   473  
   474    anyObject:
   475      description: a type composition
   476      externalDocs:
   477        description: any kind of greeter or ouster
   478        url: https://www.greetings.io/models/anyObject
   479      allOf:
   480        - $ref: '#/definitions/greeter'
   481        - $ref: '#/definitions/ouster'
   482  
   483    aliasedArray:
   484      type: array
   485      items:
   486        type: string
   487        format: uuid
   488  
   489    anonymousAllOf:
   490      allOf:
   491        - type: object
   492          properties:
   493            a:
   494              description: the first letter of the alphabet
   495              type: string
   496              default: "A"
   497              example: "a"
   498        - type: object
   499          required: [b]
   500          properties:
   501            b:
   502              type: string
   503  
   504    primitiveAllOf:
   505      allOf:
   506        - type: string
   507        - type: string
   508          format: uuid
   509  
   510    primitive:
   511      type: string
   512      enum: [a,b,c]
   513  
   514    intPrimitive:
   515      type: integer
   516      format: int32
   517      enum: [1, 2, 3]
   518  
   519    realiased:
   520      $ref: '#/definitions/primitive'
   521  
   522    objectWithComplexProps:
   523      type: object
   524      required: [prop1, prop2]
   525      properties:
   526        prop1:
   527          $ref: '#/definitions/greeter'
   528        prop2:
   529          $ref: '#/definitions/ouster'
   530        prop3:
   531          $ref: '#/definitions/realiased'
   532        prop4:
   533          type: object
   534          properties:
   535            a:
   536              type: string
   537          additionalProperties:
   538            type: integer
   539        prop5:
   540          type: array
   541          items:
   542            type: object
   543            properties:
   544              b:
   545                type: string
   546                format: uuid
   547            additionalProperties:
   548              type: integer
   549              default: 28
   550              example: 14
   551        prop6:
   552          type: array
   553          items:
   554            - type: integer
   555              description: first member integer
   556              default: 15
   557              example: 29
   558            - type: string
   559              description: second member string
   560              default: xyz
   561          additionalItems:
   562            $ref: '#/definitions/greeter'
   563        prop7:
   564          type: array
   565          items:
   566            - $ref: '#/definitions/greeter'
   567            - $ref: '#/definitions/ouster'
   568          additionalItems:
   569            type: string
   570        prop8:
   571          type: array
   572          items:
   573            - $ref: '#/definitions/greeter'
   574            - $ref: '#/definitions/ouster'
   575            - type: integer
   576          additionalItems:
   577            type: object
   578            additionalProperties: true