You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ferdi Koomen edited this page Dec 21, 2023
·
1 revision
Flag:--name
The OpenAPI generator allows creation of client instances to support the multiple backend services use case.
The generated client uses an instance of the server configuration and not the global OpenAPI constant.
To generate a client instance, set a custom name to the client class, use --name option.
The generated client will be exported from the index file and can be used as shown below:
// Create the client instance with server and authentication detailsconstappClient=newAppClient({BASE: 'http://server-host.com',TOKEN: '1234',});// Use the client instance to make the API callconstresponse=awaitappClient.organizations.createOrganization({name: 'OrgName',description: 'OrgDescription',});