You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this solution to make types from oapi jsons.
As I see this tool already supports --auth option and this arg expects to get a token for the Authorization header. However in my case I need to pass a header like Cookie: auth=xxx to get a private schema.
What is your opinion about changing the --auth argument logic from handling just a value for the Authorization header to handle full header value? This implementation will be more flexible for users, but this will be a breaking change for existing users.
The current syntax: npx openapi-typescript --auth "Basic YWxhZGRpbjpvcGVuc2VzYW1l" https://oapi.com/secret-schema.json
The suggested syntax: npx openapi-typescript --auth "Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l" https://oapi.com/secret-schema.json
If you are open to make this change, I will be glad to help with this logic implementation.
The text was updated successfully, but these errors were encountered:
Hm. I think in that case I’d probably rather add a --header flag with a curl-like syntax, like so: --header "Authorization: …" --header "Content-Type: application-json, etc. That way you just have full control over the headers. And we can keep --auth just as a shortcut.
Thank you for sharing this solutions. It's a great alternative.
Just one more question, for a command like npx openapi-typescript schema.yaml --auth "token123" --header "Authorization: token789" should the tool use token123 or token789 as an auth token?
In my opinion it should use the token789 token because it comes from a --header flag.
Hey,
Thanks for this solution to make types from oapi jsons.
As I see this tool already supports
--auth
option and this arg expects to get a token for theAuthorization
header. However in my case I need to pass a header likeCookie: auth=xxx
to get a private schema.What is your opinion about changing the
--auth
argument logic from handling just a value for theAuthorization
header to handle full header value? This implementation will be more flexible for users, but this will be a breaking change for existing users.The current syntax:
npx openapi-typescript --auth "Basic YWxhZGRpbjpvcGVuc2VzYW1l" https://oapi.com/secret-schema.json
The suggested syntax:
npx openapi-typescript --auth "Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l" https://oapi.com/secret-schema.json
If you are open to make this change, I will be glad to help with this logic implementation.
The text was updated successfully, but these errors were encountered: