swagger: "2.0" info: description: A demo app for LAIN title: A todo list application version: 1.0.0 consumes: - application/vnd.laincloud.todomvc.v1+json produces: - application/vnd.laincloud.todomvc.v1+json schemes: - http paths: /ping: get: operationId: ping description: "Ping this server" tags: - ping responses: 200: description: "This server is healthy" schema: type: string default: description: "Error" schema: $ref: "#/definitions/error" /todos: get: operationId: listTodos description: "Get the todo list" tags: - todo parameters: - name: since in: query type: integer format: int64 description: "Unix timestamp(unit: nanosecond)" default: 0 - name: limit in: query type: integer format: int32 default: 20 - name: offset in: query type: integer format: int32 default: 0 responses: 200: description: "The todo list" schema: type: array items: $ref: "#/definitions/todo" default: description: "Error" schema: $ref: "#/definitions/error" post: operationId: createTodo description: "Create a todo item" tags: - todo parameters: - name: body in: body required: true schema: $ref: "#/definitions/todo" responses: "201": description: "Created" schema: $ref: "#/definitions/todo" default: description: "Error" schema: $ref: "#/definitions/error" /todos/{id}: parameters: - name: id in: path type: string required: true get: operationId: getTodo description: "Get a todo item" tags: - todo responses: "200": description: "OK" schema: $ref: "#/definitions/todo" default: description: "Error" schema: $ref: "#/definitions/error" put: operationId: updateTodo description: "Update a todo item" tags: - todo parameters: - name: body in: body schema: $ref: "#/definitions/todo" responses: "204": description: "OK" schema: $ref: "#/definitions/todo" default: description: "Error" schema: $ref: "#/definitions/error" delete: operationId: deleteTodo description: "Delete a todo item" tags: - todo responses: "204": description: "Deleted" default: description: "Error" schema: $ref: "#/definitions/error" definitions: error: type: object required: - message properties: code: type: integer format: int64 message: type: string todo: type: object required: - title - completed properties: id: type: integer format: int64 readOnly: true title: type: string minLength: 1 completed: type: boolean