Query String parameter named 'configuration' conflicts with the api configuration in the generated typescript-fetch client. Here is a sample of the problem:
/**
* - fetch parameter creator
* @export
*/
export const ControllerApiFetchParamCreator = function (configuration?: Configuration) {
return {
/**
*/
getControllers(skip?: number, take?: number, controllerId?: string, configuration?: string, options: any = {}): FetchArgs {
const localVarPath = `/api/Controller`;
const localVarUrlObj = url.parse(localVarPath, true);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions; // note this conflicts with line 5 parameter
}
const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions, options);
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication oauth2-clientCred required
// oauth required
if (configuration && configuration.accessToken) { // note this conflicts with line 5 parameter
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? configuration.accessToken("oauth2-clientCred", ["scope1", "scope2", "scope3"])
: configuration.accessToken; // note this conflicts with line 5 parameter
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
v3.3.4
I don't have one available that I can share; however, it occurs anytime a any parameter is named 'configuration' since that conflicts with the internal client configuration object.
java -jar openapi-generator-cli.jar generate -i "https://example.com/swagger/v1/swagger.json" -o "C:\Source\Project\src\api" -g typescript-fetch -D withInterfaces=true
Linting/Transpile error when trying to build generated api.ts file (even with //tslint:disable)
Rename internal 'configuration' parameter to something a bit more specific and less likely to conflict with other api parameter names. Ex: tsFetchClientConfiguration or similar.
馃憤 Thanks for opening this issue!
馃彿 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
@macjohnny I don't know if thats the problem, I think the issue is that the variable defined in the BaseAPI conflicts with the parameter of the action.
I think its an issue in the template?
the issue in the template arises due to local variables with the same name. this can be prevented by adding configuration to the reserved words, leading to an automatic rewrite of the parameter variable name.
Would you like me to open a pull request with that add? What branch should I start with?
You can open a branch from master, make the changes, compile and check this actually resolves the issue.