github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/codegen/todolist.simple.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 headers: 43 X-Rate-Limit: 44 type: integer 45 format: int32 46 X-Rate-Limit-Remaining: 47 type: integer 48 format: int32 49 default: 42 50 X-Rate-Limit-Reset: 51 type: integer 52 format: int32 53 default: "1449875311" 54 X-Rate-Limit-Reset-Human: 55 type: string 56 default: 3 days 57 X-Rate-Limit-Reset-Human-Number: 58 type: string 59 default: 3 60 Access-Control-Allow-Origin: 61 type: string 62 default: "*" 63 schema: 64 type: array 65 items: 66 $ref: "#/definitions/Task" 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 tags: 78 - tasks 79 responses: 80 default: 81 description: Generic Error 82 201: 83 description: Task Created 84 85 /tasks/{id}: 86 parameters: 87 - name: id 88 in: path 89 type: integer 90 format: int32 91 description: The id of the task 92 required: true 93 minimum: 1 94 put: 95 operationId: updateTask 96 summary: updates a task. 97 description: | 98 Validates the content property for length etc. 99 tags: 100 - tasks 101 parameters: 102 - name: body 103 in: body 104 description: the updated task 105 schema: 106 $ref: "#/definitions/Task" 107 responses: 108 default: 109 description: Generic Error 110 200: 111 description: Task updated 112 schema: 113 $ref: "#/definitions/Task" 114 delete: 115 operationId: deleteTask 116 summary: deletes a task 117 description: | 118 Deleting a task is irrevocable. 119 tags: 120 - tasks 121 responses: 122 default: 123 description: Generic Error 124 204: 125 description: Task Deleted 126 127 /other/do-empty: 128 get: 129 operationId: doEmpty 130 summary: return empty list not nil 131 responses: 132 200: 133 description: list of foo 134 schema: 135 type: array 136 items: 137 $ref: "#/definitions/Foo" 138 139 /other/do-empty-required: 140 get: 141 operationId: doEmptyRequired 142 summary: return empty list not nil 143 responses: 144 200: 145 description: list of foo 146 required: true 147 schema: 148 type: array 149 items: 150 $ref: "#/definitions/Foo" 151 152 definitions: 153 Foo: 154 type: string 155 Task: 156 title: A Task object 157 description: | 158 This describes a task. Tasks require a content property to be set. 159 required: 160 - content 161 type: object 162 properties: 163 id: 164 title: the unique id of the task 165 description: | 166 This id property is autogenerated when a task is created. 167 type: integer 168 format: int64 169 readOnly: true 170 content: 171 title: The content of the task 172 description: | 173 Task content can contain [GFM](https://help.github.com/articles/github-flavored-markdown/). 174 type: string 175 minLength: 5 176 completed: 177 title: when true this task is completed 178 type: boolean 179 creditcard: 180 title: the credit card format usage 181 type: string 182 format: creditcard 183 createdAt: 184 title: task creation time 185 type: string 186 format: date-time 187 readOnly: true