-
Notifications
You must be signed in to change notification settings - Fork 0
add api generator #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
11t518s
wants to merge
1
commit into
main
Choose a base branch
from
feat/swagger-generator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
| "spaces": 2, | ||
| "generator-cli": { | ||
| "version": "7.4.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| wwwroot/*.js | ||
| node_modules | ||
| typings | ||
| dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm |
23 changes: 23 additions & 0 deletions
23
web/daehwahap-webview/src/apis/api-types/.openapi-generator-ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # OpenAPI Generator Ignore | ||
| # Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
|
||
| # Use this file to prevent files from being overwritten by the generator. | ||
| # The patterns follow closely to .gitignore or .dockerignore. | ||
|
|
||
| # As an example, the C# client generator defines ApiClient.cs. | ||
| # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
| #ApiClient.cs | ||
|
|
||
| # You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
| #foo/*/qux | ||
| # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
|
||
| # You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
| #foo/**/qux | ||
| # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
|
||
| # You can also negate patterns with an exclamation (!). | ||
| # For example, you can ignore all files in a docs folder with the file extension .md: | ||
| #docs/*.md | ||
| # Then explicitly reverse the ignore rule for a single file: | ||
| #!docs/README.md |
8 changes: 8 additions & 0 deletions
8
web/daehwahap-webview/src/apis/api-types/.openapi-generator/FILES
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .gitignore | ||
| .npmignore | ||
| api.ts | ||
| base.ts | ||
| common.ts | ||
| configuration.ts | ||
| git_push.sh | ||
| index.ts |
1 change: 1 addition & 0 deletions
1
web/daehwahap-webview/src/apis/api-types/.openapi-generator/VERSION
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 7.4.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| /* tslint:disable */ | ||
| /* eslint-disable */ | ||
| /** | ||
| * server | ||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
| * | ||
| * The version of the OpenAPI document: 0.0.1 | ||
| * | ||
| * | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
|
|
||
|
|
||
| import type { Configuration } from './configuration'; | ||
| import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; | ||
| import globalAxios from 'axios'; | ||
| // Some imports not used depending on template conditions | ||
| // @ts-ignore | ||
| import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; | ||
| import type { RequestArgs } from './base'; | ||
| // @ts-ignore | ||
| import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; | ||
|
|
||
|
|
||
| /** | ||
| * DefaultApi - axios parameter creator | ||
| * @export | ||
| */ | ||
| export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { | ||
| return { | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| */ | ||
| apiGet: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
| const localVarPath = `/api`; | ||
| // use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
| const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); | ||
| let baseOptions; | ||
| if (configuration) { | ||
| baseOptions = configuration.baseOptions; | ||
| } | ||
|
|
||
| const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; | ||
| const localVarHeaderParameter = {} as any; | ||
| const localVarQueryParameter = {} as any; | ||
|
|
||
|
|
||
|
|
||
| setSearchParams(localVarUrlObj, localVarQueryParameter); | ||
| let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
| localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
|
|
||
| return { | ||
| url: toPathString(localVarUrlObj), | ||
| options: localVarRequestOptions, | ||
| }; | ||
| }, | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| */ | ||
| apiHelloGet: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
| const localVarPath = `/api/hello`; | ||
| // use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
| const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); | ||
| let baseOptions; | ||
| if (configuration) { | ||
| baseOptions = configuration.baseOptions; | ||
| } | ||
|
|
||
| const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; | ||
| const localVarHeaderParameter = {} as any; | ||
| const localVarQueryParameter = {} as any; | ||
|
|
||
|
|
||
|
|
||
| setSearchParams(localVarUrlObj, localVarQueryParameter); | ||
| let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
| localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
|
|
||
| return { | ||
| url: toPathString(localVarUrlObj), | ||
| options: localVarRequestOptions, | ||
| }; | ||
| }, | ||
| } | ||
| }; | ||
|
|
||
| /** | ||
| * DefaultApi - functional programming interface | ||
| * @export | ||
| */ | ||
| export const DefaultApiFp = function(configuration?: Configuration) { | ||
| const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) | ||
| return { | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| */ | ||
| async apiGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.apiGet(options); | ||
| const localVarOperationServerIndex = configuration?.serverIndex ?? 0; | ||
| const localVarOperationServerBasePath = operationServerMap['DefaultApi.apiGet']?.[localVarOperationServerIndex]?.url; | ||
| return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
| }, | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| */ | ||
| async apiHelloGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.apiHelloGet(options); | ||
| const localVarOperationServerIndex = configuration?.serverIndex ?? 0; | ||
| const localVarOperationServerBasePath = operationServerMap['DefaultApi.apiHelloGet']?.[localVarOperationServerIndex]?.url; | ||
| return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
| }, | ||
| } | ||
| }; | ||
|
|
||
| /** | ||
| * DefaultApi - factory interface | ||
| * @export | ||
| */ | ||
| export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { | ||
| const localVarFp = DefaultApiFp(configuration) | ||
| return { | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| */ | ||
| apiGet(options?: any): AxiosPromise<string> { | ||
| return localVarFp.apiGet(options).then((request) => request(axios, basePath)); | ||
| }, | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| */ | ||
| apiHelloGet(options?: any): AxiosPromise<string> { | ||
| return localVarFp.apiHelloGet(options).then((request) => request(axios, basePath)); | ||
| }, | ||
| }; | ||
| }; | ||
|
|
||
| /** | ||
| * DefaultApi - object-oriented interface | ||
| * @export | ||
| * @class DefaultApi | ||
| * @extends {BaseAPI} | ||
| */ | ||
| export class DefaultApi extends BaseAPI { | ||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| * @memberof DefaultApi | ||
| */ | ||
| public apiGet(options?: RawAxiosRequestConfig) { | ||
| return DefaultApiFp(this.configuration).apiGet(options).then((request) => request(this.axios, this.basePath)); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @param {*} [options] Override http request option. | ||
| * @throws {RequiredError} | ||
| * @memberof DefaultApi | ||
| */ | ||
| public apiHelloGet(options?: RawAxiosRequestConfig) { | ||
| return DefaultApiFp(this.configuration).apiHelloGet(options).then((request) => request(this.axios, this.basePath)); | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| /* tslint:disable */ | ||
| /* eslint-disable */ | ||
| /** | ||
| * server | ||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
| * | ||
| * The version of the OpenAPI document: 0.0.1 | ||
| * | ||
| * | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
|
|
||
|
|
||
| import type { Configuration } from './configuration'; | ||
| // Some imports not used depending on template conditions | ||
| // @ts-ignore | ||
| import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; | ||
| import globalAxios from 'axios'; | ||
|
|
||
| export const BASE_PATH = "http://localhost:3000".replace(/\/+$/, ""); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이건 실제 swagger 기준으로 사용하게 되면 알아서 바뀌는거겠지 ?? |
||
|
|
||
| /** | ||
| * | ||
| * @export | ||
| */ | ||
| export const COLLECTION_FORMATS = { | ||
| csv: ",", | ||
| ssv: " ", | ||
| tsv: "\t", | ||
| pipes: "|", | ||
| }; | ||
|
|
||
| /** | ||
| * | ||
| * @export | ||
| * @interface RequestArgs | ||
| */ | ||
| export interface RequestArgs { | ||
| url: string; | ||
| options: RawAxiosRequestConfig; | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @export | ||
| * @class BaseAPI | ||
| */ | ||
| export class BaseAPI { | ||
| protected configuration: Configuration | undefined; | ||
|
|
||
| constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { | ||
| if (configuration) { | ||
| this.configuration = configuration; | ||
| this.basePath = configuration.basePath ?? basePath; | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| /** | ||
| * | ||
| * @export | ||
| * @class RequiredError | ||
| * @extends {Error} | ||
| */ | ||
| export class RequiredError extends Error { | ||
| constructor(public field: string, msg?: string) { | ||
| super(msg); | ||
| this.name = "RequiredError" | ||
| } | ||
| } | ||
|
|
||
| interface ServerMap { | ||
| [key: string]: { | ||
| url: string, | ||
| description: string, | ||
| }[]; | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @export | ||
| */ | ||
| export const operationServerMap: ServerMap = { | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
�api generator가 얘도 같이 만드는건가 ??