OpenAPITools / OpenAPITools/openapi-generator
[BUG] TypeScript NestJS template uses URLSearchParams incorrectly
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Rather than trying to set a property on the URLSearchParams instance as seen below, it should call set.
Should be this:
queryParameters.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']));
Also we need to import COLLECTION_FORMATS.
import { COLLECTION_FORMATS } from '../variables';
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
Start with modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache at the referenced line, then inspect the generated template's imports and query parameter handling. Update the template so collection parameters use URLSearchParams.set and COLLECTION_FORMATS is imported from ../variables; done when the generated TypeScript NestJS service contains both changes.
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
- Clearly specified
- Newbie friendliness
- 52/100