[BUG][typescript-nestjs] Undefined `queryParameters` for Service with authentication
Created by: Panzer1119
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
Some of the generated Nest Services have undefined queryParameters
if the operation doesn't use query parameters, but authentication via apikey (as query parameter).
openapi-generator version
6.0.1
OpenAPI declaration file content or url
Generation Details
additionalProperties:
nestVersion: 6.0.0
fileNaming: kebab-case
nestVersion: 9.0.4
supportsES6: true
stringEnums: true
enumPropertyNaming: UPPERCASE
Steps to reproduce
Generate the API Client and inspect the api/*.service.ts
files.
openapi-generator-cli generate -g typescript-nestjs -i https://raw.githubusercontent.com/Radarr/Radarr/develop/src/Radarr.Api.V3/openapi.json --additional-properties=fileNaming=kebab-case,nestVersion=9.0.4,supportsES6=true,stringEnums=true,enumPropertyNaming=UPPERCASE
Related issues/PRs
Suggest a fix
If hasQueryParams
is false, then queryParameters
doesn't get initialized here:
So just initialize queryParameters
here (with a check for hasQueryParams
e.g. {{^hasQueryParams}}
):