mgechev / mgechev/swagger-typescript-fetch-api

Configuration not used within FetchParamCreator

Open
#1 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
33
Forks
3
PR merge metrics
No merged PRs in 30d

Description

In the generated code example below, the configuration object is not used in the Object.assign statement used to establish the settings for the request.

```typescript
export const PingApiFetchParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Gets the current version information for the application
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
get(options: any = {}): FetchArgs {
const localVarPath = `/api/Ping`;
const localVarUrlObj = url.parse(localVarPath, true);
const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

return {
url: url.format(localVarUrlObj),
options: localVarRequestOptions,
};
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the generator entry point or template that produces PingApiFetchParamCreator and inspect how configuration is handled around the Object.assign statement shown in the issue. Confirm the generated request settings use the provided configuration, then regenerate the TypeScript Fetch API example and verify the resulting code.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.