github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/bugs/1943/fixture-1943.yaml (about) 1 --- 2 swagger: "2.0" 3 info: 4 description: "Deterministic or pseudo-random data generator" 5 version: "1.0.0" 6 title: "Pseudo Service" 7 contact: 8 name: "https://github.com/bgadrian" 9 license: 10 name: "AGPL 2.0" 11 host: "localhost" 12 basePath: "/" 13 schemes: 14 - "http" 15 #- "https" 16 consumes: 17 - "application/json" 18 produces: 19 - "application/json" 20 parameters: 21 count: 22 name: "count" 23 in: "path" 24 description: "How many results to generate." 25 required: true 26 type: integer 27 format: "int32" 28 maximum: 500 29 minimum: 1 30 seed: 31 name: "seed" 32 format: "int64" 33 in: "query" 34 description: "The seed for the pseudo-random generator. For each unique value the same results will be given. If no seed is provided a pseudo-random one will be generated (rand.Int63)." 35 required: false 36 type: "integer" 37 paths: 38 /health: 39 get: 40 description: "Get the health of the service" 41 responses: 42 200: 43 description: "Everything is fine" 44 default: 45 description: "Service is not available" 46 /custom/{count}: 47 get: 48 description: "Generate results based on a pattern/template." 49 parameters: 50 - $ref: "#/parameters/count" 51 - $ref: "#/parameters/seed" 52 - in: query 53 name: "template" 54 type: "string" 55 description: "The template used to generate the results, eg: 'My name is ~name~'" 56 required: true 57 minLength: 1 58 maxLength: 1024 59 responses: 60 200: 61 description: "The results were successfully generated" 62 schema: 63 $ref: "#/definitions/CustomResponseModel" 64 default: 65 description: "Error occurred" 66 schema: 67 $ref: "#/definitions/ErrorModel" 68 security: 69 - apikey: [] 70 /users/{count}: 71 get: 72 description: "Get a random user" 73 parameters: 74 - $ref: "#/parameters/count" 75 - $ref: "#/parameters/seed" 76 responses: 77 200: 78 description: "The users were successfully generated" 79 schema: 80 $ref: "#/definitions/UserResponseModel" 81 default: 82 description: "Error occurred" 83 schema: 84 $ref: "#/definitions/ErrorModel" 85 securityDefinitions: 86 apikey: 87 type: "apiKey" 88 name: "token" 89 in: "query" 90 security: #apply the apikey to all endpoints 91 - apikey: [] 92 definitions: 93 User: 94 type: "object" 95 required: 96 - "id" 97 - "name" 98 properties: 99 id: 100 type: "string" 101 format: "uuid" 102 example: "356b1896-ee58-4fd8-931d-4cfaee21158e" 103 description: "UUID for this user" 104 age: 105 type: "number" 106 format: "int32" 107 minimum: 0 108 maximum: 255 109 name: 110 type: "string" 111 example: "John Doe" 112 description: "First and Last name" 113 Company: 114 type: "string" 115 example: "De-engineered niches Group" 116 position: 117 type: "string" 118 example: "Central Branding Producer" 119 email: 120 type: "string" 121 example: "john@mambo.dot" 122 country: 123 type: "string" 124 example: "Romania" 125 friends: 126 type: "array" 127 example: 128 - "356b1896-ee58-4fd8-931d-4cfaee21158e" 129 - "3d813194-e9ed-4b09-a1ae-301b83bfdd9d" 130 description: "Random list of UUIDs from the same response. To increase the chance of having friends request for bigger batches." 131 items: 132 type: "string" 133 example: "356b1896-ee58-4fd8-931d-4cfaee21158e" 134 description: "UUID for this friend" 135 example: 136 id: "356b1896-ee58-4fd8-931d-4cfaee21158e" 137 age: 33 138 name: "John Doe" 139 company: "De-engineered niches Group" 140 position: "Central Branding Producer" 141 email: "john@mambo.dot" 142 country: "Romania" 143 friends: 144 - "3d813194-e9ed-4b09-a1ae-301b83bfdd9d" 145 - "356b1896-ee58-4fd8-931d-4cfaee21158e" 146 UserResponseModel: 147 type: "object" 148 properties: 149 seed: 150 type: "integer" 151 format: "int64" 152 description: "Number that was used to generate these users" 153 nextseed: 154 type: "integer" 155 format: "int64" 156 description: "Use this to get the next users from the deterministic series" 157 users: 158 type: "array" 159 items: 160 $ref: "#/definitions/User" 161 example: 162 nextseed: 6 163 seed: 0 164 users: 165 - id: "356b1896-ee58-4fd8-931d-4cfaee21158e" 166 age: 33 167 name: "John Doe" 168 company: "De-engineered niches Group" 169 position: "Central Branding Producer" 170 email: "john@mambo.dot" 171 country: "Romania" 172 friends: 173 - "3d813194-e9ed-4b09-a1ae-301b83bfdd9d" 174 - "356b1896-ee58-4fd8-931d-4cfaee21158e" 175 ErrorModel: 176 type: "object" 177 required: 178 - "code" 179 - "message" 180 properties: 181 code: 182 type: "integer" 183 format: "int32" 184 message: 185 type: "string" 186 example: 187 code: 42 188 message: "Something went wrong" 189 CustomResponseModel: 190 type: "object" 191 properties: 192 seed: 193 type: "integer" 194 format: "int64" 195 description: "Number that was used to generate these results" 196 results: 197 type: array 198 items: 199 type: string 200 description: "One result is one template with random data"