File tree Expand file tree Collapse file tree 5 files changed +7
-1
lines changed Expand file tree Collapse file tree 5 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,7 @@ export interface GenerateApiConfiguration {
343343 routeName : string ;
344344 } ;
345345 routeNameDuplicatesMap : Map < string , string > ;
346+ apiClassName : string
346347 } ;
347348 modelTypes : ModelType [ ] ;
348349 rawModelTypes : SchemaComponent [ ] ;
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ generateApi({
106106 typePrefix : program . typePrefix ,
107107 typeSuffix : program . typeSuffix ,
108108 patch : ! ! program . patch ,
109+ apiClassName,
109110} ) . catch ( ( err ) => {
110111 // NOTE collect all errors on top level and shows to users in any case
111112 console . error ( err ) ;
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ const config = {
9191 typeSuffix : "" ,
9292 patch : false ,
9393 componentTypeNameResolver : new NameResolver ( [ ] ) ,
94+ /** name of the main exported class */
95+ apiClassName : "Api" ,
9496} ;
9597
9698/** needs to use data everywhere in project */
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ module.exports = {
6464 typeSuffix = config . typeSuffix ,
6565 patch = config . patch ,
6666 authorizationToken,
67+ apiClassName = config . apiClassName ,
6768 } ) =>
6869 new Promise ( ( resolve , reject ) => {
6970 addToConfig ( {
@@ -99,6 +100,7 @@ module.exports = {
99100 typePrefix,
100101 typeSuffix,
101102 patch,
103+ apiClassName,
102104 } ) ;
103105 ( spec
104106 ? convertSwaggerObject ( spec , { patch } )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ const descriptionLines = _.compact([
3636<% }) %>
3737*/
3838<% } %>
39- export class Api <SecurityDataType extends unknown><% if (!config.singleHttpClient) { %> extends HttpClient<SecurityDataType> <% } %> {
39+ export class <%~ config.apiClassName %> <SecurityDataType extends unknown><% if (!config.singleHttpClient) { %> extends HttpClient<SecurityDataType> <% } %> {
4040
4141<% if(config.singleHttpClient) { %>
4242 http: HttpClient<SecurityDataType>;
You can’t perform that action at this time.
0 commit comments