Bug Report Checklist
Description
Use of apiKey in the query causes uncompilable service code. It generates:
// authentication (SessionIdAuth) required
localVarQueryParameters = this.configuration.addCredentialToQuery('SessionIdAuth', 'sid', localVarQueryParameters);
This is failing to compile with the error:
Type 'HttpParams' is missing the following properties from type 'OpenApiHttpParams': params, defaults, resolveOptions, toRecord, toHttpParamsts(2739)
openapi-generator version
Used version 7.19.0 and also latest master.
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: Test API key in query
version: v1
paths:
/pet-store:
get:
operationId: get
parameters:
- name: id
in: query
required: true
schema:
type: string
responses:
'200':
description: Successful operation
components:
securitySchemes:
SessionIdAuth:
type: apiKey
in: query
name: sid
security:
- SessionIdAuth: []
Also available at https://gist.github.com/saxicek/43daa70a6d95dece378f5729517cb0c1/raw/798d83b853e589451ef39b0d81fe13b232f06d87/api_key_query.yaml
Generation Details
Steps to reproduce
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i api_key_query.yaml \
-g typescript-angular \
-o ./typescript-angular
Related issues/PRs
Suggest a fix
I think we can simply change addCredentialToQuery method signature to work with OpenApiHttpParams instead of HttpParams. I will submit a PR for that.
Bug Report Checklist
Description
Use of
apiKeyin the query causes uncompilable service code. It generates:This is failing to compile with the error:
openapi-generator version
Used version 7.19.0 and also latest master.
OpenAPI declaration file content or url
Also available at https://gist.github.com/saxicek/43daa70a6d95dece378f5729517cb0c1/raw/798d83b853e589451ef39b0d81fe13b232f06d87/api_key_query.yaml
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
I think we can simply change
addCredentialToQuerymethod signature to work withOpenApiHttpParamsinstead ofHttpParams. I will submit a PR for that.