github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/codegen/todolist.responses.yml (about) 1 swagger: '2.0' 2 3 info: 4 version: "1.0.0" 5 title: Private to-do list 6 description: | 7 A very simple api description that makes a json only API to submit to do's. 8 9 produces: 10 - application/json 11 12 consumes: 13 - application/json 14 15 paths: 16 /tasks: 17 get: 18 operationId: getTasks 19 summary: Gets `Task` objects. 20 description: | 21 Optional query param of **size** determines 22 size of returned array 23 tags: 24 - tasks 25 parameters: 26 - name: size 27 in: query 28 description: Size of task list 29 type: integer 30 format: int32 31 default: 20 32 - name: completed 33 in: query 34 description: when true shows completed tasks 35 type: boolean 36 37 responses: 38 default: 39 description: Generic Error 40 200: 41 description: Successful response 42 schema: 43 type: array 44 items: 45 type: object 46 properties: 47 id: 48 title: the unique id of the task 49 description: | 50 This id property is autogenerated when a task is created. 51 type: integer 52 format: int64 53 readOnly: true 54 content: 55 title: The content of the task 56 description: | 57 Task content can contain [GFM](https://help.github.com/articles/github-flavored-markdown/). 58 type: string 59 minLength: 5 60 completed: 61 title: when true this task is completed 62 type: boolean 63 creditcard: 64 title: the credit card format usage 65 type: string 66 format: creditcard 67 post: 68 operationId: createTask 69 summary: Creates a 'Task' object. 70 description: | 71 Validates the content property for length etc. 72 parameters: 73 - name: body 74 in: body 75 schema: 76 $ref: "#/definitions/Task" 77 responses: 78 default: 79 description: Generic Error 80 201: 81 description: Task Created 82 83 /tasks/{id}: 84 parameters: 85 - name: id 86 in: path 87 type: integer 88 format: int32 89 description: The id of the task 90 required: true 91 minimum: 1 92 put: 93 operationId: updateTask 94 summary: updates a task. 95 description: | 96 Validates the content property for length etc. 97 tags: 98 - tasks 99 parameters: 100 - name: body 101 in: body 102 description: the updated task 103 schema: 104 $ref: "#/definitions/Task" 105 responses: 106 default: 107 $ref: "#/responses/ErrorResponse" 108 200: 109 description: Task updated 110 headers: 111 X-Last-Task-Id: 112 type: integer 113 format: int64 114 description: the last task id known to the application 115 schema: 116 $ref: "#/definitions/Task" 117 delete: 118 operationId: deleteTask 119 summary: deletes a task 120 description: | 121 Deleting a task is irrevocable. 122 tags: 123 - tasks 124 responses: 125 default: 126 description: Generic Error 127 204: 128 description: Task Deleted 129 130 /singleValueQuery: 131 get: 132 operationId: getAllParameters 133 summary: all possible single value query parameters 134 description: Used to see if a codegen can render all the possible parameter variations for a query param 135 responses: 136 default: 137 138 responses: 139 ErrorResponse: 140 description: Error response 141 headers: 142 X-Error-Code: 143 type: string 144 schema: 145 $ref: "#/definitions/Error" 146 147 definitions: 148 Error: 149 title: Error Structure 150 description: | 151 Contains all the properties any error response from the API will contain. 152 Some properties are optional so might be empty most of the time 153 type: object 154 required: 155 - code 156 - message 157 properties: 158 code: 159 description: the error code, this is not necessarily the http status code 160 type: integer 161 format: int32 162 message: 163 description: a human readable version of the error 164 type: string 165 helpUrl: 166 description: an optional url for getting more help about this error 167 type: string 168 format: uri 169 170 Task: 171 title: A Task object 172 description: | 173 This describes a task. Tasks require a content property to be set. 174 required: 175 - content 176 type: object 177 properties: 178 id: 179 title: the unique id of the task 180 description: | 181 This id property is autogenerated when a task is created. 182 type: integer 183 format: int64 184 readOnly: true 185 content: 186 title: The content of the task 187 description: | 188 Task content can contain [GFM](https://help.github.com/articles/github-flavored-markdown/). 189 type: string 190 minLength: 5 191 completed: 192 title: when true this task is completed 193 type: boolean 194 creditcard: 195 title: the credit card format usage 196 type: string 197 format: creditcard 198 createdAt: 199 title: task creation time 200 type: string 201 format: date-time 202 readOnly: true