swagger: '2.0' info: version: "1.0.0" title: Simple Search API description: | A very simple api description that makes a x-www-form-urlencoded only API to submit searches. produces: - application/json consumes: - application/json paths: /search: post: operationId: search summary: searches tasks description: searches the task titles and descriptions for a match consumes: - application/x-www-form-urlencoded parameters: - name: q in: formData type: string description: the search string required: true /tasks: get: operationId: getTasks summary: Gets Task objects. description: | Optional query param of **size** determines size of returned array tags: - tasks parameters: - name: size in: query description: Size of task list type: integer format: int32 default: 20 - name: completed in: query description: when true shows completed tasks type: boolean responses: default: description: Generic Error 200: description: Successful response headers: X-Rate-Limit: type: integer format: int32 X-Rate-Limit-Remaining: type: integer format: int32 default: 42 X-Rate-Limit-Reset: type: integer format: int32 default: "1449875311" X-Rate-Limit-Reset-Human: type: string default: 3 days X-Rate-Limit-Reset-Human-Number: type: string default: 3 Access-Control-Allow-Origin: type: string default: "*" schema: type: array items: $ref: "#/definitions/Task" post: operationId: createTask summary: Creates a 'Task' object. description: | Validates the content property for length etc. parameters: - name: body in: body schema: $ref: "#/definitions/Task" tags: - tasks responses: default: description: Generic Error 201: description: Task Created /tasks/{id}: parameters: - name: id in: path type: integer format: int32 description: The id of the task required: true minimum: 1 put: operationId: updateTask summary: updates a task. description: | Validates the content property for length etc. tags: - tasks parameters: - name: body in: body description: the updated task schema: $ref: "#/definitions/Task" responses: default: description: Generic Error 200: description: Task updated schema: $ref: "#/definitions/Task" delete: operationId: deleteTask summary: deletes a task description: | Deleting a task is irrevocable. tags: - tasks responses: default: description: Generic Error 204: description: Task Deleted definitions: Task: title: A Task object description: | This describes a task. Tasks require a content property to be set. required: - content type: object properties: id: title: the unique id of the task description: | This id property is autogenerated when a task is created. type: integer format: int64 readOnly: true content: title: The content of the task description: | Task content can contain [GFM](https://help.github.com/articles/github-flavored-markdown/). type: string minLength: 5 completed: title: when true this task is completed type: boolean creditcard: title: the credit card format usage type: string format: creditcard createdAt: title: task creation time type: string format: date-time readOnly: true