github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/fixtures/bugs/1487/fixture-itching.yaml (about) 1 swagger: '2.0' 2 3 info: 4 version: "1.0.0" 5 title: fixture for additionalProperties 6 description: | 7 This one regroups a number of itching cases, essentially around additionalProperties. 8 In particular, we test some things with empty objects (no properties) which have additionalProperties of diverse sorts. 9 We also added here some funny models using the special types Files, string format: binary and interface{} 10 These special cases do not correspond to actual API specs: we use them to verify the internal behavior of the general. 11 12 produces: 13 - application/json 14 consumes: 15 - application/json 16 paths: 17 /models: 18 get: 19 operationId: modelOp 20 summary: many model variations 21 description: Used to see if a codegen can render all the possible enum categories 22 tags: 23 - testcgen 24 responses: 25 default: 26 description: Generic Out 27 definitions: 28 emptyObjectWithAdditionalSlice: 29 type: object 30 additionalProperties: 31 type: array 32 items: 33 type: object 34 properties: 35 dummyProp1: 36 type: string 37 format: date 38 emptyObjectWithAdditionalNestedSlice: 39 type: object 40 additionalProperties: 41 type: array 42 items: 43 type: array 44 items: 45 type: array 46 items: 47 type: object 48 properties: 49 dummyProp1: 50 type: string 51 format: date 52 aliasedThing: 53 type: object 54 properties: 55 prop1: 56 type: string 57 format: date 58 nullableThing: 59 type: string 60 format: date 61 # atm, such check is not supported 62 #pattern: '^2017-..-..$' 63 x-nullable: true 64 emptyObjectWithAdditionalAlias: 65 type: object 66 additionalProperties: 67 $ref: '#/definitions/aliasedThing' 68 emptyObjectWithAdditionalNullable: 69 type: object 70 additionalProperties: 71 $ref: '#/definitions/nullableThing' 72 objectWithEmptyObject: 73 type: object 74 properties: 75 nonEmptyObj: 76 $ref: '#/definitions/nullableThing' 77 emptyObj: 78 $ref: '#/definitions/emptyObjectWithAdditionalAlias' 79 emptyObjectWithAdditionalNullablePrimitive: 80 type: object 81 additionalProperties: 82 type: string 83 format: date 84 x-nullable: true 85 emptyObjectWithAdditionalNonNullablePrimitive: 86 type: object 87 additionalProperties: 88 type: string 89 format: date 90 # atm, such check is not supported 91 #pattern: '^2018-..-..$' 92 notValidatedAdditionalProps: 93 type: object 94 properties: 95 prop2: 96 type: string 97 format: uuid 98 additionalProperties: 99 type: object 100 additionalProperties: 101 type: object 102 additionalProperties: 103 type: string 104 notValidatedAdditionalPropsSlice: 105 type: object 106 properties: 107 prop2: 108 type: string 109 format: uuid 110 additionalProperties: 111 type: array 112 items: 113 additionalProperties: 114 type: object 115 additionalProperties: 116 type: string 117 # At the moment, this one generates a non-empty Validate() 118 # this is because of the len(properties) validation criterion 119 notValidatedAtAll: 120 type: object 121 properties: 122 prop2: 123 type: string 124 additionalProperties: 125 type: array 126 items: 127 additionalProperties: 128 type: object 129 additionalProperties: 130 type: string 131 enumsWithAdditionalProps: 132 type: object 133 enum: 134 - '{ "a": 1, "b": 2 }' 135 - '{ "a": 3, "b": 4 }' 136 additionalProperties: 137 type: object 138 enum: 139 - '{ "b": 2 }' 140 - '{ "b": 4 }' 141 goodOldFormatIssue: 142 type: object 143 required: [ myFile ] 144 properties: 145 myFile: 146 type: string 147 format: binary 148 anotherFile: 149 type: string 150 format: binary 151 alternateFile: 152 type: file 153 thisAliasedFile: 154 $ref: '#/definitions/aliasedFile' 155 thisNullableAliasedFile: 156 $ref: '#/definitions/aliasedNullableFile' 157 thisAlternateAliasedFile: 158 $ref: '#/definitions/aliasedTypeFile' 159 thisNullableAlternateAliasedFile: 160 $ref: '#/definitions/aliasedTypeNullableFile' 161 myBytes: 162 type: string 163 format: byte 164 sliceOfAliasedFiles: 165 type: array 166 minItems: 4 167 items: 168 $ref: '#/definitions/aliasedFile' 169 additionalFile: 170 type: object 171 properties: 172 dirName: 173 type: string 174 additionalProperties: 175 type: string 176 format: binary 177 additionalAliasedFile: 178 aliasedFile: 179 type: string 180 format: binary 181 aliasedTypeFile: 182 type: file 183 aliasedNullableFile: 184 type: string 185 format: binary 186 x-nullable: true 187 aliasedTypeNullableFile: 188 type: file 189 x-nullable: true 190 topLevelFormatIssue: 191 type: object 192 properties: 193 myFile: 194 type: string 195 format: binary 196 myAlternateFile: 197 type: file