github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/fixtures/bugs/1487/fixture-complex-allOf.yaml (about) 1 2 swagger: '2.0' 3 4 info: 5 version: "1.0.0" 6 title: fixture for nested allOf with ref 7 description: | 8 We check that validation bubbles up properly, with various compounds of 9 complex structures, as well as no validation is generated when not necessary. 10 produces: 11 - application/json 12 consumes: 13 - application/json 14 paths: 15 /models: 16 get: 17 operationId: modelOp 18 summary: many model variations 19 description: Used to see if a codegen can render all the possible enum categories 20 responses: 21 default: 22 description: Generic Out 23 24 definitions: 25 # with slices 26 sliceOfAllOf: 27 type: array 28 uniqueItems: true 29 items: 30 # this one should issue a warning 31 allOf: 32 - type: object 33 properties: 34 prop0: 35 type: string 36 format: uuid 37 - $ref: '#/definitions/sliceOfInterfaces' 38 sliceOfInterfaces: 39 type: array 40 items: 41 type: object 42 additionalProperties: true 43 sliceOfInterfacesWithValidation: 44 type: array 45 maxItems: 10 46 items: 47 type: object 48 additionalProperties: true 49 allOfAliases: 50 allOf: 51 - $ref: '#/definitions/aliasedDate' 52 - $ref: '#/definitions/aliasedNullableDate' 53 allOfSlicesOfAliases: 54 type: object 55 allOf: 56 - type: object 57 properties: 58 prop1: 59 type: array 60 maxItems: 10 61 items: 62 $ref: '#/definitions/aliasedDate' 63 - type: object 64 properties: 65 prop2: 66 type: array 67 maxItems: 20 68 items: 69 $ref: '#/definitions/aliasedNullableDate' 70 sliceMix: 71 # This one is actually impossible to unmarshall 72 # However, the generated unmarshalling and validation code is interesting to observe 73 # to better understand how the generator works 74 allOf: 75 - $ref: '#/definitions/sliceOfAllOf' 76 - $ref: '#/definitions/sliceOfInterfaces' 77 objectMix: 78 allOf: 79 - type: object # expect no validation here? 80 - type: object 81 properties: 82 prop1: 83 allOf: 84 - $ref: '#/definitions/aliasedDate' 85 - $ref: '#/definitions/aliasedNullableDate' 86 - type: object 87 properties: 88 prop2: 89 allOf: 90 - $ref: '#/definitions/aliasedDate' 91 - $ref: '#/definitions/aliasedNullableDate' 92 aliasedDate: 93 type: string 94 format: date 95 aliasedNullableDate: 96 type: string 97 format: date 98 x-nullable: true