Skip to content

Commit

Permalink
openapiのコード生成を行った (VOICEVOX#613)
Browse files Browse the repository at this point in the history
* feat: generated openapi code

openapiのコード生成を行った

refs VOICEVOX#608 VOICEVOX#610

* コード生成した結果、ビルドが通らなくなったので修正した

* openapitools.jsonをgit管理下に置くようにした
  • Loading branch information
qwerty2501 authored Dec 22, 2021
1 parent b53f878 commit c2705a2
Show file tree
Hide file tree
Showing 22 changed files with 300 additions and 215 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ pnpm-debug.log*
#Electron-builder output
/dist_electron

# openapi
openapitools.json

# data
data/

Expand Down
2 changes: 1 addition & 1 deletion openapi.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions openapitools.json
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": "5.3.0"
}
}
31 changes: 16 additions & 15 deletions src/openapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
apis/DefaultApi.ts
apis/index.ts
index.ts
models/AccentPhrase.ts
models/AudioQuery.ts
models/HTTPValidationError.ts
models/Mora.ts
models/ParseKanaBadRequest.ts
models/Preset.ts
models/Speaker.ts
models/SpeakerInfo.ts
models/SpeakerStyle.ts
models/ValidationError.ts
models/index.ts
runtime.ts
apis/DefaultApi.ts
apis/index.ts
index.ts
models/AccentPhrase.ts
models/AudioQuery.ts
models/HTTPValidationError.ts
models/Mora.ts
models/ParseKanaBadRequest.ts
models/Preset.ts
models/Speaker.ts
models/SpeakerInfo.ts
models/SpeakerStyle.ts
models/StyleInfo.ts
models/ValidationError.ts
models/index.ts
runtime.ts
2 changes: 1 addition & 1 deletion src/openapi/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.1
5.3.0
258 changes: 169 additions & 89 deletions src/openapi/apis/DefaultApi.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/openapi/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from "./DefaultApi";
/* tslint:disable */
/* eslint-disable */
export * from './DefaultApi';
8 changes: 5 additions & 3 deletions src/openapi/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from "./runtime";
export * from "./apis";
export * from "./models";
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis';
export * from './models';
5 changes: 2 additions & 3 deletions src/openapi/models/AccentPhrase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface AccentPhrase {
* @type {Mora}
* @memberof AccentPhrase
*/
pauseMora?: Mora;
pauseMora?: Mora | null;
}

export function AccentPhraseFromJSON(json: any): AccentPhrase {
Expand Down Expand Up @@ -77,4 +77,3 @@ export function AccentPhraseToJSON(value?: AccentPhrase | null): any {
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/AudioQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -133,4 +133,3 @@ export function AudioQueryToJSON(value?: AudioQuery | null): any {
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/HTTPValidationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -61,4 +61,3 @@ export function HTTPValidationErrorToJSON(value?: HTTPValidationError | null): a
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/Mora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -94,4 +94,3 @@ export function MoraToJSON(value?: Mora | null): any {
};
}


17 changes: 8 additions & 9 deletions src/openapi/models/ParseKanaBadRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -27,13 +27,13 @@ export interface ParseKanaBadRequest {
text: string;
/**
* |name|description|
|---|---|
| UNKNOWN_TEXT | 判別できない読み仮名があります: {text} |
| ACCENT_TOP | 句頭にアクセントは置けません: {text} |
| ACCENT_TWICE | 1つのアクセント句に二つ以上のアクセントは置けません: {text} |
| ACCENT_NOTFOUND | アクセントを指定していないアクセント句があります: {text} |
| EMPTY_PHRASE | {position}番目のアクセント句が空白です |
| INFINITE_LOOP | 処理時に無限ループになってしまいました...バグ報告をお願いします。 |
* |---|---|
* | UNKNOWN_TEXT | 判別できない読み仮名があります: {text} |
* | ACCENT_TOP | 句頭にアクセントは置けません: {text} |
* | ACCENT_TWICE | 1つのアクセント句に二つ以上のアクセントは置けません: {text} |
* | ACCENT_NOTFOUND | アクセントを指定していないアクセント句があります: {text} |
* | EMPTY_PHRASE | {position}番目のアクセント句が空白です |
* | INFINITE_LOOP | 処理時に無限ループになってしまいました...バグ報告をお願いします。 |
* @type {string}
* @memberof ParseKanaBadRequest
*/
Expand Down Expand Up @@ -77,4 +77,3 @@ export function ParseKanaBadRequestToJSON(value?: ParseKanaBadRequest | null): a
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/Preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -126,4 +126,3 @@ export function PresetToJSON(value?: Preset | null): any {
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/Speaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -85,4 +85,3 @@ export function SpeakerToJSON(value?: Speaker | null): any {
};
}


12 changes: 6 additions & 6 deletions src/openapi/models/SpeakerInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -17,8 +17,9 @@ import {
StyleInfo,
StyleInfoFromJSON,
StyleInfoFromJSONTyped,
StyleInfoToJSON
} from "./";
StyleInfoToJSON,
} from './';

/**
* 話者の追加情報
* @export
Expand All @@ -39,8 +40,8 @@ export interface SpeakerInfo {
portrait: string;
/**
*
* @type Array<StyleInfo>
* @memberof StyleInfos
* @type {Array<StyleInfo>}
* @memberof SpeakerInfo
*/
styleInfos: Array<StyleInfo>;
}
Expand Down Expand Up @@ -76,4 +77,3 @@ export function SpeakerInfoToJSON(value?: SpeakerInfo | null): any {
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/SpeakerStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -62,4 +62,3 @@ export function SpeakerStyleToJSON(value?: SpeakerStyle | null): any {
};
}


87 changes: 43 additions & 44 deletions src/openapi/models/StyleInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
*
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand All @@ -14,60 +14,59 @@

import { exists, mapValues } from '../runtime';
/**
* engineから得られる話者のスタイル情報
* スタイルの追加情報
* @export
* @interface StyleInfo
*/
export interface StyleInfo {
/**
*
* @type {number}
* @memberof StyleInfo
*/
id: number;
/**
*
* @type {string}
* @memberof StyleInfo
*/
icon: string;
/**
*
* @type {Array<string>}
* @memberof StyleInfo
*/
voiceSamples: Array<string>;
/**
*
* @type {number}
* @memberof StyleInfo
*/
id: number;
/**
*
* @type {string}
* @memberof StyleInfo
*/
icon: string;
/**
*
* @type {Array<string>}
* @memberof StyleInfo
*/
voiceSamples: Array<string>;
}

export function StyleInfoFromJSON(json: any): StyleInfo {
return StyleInfoFromJSONTyped(json, false);
return StyleInfoFromJSONTyped(json, false);
}

export function StyleInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): StyleInfo {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'id': json['id'],
'icon': json['icon'],
'voiceSamples': json['voice_samples'],
};
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'icon': json['icon'],
'voiceSamples': json['voice_samples'],
};
}

export function StyleInfoToJSON(value?: StyleInfo | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'id': value.id,
'icon': value.icon,
'voice_samples': value.voiceSamples,
};
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'icon': value.icon,
'voice_samples': value.voiceSamples,
};
}


3 changes: 1 addition & 2 deletions src/openapi/models/ValidationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VOICEVOX ENGINE
* VOICEVOXの音声合成エンジンです。
*
* The version of the OpenAPI document: 0.8.0
* The version of the OpenAPI document: 0.10.preview.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -70,4 +70,3 @@ export function ValidationErrorToJSON(value?: ValidationError | null): any {
};
}


24 changes: 13 additions & 11 deletions src/openapi/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export * from "./AccentPhrase";
export * from "./AudioQuery";
export * from "./HTTPValidationError";
export * from "./Mora";
export * from "./ParseKanaBadRequest";
export * from "./Preset";
export * from "./Speaker";
export * from "./SpeakerInfo";
export * from "./SpeakerStyle";
export * from "./StyleInfo";
export * from "./ValidationError";
/* tslint:disable */
/* eslint-disable */
export * from './AccentPhrase';
export * from './AudioQuery';
export * from './HTTPValidationError';
export * from './Mora';
export * from './ParseKanaBadRequest';
export * from './Preset';
export * from './Speaker';
export * from './SpeakerInfo';
export * from './SpeakerStyle';
export * from './StyleInfo';
export * from './ValidationError';
Loading

0 comments on commit c2705a2

Please sign in to comment.