Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
y-u-y-a committed Aug 4, 2024
1 parent 29041eb commit c2af558
Show file tree
Hide file tree
Showing 35 changed files with 1,384 additions and 1,058 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ dist
.yarn/install-state.gz
.pnp.*

.DS_Store
.DS_Store
openapi.html
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#a0a0a0",
"activityBar.foreground": "#000000"
},
/**
Biome: https://biomejs.dev/ja/reference/vscode/
*/
Expand Down
12 changes: 0 additions & 12 deletions api/docker-compose.yaml

This file was deleted.

104 changes: 0 additions & 104 deletions api/mock.json

This file was deleted.

102 changes: 0 additions & 102 deletions api/schema.json

This file was deleted.

18 changes: 18 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
openapi-swagger:
container_name: openapi-swagger
image: swaggerapi/swagger-ui
volumes:
- ./openapi.json:/usr/share/nginx/html/openapi.json
environment:
API_URL: openapi.json
ports:
- 9000:8080
openapi-mock:
container_name: openapi-mock
image: stoplight/prism:4
command: mock -h 0.0.0.0 /openapi.json
ports:
- "8000:4010"
volumes:
- ./openapi.json:/openapi.json:ro
110 changes: 110 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"openapi": "3.0.0",
"info": {
"title": "Sample API",
"description": "This is a sample API definition",
"version": "1.0.0"
},
"servers": [{ "url": "https://api.example.com/api/v1" }],
"paths": {
"/companies": {
"get": {
"summary": "企業情報を全件取得する",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Companies"
},
"examples": {
"dummy": {
"value": [
{ "id": 1, "name": "Amazon合同会社", "email": "[email protected]" },
{ "id": 2, "name": "SONY株式会社", "email": "[email protected]" },
{ "id": 3, "name": "Facebook株式会社", "email": "[email protected]" },
{ "id": 4, "name": "dummy04株式会社", "email": "[email protected]" },
{ "id": 5, "name": "dummy05株式会社", "email": "[email protected]" },
{ "id": 6, "name": "dummy06株式会社", "email": "[email protected]" },
{ "id": 7, "name": "dummy07株式会社", "email": "[email protected]" },
{ "id": 8, "name": "dummy08株式会社", "email": "[email protected]" },
{ "id": 9, "name": "dummy09株式会社", "email": "[email protected]" },
{ "id": 10, "name": "dummy10株式会社", "email": "[email protected]" },
{ "id": 11, "name": "dummy11株式会社", "email": "[email protected]" },
{ "id": 12, "name": "dummy12株式会社", "email": "[email protected]" },
{ "id": 13, "name": "dummy13株式会社", "email": "[email protected]" },
{ "id": 14, "name": "dummy14株式会社", "email": "[email protected]" },
{ "id": 15, "name": "dummy15株式会社", "email": "[email protected]" },
{ "id": 16, "name": "dummy16株式会社", "email": "[email protected]" },
{ "id": 17, "name": "dummy17株式会社", "email": "[email protected]" },
{ "id": 18, "name": "dummy18株式会社", "email": "[email protected]" },
{ "id": 19, "name": "dummy19株式会社", "email": "[email protected]" },
{ "id": 20, "name": "dummy20株式会社", "email": "[email protected]" },
{ "id": 21, "name": "dummy21株式会社", "email": "[email protected]" },
{ "id": 22, "name": "dummy22株式会社", "email": "[email protected]" },
{ "id": 23, "name": "dummy23株式会社", "email": "[email protected]" }
]
}
}
}
}
},
"404": {
"$ref": "#/components/responses/NotFoundError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
}
},
"components": {
"schemas": {
"Company": {
"type": "object",
"required": ["id", "name", "email"],
"properties": {
"id": { "type": "string", "title": "ID" },
"name": { "type": "string", "title": "企業名" },
"email": { "type": "string", "title": "メールアドレス" }
}
},
"Companies": {
"type": "array",
"items": { "$ref": "#/components/schemas/Company" }
}
},
"responses": {
"NotFoundError": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["error"],
"properties": {
"error": { "type": "string", "nullable": false }
}
}
}
}
},
"InternalServerError": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["error"],
"properties": {
"error": { "type": "string", "nullable": false }
}
}
}
}
}
}
}
}
Loading

0 comments on commit c2af558

Please sign in to comment.