...
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 with formats int32, uint32 or uint64
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 format: uint64
28 # Error: boundary inconsistent with format
29 minimum: -100
30 # Error: Out of bound maximum
31 maximum: 922337203685477580700000000000000000
32 default: 99
33 - name: inlineMinInt
34 in: query
35 type: integer
36 format: uint32
37 # Error: Out of bound minimum
38 minimum: -1
39 # Error: Out of bound maximum
40 maximum: 4294967296
41 default: 99
42 - name: inlineInfiniteInt
43 in: query
44 type: integer
45 format: uint32
46 minimum: 0
47 maximum: 2000000
48 # Errors: invalid default
49 #default: -10000000000000000000000000000000000000000000000000
50 default: -922
51 # TODO: not validated since no default value!!!
52 - name: inlineInfiniteInt2
53 in: query
54 type: integer
55 format: uint32
56 minimum: 0
57 maximum: 2000000
58 # Errors: invalid default
59 default: -4294967296
60 # TODO: not validated since no default value!!!
61 - name: bigInt
62 in: query
63 type: integer
64 format: int32
65 # Error: Out of bound factor
66 multipleOf: 4294967296
67 - name: negFactor
68 in: query
69 type: integer
70 # Allows signed format
71 format: int32
72 # Error: negative factor (consistent with format)
73 multipleOf: -300
74 default: -600
75 - name: negFactor2
76 in: query
77 type: integer
78 # Allows signed format
79 format: uint32
80 # Error: consistent with format
81 multipleOf: 3
82 # Error: fails constraint, but consistent with format
83 default: 2
84 - name: negFactor3
85 in: query
86 type: integer
87 # Allows signed format
88 format: uint32
89 # Error: consistent with format
90 multipleOf: 3
91 # Error: successful constraint, but inconsistent with format
92 default: -6
93 responses:
94 200:
95 responses:
96 200:
97 description: 'response exercising integer boundaries'
98 schema:
99 $ref: '#/definitions/someIds'
100
101definitions:
102 myId:
103 type: object
104 properties:
105 uint8:
106 type: integer
107 minimum: 0
108 maximum: 255
109 # Error: default does not validate against boundaries
110 default: 256
111 int64:
112 type: integer
113 minimum: -9223372036854775808
114 maximum: 9223372036854775807000
115 uint64:
116 type: integer
117 minimum: -9223372036854775807000
118 maximum: 0
119 # See if detected?
120 default: 1
121 uint64-wrong:
122 type: integer
123 minimum: 0
124 maximum: 18446744073709551616
125 someIds:
126 type: object
127 properties:
128 smallId:
129 type: integer
130 minimum: 0
131 maximum: 12
View as plain text