OpenAPITools / OpenAPITools/openapi-generator
[BUG] [typescript-fetch] method name conflicts xxxRaw
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue?
-
Have you validated the input using an OpenAPI validator (example)?
-
Have you tested with the latest master to confirm the issue still exists?
-
Have you searched for related issues/PRs?
-
[] What's the actual output vs expected output?
-
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
https://try.gitea.io/swagger.v1.json
Provides method renderMarkdown and renderMarkdownRaw
renderMarkdown generate
- public method
renderMarkdown() - and public internal
renderMarkdownRaw(), seems for internal use
renderMarkdownRaw generate
- public method
renderMarkdownRaw() - and public internal
renderMarkdownRawRaw(), seems for internal use
Two renderMarkdownRaw() are not same
openapi-generator version
OpenAPI declaration file content or url
https://try.gitea.io/swagger.v1.json
Generation Details
Steps to reproduce
$ openapi-generator-cli generate -g typescript-fetch -i https://try.gitea.io/swagger.v1.json -o src
$ tsc --init
$ tsc --outDir dist
src/apis/MiscellaneousApi.ts(204,11): error TS2393: Duplicate function implementation.
src/apis/MiscellaneousApi.ts(312,11): error TS2393: Duplicate function implementation.
src/apis/index.ts(10,1): error TS2308: Module './RepositoryApi' has already exported a member named 'CreateCurrentUserRepoRequest'. Consider explicitly re-exporting to resolve the ambiguity.
src/runtime.ts(129,24): error TS2304: Cannot find name 'GlobalFetch'.
/**
* Render a markdown document as HTML
*/
async renderMarkdownRaw(requestParameters: RenderMarkdownRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<string>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
// if (this.configuration && this.configuration.apiKey) {
// ...
// ...
return new runtime.TextApiResponse(response) as any;
}
/**
* Render raw markdown as HTML
*/
async renderMarkdownRaw(requestParameters: RenderMarkdownRawRequest, initOverrides?: RequestInit): Promise<string> {
const response = await this.renderMarkdownRawRaw(requestParameters, initOverrides);
return await response.value();
}
Related issues/PRs
Suggest a fix
renderMarkdown generate
- public method
renderMarkdown() - and private internal
#renderMarkdown()
renderMarkdownRaw generate
- public method
renderMarkdownRaw() - and private internal
#renderMarkdownRaw()
class X {
renderMarkdown() { return this.#renderMarkdownRaw() }
// deprecate: renderMarkdownRaw() { console.log('renderMarkdown') }
#renderMarkdown() { console.log('renderMarkdown') }
renderMarkdownRaw() { return this.#renderMarkdownRawRaw() }
// deprecate: renderMarkdownRawRaw() { console.log('renderMarkdownRaw') }
#renderMarkdownRaw() { console.log('renderMarkdownRaw') }
}
const x = new X()
x.renderMarkdown()
x.renderMarkdownRaw()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the generator command with https://try.gitea.io/swagger.v1.json, then inspect the generated src/apis/MiscellaneousApi.ts, src/apis/index.ts, and src/runtime.ts. Compare the duplicate method declarations and TypeScript compiler errors with the requested public/internal method behavior. Done means the generated typescript-fetch client compiles without the reported duplicate or export errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100