...

Text file src/github.com/go-openapi/validate/fixtures/validation/fixture-581-inline-param.yaml

Documentation: github.com/go-openapi/validate/fixtures/validation

     1---
     2swagger: '2.0'
     3info:
     4  title: 'fixture for issue #581'
     5  version: '1.0'
     6  description: |
     7    Exercise boundary checks for minimum, maximum and multipleOf
     8    For integer parameters (as default int64):
     9      - inline
    10      - schema objects, with nested array
    11      - via $refs
    12
    13produces:
    14  - application/json
    15paths:
    16  /fixture:
    17    get:
    18      operationId: op1
    19      parameters:
    20        - name: myid
    21          in: query
    22          schema:
    23            $ref: '#/definitions/myId'
    24        - name: inlineMaxInt 
    25          in: query
    26          type: integer
    27          minimum: 0
    28          #maximum: 100
    29          # Error: Out of bound maximum
    30          maximum: 922337203685477580700000000000000000
    31          default: 99 
    32        - name: inlineMinInt 
    33          in: query
    34          type: integer
    35          minimum: -9223372036854775807000000000000000
    36          # Error: Out of bound minimum
    37          maximum: 1
    38          default: 99 
    39        - name: inlineInfiniteInt 
    40          in: query
    41          type: integer
    42          # Errors: Out of bound minimum and maximum
    43          minimum: -92233720368547758070000000000000000000000
    44          maximum: 92233720368547758070000000000000000
    45          default: 99 
    46        - name: bigInt
    47          in: query
    48          type: integer
    49          # TODO: not validated since no default value!!!
    50          # Error: Out of bound factor
    51          multipleOf: 3922337203685477580700000000000000000000000
    52          # ISSUE: does use native method => use number
    53        - name: negFactor
    54          in: query
    55          type: integer
    56          # Error: negative factor
    57          multipleOf: -300
    58          default: -600
    59      responses:
    60        200:
    61      responses:
    62        200:
    63          description: 'response exercising integer boundaries'
    64          schema:
    65            # TODO: should validate here too
    66            $ref: '#/definitions/someIds'
    67
    68# TODO: should validate here too
    69definitions:
    70  myId:
    71    type: object
    72    properties:
    73      uint8:
    74        type: integer
    75        minimum: 0
    76        maximum: 255
    77        # Error: default does not validate against boundaries
    78        default: 256
    79      int64:
    80        type: integer
    81        minimum: -9223372036854775808
    82        maximum: 9223372036854775807000
    83      uint64:
    84        type: integer
    85        minimum: -9223372036854775807000
    86        maximum: 0
    87        # See if detected?
    88        default: 1
    89      uint64-wrong:
    90        type: integer
    91        minimum: 0
    92        maximum: 18446744073709551616
    93  someIds:
    94    type: object
    95    properties:
    96      smallId:
    97        type: integer
    98        minimum: 0
    99        maximum: 12

View as plain text