-
-
Notifications
You must be signed in to change notification settings - Fork 7k
typescript-node: Fix cookie auth, fix multiple API key auth #3927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript-node: Fix cookie auth, fix multiple API key auth #3927
Conversation
ed0d4eb
to
558ab56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-node/models.mustache
Outdated
Show resolved
Hide resolved
558ab56
to
e4706a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ janjongboom please re-generate the samples, see https://circleci.com/gh/OpenAPITools/openapi-generator/9024#tests/containers/2 |
e4706a3
to
9e0f771
Compare
9e0f771
to
79d67b1
Compare
@macjohnny Pushed updated samples. |
@janjongboom please run the https://github.com/OpenAPITools/openapi-generator/blob/master/bin/typescript-node-petstore-all.sh script, not the openapi3 version. |
@macjohnny As far as I can see I ran both the |
let's see what the CI says, but I think no more actions are required |
Great, thanks for the quick review @macjohnny |
…ools#3927) * typescript-node: Fix cookie auth, fix multiple API key auth * Re-generate samples * Re-generate samples
@janjongboom thanks for the PR, which has been included in the v4.1.3 release: https://twitter.com/oas_generator/status/1180123829626003456 |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master
,4.1.x
,5.0.x
. Default:master
.TC: @TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @nicokoenig (2018/09) @topce @akehir
Description of the PR
This pull request fixes two issues with the typescript-node generator:
in: cookie
is not supported.Multiple API Key authentication schemas
If you have the following OpenAPI definition:
The generator emits the following code:
This won't compile. In
api-single.mustache
there's currently a loop around all authentication methods that outputs a single line depending on the authentication mode. This is not necessary asHttpBasicAuth
,ApiKeyAuth
andOAuth
are always present in../models/models
. Always emitting a single line that references all of these will prevent this error.in: cookie
Will emit code that adds the API key to the query string, as
in: cookie
is not handled at all. This patch adds a handler that sets theCookie
header if this field is present.