github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/xdoc/test.yaml (about)

     1  openapi: 3.0.0
     2  servers:
     3    - url: //petstore.swagger.io/v2
     4      description: Default server
     5    - url: //petstore.swagger.io/sandbox
     6      description: Sandbox server
     7  info:
     8    description: |
     9      This is a sample server Petstore server.
    10  
    11    version: 1.0.0
    12    title: Petstore
    13    termsOfService: 'http://swagger.io/terms/'
    14    contact:
    15      name: API Support
    16      email: apiteam@swagger.io
    17      url: https://github.com/Redocly/redoc
    18    x-logo:
    19      url: 'https://redocly.github.io/redoc/petstore-logo.png'
    20      altText: Petstore logo
    21    license:
    22      name: Apache 2.0
    23      url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
    24  
    25  paths:
    26    /users/{userid}:
    27      get:
    28        responses:
    29          "200":
    30            $ref: "#/components/responses/200_resp"
    31  
    32          "201":
    33            $ref: "#/components/responses/201_resp"
    34  
    35          '501':
    36            content:
    37              application/json:
    38                schema:
    39                  $ref: '#/components/schemas/501_resp'
    40            description: |-
    41              The namespaced PIDs of processes
    42  
    43          '502':
    44            content:
    45              application/json:
    46                examples:
    47                  foo:
    48                    value:
    49                      {
    50                        "versions": [
    51                          {
    52                            "status": "CURRENT",
    53                            "id": "v2.0",
    54                            "links": [
    55                              {
    56                                "href": "http://127.0.0.1:8774/v2/",
    57                                "rel": "self"
    58                              }
    59                            ]
    60                          }
    61                        ]
    62                      }
    63  
    64  components:
    65    responses:
    66      200_resp:
    67        description: The User
    68        content:
    69          application/json:
    70            schema:
    71              $ref: '#/components/schemas/user'
    72  
    73            examples:
    74              json:
    75                $ref: "#/components/examples/BadRequest"
    76              xml:
    77                value: "XML CONTENT"
    78  
    79      201_resp:
    80        description: The Cat
    81        content:
    82          application/json:
    83            schema:
    84              allOf:
    85                - $ref: '#/components/schemas/Cat'
    86              #              - $ref: '#/components/schemas/user'
    87              discriminator:
    88                propertyName: pet_type
    89  
    90    schemas:
    91      user:
    92        type: object
    93        properties:
    94          id:
    95            type: integer
    96            minimum: 1
    97            maximum: 100
    98  
    99          integer:
   100            type: integer
   101            minimum: 200
   102            maximum: 300
   103  
   104          long:
   105            type: long
   106            minimum: 200
   107            maximum: 300
   108  
   109          float:
   110            type: float
   111            minimum: 200
   112            maximum: 300
   113  
   114          double:
   115            type: double
   116            minimum: 200
   117            maximum: 300
   118  
   119          byte:
   120            type: byte
   121            minimum: 97
   122            maximum: 100
   123  
   124          nickname:
   125            type: string
   126          password:
   127            type: string
   128          profile:
   129            type: object
   130            $ref: '#/components/schemas/Cat'
   131  
   132      501_resp:
   133        title: Root Type for PIDMap
   134        description: |-
   135          A "map" of the PIDs of processes in PID namespaces
   136        type: array
   137        items:
   138          $ref: '#/components/schemas/pids'
   139        example:
   140          -
   141            - pid: 11
   142              nsid: 501_resp-1862620
   143            - pid: 22
   144              nsid: 501_resp-1862620
   145          -
   146            - pid: 33
   147              nsid: 501_resp-1862620
   148  
   149      pids:
   150        description: |-
   151          The list of namespaced PIDs of a process
   152        type: array
   153        items:
   154          $ref: '#/components/schemas/pid'
   155        example:
   156          - pid: 12345
   157            nsid: pids-4026531905
   158          - pid: 1
   159            nsid: pids-4026532382
   160  
   161      pid:
   162        title: Root Type for NamespacedPID
   163        description: |-
   164          A process identifier (PID) valid only in the accompanying PID namespace.
   165        required:
   166          - pid
   167          - nsid
   168        type: object
   169        properties:
   170          pid:
   171            description: a process identifier
   172            type: integer
   173          nsid:
   174            format: int64
   175            description: |-
   176              a PID namespace identified
   177            type: integer
   178        example:
   179          pid: 1
   180          nsid: 462826
   181  
   182      Cat:
   183        allOf:
   184          - $ref: "#/components/schemas/animal"
   185          - $ref: "#/components/schemas/Pet"
   186          - $ref: "#/components/schemas/Dog"
   187  
   188      animal:
   189        type: string
   190  
   191      Pet:
   192        type: object
   193        properties:
   194          sameProp:
   195            type: string
   196          owner:
   197            type: string
   198  
   199      Dog:
   200        type: object
   201        properties:
   202          sameProp:
   203            type: string
   204          dogProp1:
   205            type: integer
   206          dogProp2:
   207            format: int64
   208  
   209    examples:
   210      BadRequest:
   211        summary: Wrong format
   212        value:
   213          error:
   214            type: validation-error
   215            title: Your request parameters didn't validate.
   216            status: 400
   217            invalid-params:
   218              - name: age
   219                reason: must be a positive integer
   220              - name: color
   221                reason: must be 'green', 'red' or 'blue'