openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

Ability to provide auth header in order to access private openApi specification files

Open mbraint opened this issue 4 years ago • 0 comments

Describe the solution you'd like In the CLI options, there is a way to provide an URL to the OAS.
It works properly if the access to the provided URL is public.

But in some cases, the OAS is private and in order to access it, we have to provide credentials usually as an HTTP header.
e.g. gitlab.com expects custom header: PRIVATE-TOKEN=xxxxxxxxxx\

As a user, I want to have the ability to pass some HTTP header as a CLI option when the input is an URL

--input-url-header <value> an HTTP header with a token for access to private OAS. Works only when --input is an URL

I found that under the hood this lib uses json-schema-ref-parser where it is possible to pass HTTP headers during requests.

mbraint avatar Nov 11 '21 06:11 mbraint