swagger-api / swagger-api/swagger-codegen
[TYPESCRIPT-ANGULAR] "queryParameters" never instantiated in client
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The variable "queryParameters" is set as part of the process of checking the ApiKey, I believe; but before it is set it needs to be instantiated with let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()});. This instantiation never happens. It also needs to be part of the object returned by each function.
Swagger-codegen version
I have tried 3.0.14, 3.0.15, and 3.0.16.
Swagger declaration file content or url
openapi: 3.0.0
info:
version: 0.1.1
title: Operations API MWE
security:
- jwt: []
servers:
- url: 'https://operations.rysta-api.com/api'
paths:
'/v1/operations/devices/{devID}':
put:
tags:
- Device management
operationId: 'put/v1/operations/devices/:devID'
parameters:
- name: devID
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProductionDevice'
required: true
responses:
'200':
description: a list of all production devices
content:
application/json:
schema:
$ref: '#/components/schemas/ProductionDevice'
components:
securitySchemes:
jwt:
type: apiKey
name: apiKey
in: query
token:
type: apiKey
name: token
in: header
schemas:
ProductionDevice:
type: object
properties:
ID:
type: string
email:
type: string
online:
type: boolean
Command line used for generation
git clone https://github.com/swagger-api/swagger-codegen.git
git checkout 3.0.0
mvn clean package
Steps to reproduce
java -jar swagger-codegen-cli.jar generate -i swagger.json -l typescript-angular -o ./MWE_API --additional-properties modelPropertyNaming=original
Open the file /MWE_API/api/deviceManagement.service.ts; on line 83, "queryParameters" is set but it is never defined.
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 issue with the supplied OpenAPI document and generation command, then inspect /MWE_API/api/deviceManagement.service.ts around line 83. Trace that output back to the typescript-angular generator template and check how queryParameters is initialized and returned. Done means generated clients compile and include correctly initialized query parameters; add or run the relevant generator test if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100