github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/bugs/1487/fixture-allOf.yaml (about) 1 swagger: '2.0' 2 3 info: 4 version: "1.0.0" 5 title: fixture for enums with additional 6 description: | 7 A test of enum validation generation for tuples and additionalItems. 8 Derived from fixtures/codegen/todolist.enum.yml 9 produces: 10 - application/json 11 consumes: 12 - application/json 13 paths: 14 /models: 15 get: 16 operationId: modelOp 17 summary: many model variations 18 description: Used to see if a codegen can render all the possible enum categories 19 tags: 20 - testcgen 21 parameters: 22 - name: manyThings 23 in: body 24 schema: 25 $ref: '#/definitions/allThingsNested' 26 responses: 27 default: 28 description: Generic Out 29 schema: 30 $ref: '#/definitions/allThings' 31 32 definitions: 33 aliasedDate: 34 type: string 35 format: date 36 aliasedNullableDate: 37 type: string 38 format: date 39 x-nullable: true 40 allThings: 41 type: object 42 # TODO: add slices and tuples 43 # TODO: nested allOf 44 # x-go-names wreck additionalProperties 45 allOf: 46 - 47 #x-go-name: additionalThing 48 type: object 49 required: [ origin ] 50 properties: 51 origin: 52 type: string 53 enum: [ print, e-book, collection, museum ] 54 status: 55 type: string 56 enum: [ OK, KO ] 57 additionalProperties: 58 type: string 59 enum: [ bookshop, amazon, library ] 60 - 61 # x-go-name: additionalObject 62 type: object 63 properties: 64 mockId: 65 type: number 66 additionalProperties: 67 type: object 68 required: [ mockB ] 69 properties: 70 mockA: 71 type: string 72 pattern: '^[A-Z]$' 73 mockB: 74 type: string 75 minLength: 1 76 mockC: 77 type: number 78 - 79 # x-go-name: additionalThingsNested 80 type: object 81 properties: 82 origin2: 83 type: string 84 enum: [ goPrint, goE-book, goCollection, goMuseum ] 85 additionalProperties: 86 type: object 87 properties: 88 printerAddress: 89 type: string 90 printerDate: 91 type: string 92 format: date 93 printerCountry: 94 type: string 95 enum: [ "US", "FR", "UK", "BE", "CA", "DE"] 96 additionalProperties: 97 type: object 98 properties: 99 averageDelay: 100 type: string 101 format: duration 102 - 103 # x-go-name: noValidationThing 104 # ERROR IN ALLOF 105 type: object 106 additionalProperties: true 107 properties: 108 discourse: 109 type: string 110 hoursSpent: 111 type: number 112 #- 113 # TODO: breaks generation 114 # x-go-name: interfaceThing 115 # ERROR IN ALLOF 116 #type: object 117 #additionalProperties: true 118 #- 119 # x-go-name: additionalFormatedThing 120 # TODO: breaks generation 121 #type: object 122 #additionalProperties: 123 # type: string 124 # format: date 125 - 126 #x-go-name: additionalObjectWithAliasedThing 127 type: object 128 properties: 129 blob: 130 type: integer 131 minimum: 1 132 additionalProperties: 133 $ref: '#/definitions/aliasedDate' 134 - 135 # x-go-name: additionalObjectWithNullableThing 136 type: object 137 properties: 138 blob2: 139 type: integer 140 minimum: 1 141 additionalProperties: 142 $ref: '#/definitions/aliasedNullableDate' 143 - 144 #x-go-name: additionalDateWithNullableObject 145 type: object 146 properties: 147 nullableDate: 148 $ref: '#/definitions/aliasedNullableDate' 149 - 150 #x-go-name: additionalDateWithNullableThing 151 type: object 152 properties: 153 blob3: 154 type: integer 155 minimum: 1 156 additionalProperties: 157 $ref: '#/definitions/aliasedNullableDate' 158 - 159 #x-go-name: additionalObjectWithFormatedThing 160 type: object 161 required: [ blob4 ] 162 properties: 163 blob4: 164 type: integer 165 minimum: 1 166 additionalProperties: 167 type: string 168 format: date 169 - 170 #x-go-name: additionalArrayThing 171 type: object 172 properties: 173 thisOneNotRequired: 174 type: integer 175 maximum: 10 176 additionalProperties: 177 type: array 178 uniqueItems: true 179 items: 180 type: string 181 format: uuid 182 183 allThingsNested: 184 type: object 185 # TODO: add slices and tuples 186 # TODO: nested allOf 187 # x-go-names wreck additionalProperties 188 allOf: 189 - 190 $ref: '#/definitions/allThings' 191 - 192 #x-go-name: additionalThing 193 type: object 194 required: [ origin ] 195 properties: 196 origin: 197 type: string 198 enum: [ print, e-book, collection, museum ] 199 status: 200 type: string 201 enum: [ OK, KO ] 202 additionalProperties: 203 type: string 204 enum: [ bookshop, amazon, library ] 205 - 206 # x-go-name: additionalObject 207 type: object 208 properties: 209 mockId: 210 type: number 211 additionalProperties: 212 type: object 213 required: [ mockB ] 214 properties: 215 mockA: 216 type: string 217 pattern: '^[A-Z]$' 218 mockB: 219 type: string 220 minLength: 1 221 mockC: 222 type: number 223 - 224 # x-go-name: additionalThingsNested 225 type: object 226 properties: 227 origin2: 228 type: string 229 enum: [ goPrint, goE-book, goCollection, goMuseum ] 230 additionalProperties: 231 type: object 232 properties: 233 printerAddress: 234 type: string 235 printerDate: 236 type: string 237 format: date 238 printerCountry: 239 type: string 240 enum: [ "US", "FR", "UK", "BE", "CA", "DE"] 241 additionalProperties: 242 type: object 243 properties: 244 averageDelay: 245 type: string 246 format: duration 247 - 248 # x-go-name: noValidationThing 249 # ERROR IN ALLOF 250 type: object 251 additionalProperties: true 252 properties: 253 discourse: 254 type: string 255 hoursSpent: 256 type: number 257 - 258 #x-go-name: additionalObjectWithAliasedThing 259 type: object 260 properties: 261 blob: 262 type: integer 263 minimum: 1 264 additionalProperties: 265 $ref: '#/definitions/aliasedDate' 266 - 267 # x-go-name: additionalObjectWithNullableThing 268 type: object 269 properties: 270 blob2: 271 type: integer 272 minimum: 1 273 additionalProperties: 274 $ref: '#/definitions/aliasedNullableDate' 275 - 276 #x-go-name: additionalDateWithNullableObject 277 type: object 278 properties: 279 nullableDate: 280 $ref: '#/definitions/aliasedNullableDate' 281 - 282 #x-go-name: additionalDateWithNullableThing 283 type: object 284 properties: 285 blob3: 286 type: integer 287 minimum: 1 288 additionalProperties: 289 $ref: '#/definitions/aliasedNullableDate' 290 - 291 #x-go-name: additionalObjectWithFormatedThing 292 type: object 293 required: [ blob4 ] 294 properties: 295 blob4: 296 type: integer 297 minimum: 1 298 additionalProperties: 299 type: string 300 format: date 301 - 302 #x-go-name: additionalArrayThing 303 type: object 304 properties: 305 thisOneNotRequired: 306 type: integer 307 maximum: 10 308 additionalProperties: 309 type: array 310 uniqueItems: true 311 items: 312 type: string 313 format: uuid