@@ -2986,3 +2986,88 @@ export class Client<RequestOption> {
2986
2986
}
2987
2987
"
2988
2988
`;
2989
+
2990
+ exports[`Typedef with template ref-access 1`] = `
2991
+ "//
2992
+ // Generated by @himenon/openapi-typescript-code-generator
2993
+ //
2994
+ // OpenApi : 3.1.0
2995
+ //
2996
+ // License : MIT
2997
+ //
2998
+
2999
+
3000
+ export namespace Schemas {
3001
+ export interface Book {
3002
+ author? : {
3003
+ name? : string ;
3004
+ age? : string ;
3005
+ };
3006
+ publisher? : {
3007
+ name? : any ;
3008
+ address? : string ;
3009
+ };
3010
+ }
3011
+ export type Author = Schemas .Book .properties .author ;
3012
+ export type Publisher = Schemas .Book .properties .publisher ;
3013
+ }
3014
+ export interface Response$getBook$Status$200 {
3015
+ \\" application/json\\ " : Schemas .Book ;
3016
+ }
3017
+ export interface Response$getAuthor$Status$200 {
3018
+ \\" application/json\\ " : Schemas .Book .properties .author ;
3019
+ }
3020
+ export interface Response$getPublisher$Status$200 {
3021
+ \\" application/json\\ " : Schemas .Publisher ;
3022
+ }
3023
+ export type ResponseContentType$getBook = keyof Response$getBook$Status$200;
3024
+ export type ResponseContentType$getAuthor = keyof Response$getAuthor$Status$200;
3025
+ export type ResponseContentType$getPublisher = keyof Response$getPublisher$Status$200;
3026
+ export type HttpMethod = \\"GET\\" | \\"PUT\\" | \\"POST\\" | \\"DELETE\\" | \\"OPTIONS\\" | \\"HEAD\\" | \\"PATCH\\" | \\"TRACE\\";
3027
+ export interface ObjectLike {
3028
+ [key : string ]: any ;
3029
+ }
3030
+ export interface QueryParameter {
3031
+ value : any ;
3032
+ style ?: \\" form\\ " | \\" spaceDelimited\\ " | \\" pipeDelimited\\ " | \\" deepObject\\ " ;
3033
+ explode : boolean ;
3034
+ }
3035
+ export interface QueryParameters {
3036
+ [key : string ]: QueryParameter ;
3037
+ }
3038
+ export type SuccessResponses = Response$getBook$Status$200 | Response$getAuthor$Status$200 | Response$getPublisher$Status$200;
3039
+ export namespace ErrorResponse {
3040
+ export type getBook = void ;
3041
+ export type getAuthor = void ;
3042
+ export type getPublisher = void ;
3043
+ }
3044
+ export interface ApiClient<RequestOption > {
3045
+ request : <T = SuccessResponses >(httpMethod: HttpMethod, url: string, headers: ObjectLike | any, requestBody: ObjectLike | any, queryParameters: QueryParameters | undefined, options?: RequestOption) => Promise<T >;
3046
+ }
3047
+ export class Client<RequestOption > {
3048
+ private baseUrl : string ;
3049
+ constructor (private apiClient : ApiClient <RequestOption >, baseUrl: string) { this .baseUrl = baseUrl .replace (/ \\\\/ $ / , \\" \\ " ); }
3050
+ public async getBook(option?: RequestOption): Promise<Response$getBook$Status$200[\\"application/json\\"]> {
3051
+ const url = this .baseUrl + \` /get/book/{ id } \` ;
3052
+ const headers = {
3053
+ Accept : \\" application/json\\ "
3054
+ } ;
3055
+ return this.apiClient.request(\\ "GET\\ ", url, headers, undefined, undefined, option);
3056
+ }
3057
+ public async getAuthor(option?: RequestOption): Promise<Response$getAuthor$Status$200[\\ "application/json\\ "]> {
3058
+ const url = this .baseUrl + \` /get/author/{ id } \` ;
3059
+ const headers = {
3060
+ Accept : \\" application/json\\ "
3061
+ } ;
3062
+ return this.apiClient.request(\\ "GET\\ ", url, headers, undefined, undefined, option);
3063
+ }
3064
+ public async getPublisher(option?: RequestOption): Promise<Response$getPublisher$Status$200[\\ "application/json\\ "]> {
3065
+ const url = this .baseUrl + \` /get/publisher/{ id } \` ;
3066
+ const headers = {
3067
+ Accept : \\" application/json\\ "
3068
+ } ;
3069
+ return this.apiClient.request(\\ "GET\\ ", url, headers, undefined, undefined, option);
3070
+ }
3071
+ }
3072
+ "
3073
+ ` ;
0 commit comments