UNPKG

@frostup/swr-request-generator

Version:

A tool for generating TypeScript code and interface from swagger by using SWR and axios as client.

889 lines (888 loc) 21.7 kB
{ "openapi": "3.0.0", "info": { "description": "Api Documentation", "version": "1.0.0-oas3", "title": "Api Documentation", "termsOfService": "urn:tos", "contact": {}, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, "tags": [ { "name": "attachment-controller", "description": "Test Controller" }, { "name": "attachment-controller-2", "description": "Test Controller 2" } ], "paths": { "/": { "post": { "tags": ["mock-controller"], "summary": "uploadAttachment", "operationId": "uploadAttachmentUsingPOST", "parameters": [ { "name": "Authorities", "in": "header", "required": true, "schema": { "type": "string", "default": "a_officer" } }, { "name": "User-Id", "in": "header", "required": true, "schema": { "type": "string", "default": "abc123456789" } }, { "name": "User-Name", "in": "header", "required": true, "schema": { "type": "string", "default": "John Hopkins" } } ], "responses": { "201": { "description": "Created", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/AttachmentBO" } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "deprecated": false, "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "attachment": { "description": "attachment", "type": "string", "format": "binary" } }, "required": ["attachment"] } } } } } }, "/{id}": { "get": { "tags": ["attachment-controller"], "summary": "download", "operationId": "downloadUsingGET", "parameters": [ { "name": "Accept", "in": "header", "required": true, "schema": { "enum": [ "*/*", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "message/rfc822", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/pdf", "text/plain", "application/xml", "video/x-msvideo", "application/vnd.ms-outlook", "image/jpeg", "image/png", "image/gif", "image/bmp", "application/zip" ], "type": "string" } }, { "name": "id", "in": "path", "description": "id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/Resource" } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "deprecated": false }, "delete": { "tags": ["attachment-controller"], "summary": "delete attachment by id", "operationId": "deleteAttachmentUsingDELETE", "parameters": [ { "name": "Authorities", "in": "header", "required": true, "schema": { "type": "string", "default": "a_officer" } }, { "name": "User-Id", "in": "header", "required": true, "schema": { "type": "string", "default": "abc123456789" } }, { "name": "User-Name", "in": "header", "required": true, "schema": { "type": "string", "default": "John Hopkins" } }, { "name": "id", "in": "path", "description": "id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "204": { "description": "No Content" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Can not find attachment with specific id: {id}" } }, "deprecated": false } }, "/book-journey/{journeyId}/{journeyType}": { "post": { "operationId": "UpdateBookJourneyUsingPOST", "parameters": [ { "name": "journeyId", "required": true, "in": "path", "schema": { "type": "string" } }, { "name": "journeyType", "required": true, "in": "path", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatusFormData" } } } }, "responses": { "201": { "description": "", "content": { "application/json": { "schema": { "type": "object" } } } } } } }, "/book/{id}": { "get": { "tags": ["book-controller"], "summary": "get book by id", "operationId": "findBookByIdUsingGET", "parameters": [ { "name": "id", "in": "path", "description": "request param for find book", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/BookDetailVo" } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "deprecated": false }, "put": { "tags": ["book-controller"], "summary": "update book by given id", "operationId": "updateBookByIdUsingPUT", "parameters": [ { "name": "id", "in": "path", "description": "given book id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "201": { "description": "Created" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "deprecated": false, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBookRequest" } } }, "description": "update request body", "required": true } } }, "/schedules": { "get": { "tags": ["schedule-controller"], "summary": "getScheduleDetailsByDate", "operationId": "getScheduleDetailsByDateUsingGET", "parameters": [ { "name": "scheduleDate", "in": "query", "description": "scheduleDate", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "roleId", "in": "query", "description": "roleId", "required": false, "allowEmptyValue": false, "example": "111111111", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduleVO" } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "deprecated": false } }, "/documents": { "post": { "operationId": "uploadDocumentUsingPOST", "parameters": [], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/FileUploadReq" } } } }, "responses": { "201": { "description": "" } } } }, "/documents/{documentId}/doc": { "get": { "tags": ["documents-controller"], "summary": "getDocument", "operationId": "getDocumentByIdUsingGET", "parameters": [ { "name": "from", "in": "query", "description": "from", "required": false, "schema": { "type": "string", "enum": ["AAA", "BBB"] } }, { "name": "documentId", "in": "path", "description": "documentId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/DocumentVO" } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "deprecated": false } } }, "servers": [ { "url": "//0.0.0.0:8080/api/test" } ], "components": { "schemas": { "BookDetailVo": { "type": "object", "properties": { "authorName": { "type": "string", "example": "Tony" }, "createdDate": { "type": "integer", "format": "int64", "example": 19920010 }, "fileName": { "type": "string", "example": "aaa" }, "id": { "type": "string", "example": "001" }, "mimeType": { "type": "string", "example": ".png" }, "type": { "type": "string", "enum": ["INTERVENTION_RUN", "CASE_CREATION_DATE"] }, "path": { "type": "string", "example": "/home" }, "attachment": { "$ref": "#/components/schemas/ScheduleVO" } }, "title": "BookDetailVo" }, "FileUploadReq": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" } }, "required": ["file"] }, "ScheduleVO": { "type": "object", "properties": { "team": { "type": "string" }, "schedules": { "type": "array", "nullable": true, "items": { "type": "array", "items": { "$ref": "#/components/schemas/BookVO" } } }, "shiftId": { "type": "string" } }, "title": "ScheduleVO" }, "BookVO": { "type": "object", "properties": { "price": { "type": "string" }, "address": { "type": "string", "nullable": true } }, "title": "BookVO" }, "InputStream": { "type": "object", "title": "InputStream" }, "Resource": { "type": "object", "properties": { "description": { "type": "string" }, "file": { "nullable": true, "allOf": [ { "$ref": "#/components/schemas/File" } ] }, "filename": { "type": "string" }, "filename_with_underscores": { "type": "string" }, "inputStream": { "$ref": "#/components/schemas/InputStream" }, "open": { "type": "boolean" }, "readable": { "type": "boolean" }, "uri": { "$ref": "#/components/schemas/URI" }, "url": { "$ref": "#/components/schemas/URL" } }, "title": "Resource" }, "URI": { "type": "object", "properties": { "absolute": { "type": "boolean" }, "authority": { "type": "string" }, "fragment": { "type": "string" }, "host": { "type": "string" }, "opaque": { "type": "boolean" }, "path": { "type": "string" }, "port": { "type": "integer", "format": "int32" }, "query": { "type": "string" }, "rawAuthority": { "type": "string" }, "rawFragment": { "type": "string" }, "rawPath": { "type": "string" }, "rawQuery": { "type": "string" }, "rawSchemeSpecificPart": { "type": "string" }, "rawUserInfo": { "type": "string" }, "scheme": { "type": "string" }, "schemeSpecificPart": { "type": "string" }, "userInfo": { "type": "string" } }, "title": "URI" }, "URL": { "type": "object", "properties": { "authority": { "type": "string" }, "content": { "type": "object" }, "defaultPort": { "type": "integer", "format": "int32" }, "deserializedFields": { "$ref": "#/components/schemas/URLStreamHandler" }, "file": { "type": "string" }, "host": { "type": "string" }, "path": { "type": "string" }, "port": { "type": "integer", "format": "int32" }, "protocol": { "type": "string" }, "query": { "type": "string" }, "ref": { "type": "string" }, "serializedHashCode": { "type": "integer", "format": "int32" }, "userInfo": { "type": "string" } }, "title": "URL" }, "URLStreamHandler": { "type": "object", "title": "URLStreamHandler" }, "UpdateBookRequest": { "type": "object", "properties": { "birthCountry": { "type": "string", "example": "CN" }, "citizenship": { "type": "string", "example": "A" }, "roleId": { "type": "string" }, "dateOfBirth": { "type": "integer", "format": "int64", "example": "1992-10-10" }, "employmentStatus": { "type": "string", "example": "EMP001" }, "ethnicity": { "type": "string", "example": "CN" }, "gender": { "type": "string", "example": "F" }, "idNumber": { "type": "string", "example": "S6362682T" }, "idType": { "type": "string", "example": "FD" }, "spokenLanguage": { "type": "array", "example": ["AH", "AK"], "items": { "type": "string" } } }, "title": "UpdateBookRequest" }, "DocumentVO": { "type": "object", "properties": { "attachment": { "$ref": "#/components/schemas/BookDetailVo" }, "authorName": { "type": "string" }, "createdDate": { "type": "integer", "format": "int64" }, "id": { "type": "string" }, "note": { "type": "string" }, "title": { "type": "string" } }, "title": "DocumentVO" }, "AttachmentBO": { "type": "object", "properties": { "authorName": { "type": "string" }, "createdDate": { "type": "integer", "format": "int64" }, "fileName": { "type": "string" }, "id": { "type": "string" }, "mimeType": { "type": "string" }, "path": { "type": "string" } }, "title": "AttachmentBO" }, "File": { "type": "object", "properties": { "absolute": { "type": "boolean" }, "absoluteFile": { "$ref": "#/components/schemas/File" }, "absolutePath": { "type": "string" }, "canonicalFile": { "$ref": "#/components/schemas/File" }, "canonicalPath": { "type": "string" }, "directory": { "type": "boolean" }, "executable": { "type": "boolean" }, "file": { "type": "boolean" }, "freeSpace": { "type": "integer", "format": "int64" }, "hidden": { "type": "boolean" }, "lastModified": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "parent": { "type": "string" }, "parentFile": { "$ref": "#/components/schemas/File" }, "path": { "type": "string" }, "readable": { "type": "boolean" }, "totalSpace": { "type": "integer", "format": "int64" }, "usableSpace": { "type": "integer", "format": "int64" }, "writable": { "type": "boolean" } }, "title": "File" }, "BookingResponse": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/DocumentVO" }, "errors": { "type": "array", "items": { "$ref": "#/components/schemas/ErrorInfo" } } }, "title": "BookingResponse" }, "ErrorInfo": { "type": "object", "properties": { "errorMessage": { "type": "string" } }, "title": "ErrorInfo" }, "StatusFormData": { "type": "object", "properties": {} } } } }