From 3291eeaa4d0412665d723e5f384ff49fafce9d48 Mon Sep 17 00:00:00 2001 From: rkun123 Date: Wed, 7 Jul 2021 07:40:35 +0000 Subject: [PATCH] [update] openapi --- Pipfile | 2 + Pipfile.lock | 45 ++- server/openapi-schema.yml | 562 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 608 insertions(+), 1 deletion(-) create mode 100644 server/openapi-schema.yml diff --git a/Pipfile b/Pipfile index 7774637..6841063 100644 --- a/Pipfile +++ b/Pipfile @@ -49,6 +49,8 @@ djangorestframework = "*" django-cors-headers = "*" drf-nested-routers = "*" uvicorn = "*" +pyyaml = "*" +uritemplate = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index abc7337..26402f9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "84474f86c1d629c31fb884f632c8448842e687e1c8e167c86ab2a5d09cd632e6" + "sha256": "290d99167eeceb078993db7c205bd797f5a22ea61e325dfec3eaef05aa22776d" }, "pipfile-spec": 6, "requires": { @@ -387,6 +387,41 @@ "index": "pypi", "version": "==2020.1" }, + "pyyaml": { + "hashes": [ + "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf", + "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696", + "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393", + "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77", + "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922", + "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5", + "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8", + "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10", + "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc", + "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018", + "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e", + "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253", + "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347", + "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183", + "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541", + "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb", + "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185", + "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc", + "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db", + "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa", + "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46", + "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122", + "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b", + "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63", + "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df", + "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc", + "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247", + "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6", + "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0" + ], + "index": "pypi", + "version": "==5.4.1" + }, "rcssmin": { "hashes": [ "sha256:ca87b695d3d7864157773a61263e5abb96006e9ff0e021eff90cbe0e1ba18270" @@ -453,6 +488,14 @@ "index": "pypi", "version": "==0.10.1" }, + "uritemplate": { + "hashes": [ + "sha256:07620c3f3f8eed1f12600845892b0e036a2420acf513c53f7de0abd911a5894f", + "sha256:5af8ad10cec94f215e3f48112de2022e1d5a37ed427fbd88652fa908f2ab7cae" + ], + "index": "pypi", + "version": "==3.0.1" + }, "urllib3": { "hashes": [ "sha256:3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527", diff --git a/server/openapi-schema.yml b/server/openapi-schema.yml new file mode 100644 index 0000000..7f4f7e1 --- /dev/null +++ b/server/openapi-schema.yml @@ -0,0 +1,562 @@ +openapi: 3.0.2 +info: + title: '' + version: '' +paths: + /api/v1/genres/: + get: + operationId: listGenres + description: '' + parameters: [] + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Genre' + description: '' + tags: + - api + /api/v1/genres/{id}/: + get: + operationId: retrieveGenre + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this genre. + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Genre' + description: '' + tags: + - api + /api/v1/works/: + get: + operationId: listWorks + description: '' + parameters: [] + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Work' + description: '' + tags: + - api + /api/v1/works/{id}/: + get: + operationId: retrieveWork + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this work. + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Work' + description: '' + tags: + - api + /api/v1/works/{work_pk}/comments/: + get: + operationId: listComments + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Comment' + description: '' + tags: + - api + post: + operationId: createComment + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Comment' + multipart/form-data: + schema: + $ref: '#/components/schemas/Comment' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + description: '' + tags: + - api + /api/v1/works/{work_pk}/comments/{id}/: + get: + operationId: retrieveComment + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + - name: id + in: path + required: true + description: '' + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + description: '' + tags: + - api + put: + operationId: updateComment + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + - name: id + in: path + required: true + description: '' + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Comment' + multipart/form-data: + schema: + $ref: '#/components/schemas/Comment' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + description: '' + tags: + - api + patch: + operationId: partialUpdateComment + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + - name: id + in: path + required: true + description: '' + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Comment' + multipart/form-data: + schema: + $ref: '#/components/schemas/Comment' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + description: '' + tags: + - api + delete: + operationId: destroyComment + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + - name: id + in: path + required: true + description: '' + schema: + type: string + responses: + '204': + description: '' + tags: + - api + /api/v1/works/{work_pk}/goods/: + post: + operationId: createWork + description: '' + parameters: + - name: work_pk + in: path + required: true + description: '' + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Work' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Work' + multipart/form-data: + schema: + $ref: '#/components/schemas/Work' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Work' + description: '' + tags: + - api +components: + schemas: + Genre: + type: object + properties: + id: + type: integer + readOnly: true + works: + type: array + items: + type: object + properties: + id: + type: integer + readOnly: true + title: + type: string + maxLength: 255 + description: + type: string + type_choice: + enum: + - U3D + - U2D + - VID + - M3D + - OTHER + type: string + card_image: + type: string + format: binary + goods: + type: integer + genre: + type: object + properties: + id: + type: integer + readOnly: true + title: + type: string + maxLength: 255 + bg_color: + type: string + pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ + maxLength: 18 + readOnly: true + team: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 255 + required: + - name + readOnly: true + game: + type: object + properties: + id: + type: integer + readOnly: true + unityroom_url: + type: string + maxLength: 255 + required: + - unityroom_url + readOnly: true + model3d: + type: object + properties: + id: + type: integer + readOnly: true + glb: + type: string + format: binary + nullable: true + vrm: + type: string + format: binary + nullable: true + readOnly: true + video: + type: object + properties: + id: + type: integer + readOnly: true + mp4: + type: string + format: binary + required: + - mp4 + readOnly: true + tags: + type: array + items: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + color: + type: string + pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ + maxLength: 18 + required: + - name + readOnly: true + required: + - title + - card_image + readOnly: true + title: + type: string + maxLength: 255 + bg_color: + type: string + pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ + maxLength: 18 + Work: + type: object + properties: + id: + type: integer + readOnly: true + title: + type: string + maxLength: 255 + description: + type: string + genre: + type: object + properties: + id: + type: integer + readOnly: true + title: + type: string + maxLength: 255 + bg_color: + type: string + pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ + maxLength: 18 + readOnly: true + team: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 255 + required: + - name + readOnly: true + type_choice: + enum: + - U3D + - U2D + - VID + - M3D + - OTHER + type: string + goods: + type: integer + comments: + type: array + items: + type: object + properties: + id: + type: integer + readOnly: true + created_at: + type: string + format: date-time + readOnly: true + name: + type: string + maxLength: 255 + text: + type: string + work: + type: integer + required: + - name + - text + - work + readOnly: true + tags: + type: array + items: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + color: + type: string + pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ + maxLength: 18 + required: + - name + readOnly: true + required: + - title + Comment: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 255 + text: + type: string + work: + type: object + properties: + id: + type: integer + readOnly: true + title: + type: string + maxLength: 255 + description: + type: string + type_choice: + enum: + - U3D + - U2D + - VID + - M3D + - OTHER + type: string + card_image: + type: string + format: binary + goods: + type: integer + genre: + type: integer + nullable: true + team: + type: integer + game: + type: integer + nullable: true + model3d: + type: integer + nullable: true + video: + type: integer + nullable: true + tags: + type: array + items: + type: integer + required: + - title + - card_image + - team + - tags + readOnly: true + created_at: + type: string + format: date-time + readOnly: true + required: + - name + - text