@@ -2986,3 +2986,109 @@ 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 Parameter$getBook {
3015
+ /** Book ID */
3016
+ id : string ;
3017
+ }
3018
+ export interface Response$getBook$Status$200 {
3019
+ \\" application/json\\ " : Schemas .Book ;
3020
+ }
3021
+ export interface Parameter$getAuthor {
3022
+ /** Author Id */
3023
+ id : string ;
3024
+ }
3025
+ export interface Response$getAuthor$Status$200 {
3026
+ \\" application/json\\ " : Schemas .Book .properties .author ;
3027
+ }
3028
+ export interface Parameter$getPublisher {
3029
+ /** Publisher ID */
3030
+ id : string ;
3031
+ }
3032
+ export interface Response$getPublisher$Status$200 {
3033
+ \\" application/json\\ " : Schemas .Publisher ;
3034
+ }
3035
+ export type ResponseContentType$getBook = keyof Response$getBook$Status$200;
3036
+ export interface Params$getBook {
3037
+ parameter : Parameter$getBook ;
3038
+ }
3039
+ export type ResponseContentType$getAuthor = keyof Response$getAuthor$Status$200;
3040
+ export interface Params$getAuthor {
3041
+ parameter : Parameter$getAuthor ;
3042
+ }
3043
+ export type ResponseContentType$getPublisher = keyof Response$getPublisher$Status$200;
3044
+ export interface Params$getPublisher {
3045
+ parameter : Parameter$getPublisher ;
3046
+ }
3047
+ export type HttpMethod = \\"GET\\" | \\"PUT\\" | \\"POST\\" | \\"DELETE\\" | \\"OPTIONS\\" | \\"HEAD\\" | \\"PATCH\\" | \\"TRACE\\";
3048
+ export interface ObjectLike {
3049
+ [key : string ]: any ;
3050
+ }
3051
+ export interface QueryParameter {
3052
+ value : any ;
3053
+ style ?: \\" form\\ " | \\" spaceDelimited\\ " | \\" pipeDelimited\\ " | \\" deepObject\\ " ;
3054
+ explode : boolean ;
3055
+ }
3056
+ export interface QueryParameters {
3057
+ [key : string ]: QueryParameter ;
3058
+ }
3059
+ export type SuccessResponses = Response$getBook$Status$200 | Response$getAuthor$Status$200 | Response$getPublisher$Status$200;
3060
+ export namespace ErrorResponse {
3061
+ export type getBook = void ;
3062
+ export type getAuthor = void ;
3063
+ export type getPublisher = void ;
3064
+ }
3065
+ export interface ApiClient<RequestOption > {
3066
+ request : <T = SuccessResponses >(httpMethod: HttpMethod, url: string, headers: ObjectLike | any, requestBody: ObjectLike | any, queryParameters: QueryParameters | undefined, options?: RequestOption) => Promise<T >;
3067
+ }
3068
+ export class Client<RequestOption > {
3069
+ private baseUrl : string ;
3070
+ constructor (private apiClient : ApiClient <RequestOption >, baseUrl: string) { this .baseUrl = baseUrl .replace (/ \\\\/ $ / , \\" \\ " ); }
3071
+ public async getBook(params: Params$getBook, option?: RequestOption): Promise<Response$getBook$Status$200[\\"application/json\\"]> {
3072
+ const url = this .baseUrl + \` /get/book/\$ { params .parameter .id } \` ;
3073
+ const headers = {
3074
+ Accept : \\" application/json\\ "
3075
+ } ;
3076
+ return this.apiClient.request(\\ "GET\\ ", url, headers, undefined, undefined, option);
3077
+ }
3078
+ public async getAuthor(params: Params$getAuthor, option?: RequestOption): Promise<Response$getAuthor$Status$200[\\ "application/json\\ "]> {
3079
+ const url = this .baseUrl + \` /get/author/\$ { params .parameter .id } \` ;
3080
+ const headers = {
3081
+ Accept : \\" application/json\\ "
3082
+ } ;
3083
+ return this.apiClient.request(\\ "GET\\ ", url, headers, undefined, undefined, option);
3084
+ }
3085
+ public async getPublisher(params: Params$getPublisher, option?: RequestOption): Promise<Response$getPublisher$Status$200[\\ "application/json\\ "]> {
3086
+ const url = this .baseUrl + \` /get/publisher/\$ { params .parameter .id } \` ;
3087
+ const headers = {
3088
+ Accept : \\" application/json\\ "
3089
+ } ;
3090
+ return this.apiClient.request(\\ "GET\\ ", url, headers, undefined, undefined, option);
3091
+ }
3092
+ }
3093
+ "
3094
+ ` ;
0 commit comments