1
0
api/ent/openapi.json
2023-04-06 12:33:19 +09:00

1582 lines
37 KiB
JSON

{
"openapi": "3.0.3",
"info": {
"title": "Ent Schema API",
"description": "This is an auto generated API description made out of an Ent schema definition",
"version": "0.1.0"
},
"paths": {
"/cards": {
"get": {
"tags": [
"Card"
],
"summary": "List Cards",
"description": "List Cards.",
"operationId": "listCard",
"parameters": [
{
"name": "page",
"in": "query",
"description": "what page to render",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "itemsPerPage",
"in": "query",
"description": "item count to render per page",
"schema": {
"type": "integer",
"maximum": 255,
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "result Card list",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CardList"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"post": {
"tags": [
"Card"
],
"summary": "Create a new Card",
"description": "Creates a new Card and persists it to storage.",
"operationId": "createCard",
"requestBody": {
"description": "Card to create",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"owner": {
"type": "integer"
}
},
"required": [
"owner"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Card created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CardCreate"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/cards/{id}": {
"get": {
"tags": [
"Card"
],
"summary": "Find a Card by ID",
"description": "Finds the Card with the requested ID and returns it.",
"operationId": "readCard",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Card",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Card with requested ID was found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CardRead"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"delete": {
"tags": [
"Card"
],
"summary": "Deletes a Card by ID",
"description": "Deletes the Card with the requested ID.",
"operationId": "deleteCard",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Card",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "Card with requested ID was deleted"
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"patch": {
"tags": [
"Card"
],
"summary": "Updates a Card",
"description": "Updates a Card and persists changes to storage.",
"operationId": "updateCard",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Card",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "Card properties to update",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"owner": {
"type": "integer"
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Card updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CardUpdate"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/cards/{id}/d": {
"description": "Start an draw as done",
"put": {
"tags": [
"Card"
],
"summary": "Draws a card item as done.",
"operationId": "drawDone",
"responses": {
"204": {
"description": "Item marked as done"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
]
},
"/cards/{id}/owner": {
"get": {
"tags": [
"Card"
],
"summary": "Find the attached User",
"description": "Find the attached User of the Card with the given ID",
"operationId": "readCardOwner",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Card",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "User attached to Card with requested ID was found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Card_OwnerRead"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/groups": {
"get": {
"tags": [
"Group"
],
"summary": "List Groups",
"description": "List Groups.",
"operationId": "listGroup",
"parameters": [
{
"name": "page",
"in": "query",
"description": "what page to render",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "itemsPerPage",
"in": "query",
"description": "item count to render per page",
"schema": {
"type": "integer",
"maximum": 255,
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "result Group list",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupList"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"post": {
"tags": [
"Group"
],
"summary": "Create a new Group",
"description": "Creates a new Group and persists it to storage.",
"operationId": "createGroup",
"requestBody": {
"description": "Group to create",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"users": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"required": [
"name"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Group created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GroupCreate"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/groups/{id}": {
"get": {
"tags": [
"Group"
],
"summary": "Find a Group by ID",
"description": "Finds the Group with the requested ID and returns it.",
"operationId": "readGroup",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Group",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Group with requested ID was found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GroupRead"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"delete": {
"tags": [
"Group"
],
"summary": "Deletes a Group by ID",
"description": "Deletes the Group with the requested ID.",
"operationId": "deleteGroup",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Group",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "Group with requested ID was deleted"
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"patch": {
"tags": [
"Group"
],
"summary": "Updates a Group",
"description": "Updates a Group and persists changes to storage.",
"operationId": "updateGroup",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Group",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "Group properties to update",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"users": {
"type": "array",
"items": {
"type": "integer"
}
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Group updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GroupUpdate"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/groups/{id}/users": {
"get": {
"tags": [
"Group"
],
"summary": "List attached Users",
"description": "List attached Users.",
"operationId": "listGroupUsers",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the Group",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "page",
"in": "query",
"description": "what page to render",
"schema": {
"type": "integer"
}
},
{
"name": "itemsPerPage",
"in": "query",
"description": "item count to render per page",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "result Groups list",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Group_UsersList"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/users": {
"get": {
"tags": [
"User"
],
"summary": "List Users",
"description": "List Users.",
"operationId": "listUser",
"parameters": [
{
"name": "page",
"in": "query",
"description": "what page to render",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "itemsPerPage",
"in": "query",
"description": "item count to render per page",
"schema": {
"type": "integer",
"maximum": 255,
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "result User list",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserList"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"post": {
"tags": [
"User"
],
"summary": "Create a new User",
"description": "Creates a new User and persists it to storage.",
"operationId": "createUser",
"requestBody": {
"description": "User to create",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
},
"card": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"required": [
"username"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "User created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserCreate"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/users/{id}": {
"get": {
"tags": [
"User"
],
"summary": "Find a User by ID",
"description": "Finds the User with the requested ID and returns it.",
"operationId": "readUser",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the User",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "User with requested ID was found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserRead"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"delete": {
"tags": [
"User"
],
"summary": "Deletes a User by ID",
"description": "Deletes the User with the requested ID.",
"operationId": "deleteUser",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the User",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "User with requested ID was deleted"
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
},
"patch": {
"tags": [
"User"
],
"summary": "Updates a User",
"description": "Updates a User and persists changes to storage.",
"operationId": "updateUser",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the User",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "User properties to update",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
},
"card": {
"type": "array",
"items": {
"type": "integer"
}
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "User updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserUpdate"
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/users/{id}/card": {
"get": {
"tags": [
"User"
],
"summary": "List attached Cards",
"description": "List attached Cards.",
"operationId": "listUserCard",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of the User",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "page",
"in": "query",
"description": "what page to render",
"schema": {
"type": "integer"
}
},
{
"name": "itemsPerPage",
"in": "query",
"description": "item count to render per page",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "result Users list",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User_CardList"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"409": {
"$ref": "#/components/responses/409"
},
"500": {
"$ref": "#/components/responses/500"
}
}
}
},
"/users/{id}/card/start": {
"description": "Start an draw as done",
"patch": {
"tags": [
"Card"
],
"summary": "Draws a card item as done.",
"operationId": "drawStart",
"responses": {
"204": {
"description": "Item marked as done"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
]
}
},
"components": {
"schemas": {
"Card": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"owner": {
"$ref": "#/components/schemas/User"
}
},
"required": [
"id",
"owner"
]
},
"CardCreate": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id"
]
},
"CardList": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id"
]
},
"CardRead": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id"
]
},
"CardUpdate": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id"
]
},
"Card_OwnerRead": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"Group": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"users": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
}
},
"required": [
"id",
"name"
]
},
"GroupCreate": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
},
"GroupList": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
},
"GroupRead": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
},
"GroupUpdate": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
},
"Group_UsersList": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
},
"card": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Card"
}
}
},
"required": [
"id",
"username"
]
},
"UserCreate": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"UserList": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"UserRead": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"UserUpdate": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"next": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"User_CardList": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"card": {
"type": "integer"
},
"status": {
"type": "string"
},
"cp": {
"type": "integer"
},
"url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id"
]
}
},
"responses": {
"400": {
"description": "invalid input, data invalid",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"status": {
"type": "string"
},
"errors": {}
},
"required": [
"code",
"status"
]
}
}
}
},
"403": {
"description": "insufficient permissions",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"status": {
"type": "string"
},
"errors": {}
},
"required": [
"code",
"status"
]
}
}
}
},
"404": {
"description": "resource not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"status": {
"type": "string"
},
"errors": {}
},
"required": [
"code",
"status"
]
}
}
}
},
"409": {
"description": "conflicting resources",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"status": {
"type": "string"
},
"errors": {}
},
"required": [
"code",
"status"
]
}
}
}
},
"500": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"status": {
"type": "string"
},
"errors": {}
},
"required": [
"code",
"status"
]
}
}
}
}
}
}
}