-
How to configure the client to use basic authentication if OpenAPI is behind basic auth? |
Beta Was this translation helpful? Give feedback.
Answered by
mrlubos
Sep 4, 2024
Replies: 2 comments 5 replies
-
@ddhanak are you using the standalone client? (Fetch or Axios) |
Beta Was this translation helpful? Give feedback.
0 replies
-
@mrlubos I am using the Axios client, here is my config: import { defineConfig } from "@hey-api/openapi-ts";
const DEFAULT_URL = "https://my.api.com";
export default defineConfig({
base: DEFAULT_URL,
plugins: ["@tanstack/react-query"],
client: {
name: "@hey-api/client-axios"
},
input: `${DEFAULT_URL}/openapi.json`,
output: {
path: "./api/client",
format: "prettier",
lint: "eslint"
},
types: {
enums: "typescript",
name: "PascalCase"
}
});
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh wait, are you asking how to fetch the spec behind auth? You could use programmatic access to call the generator from TypeScript once you have the spec. How you get the spec is then up to you. There's no current support for different security schemes, think there's an issue related to this