Skip to content

Commit

Permalink
feat: added baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
abuyukyi101198 committed Jan 14, 2025
1 parent a27b975 commit e3e0124
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 7 additions & 1 deletion openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { defineConfig as defineCustomPlugin } from "./src/app/apiclient/plugin";

import { client } from "./src/app/apiclient/codegen";

client.setConfig({
baseUrl: "http://maas-ui-demo.internal:5240/MAAS/a/v3/",
});

export default {
client: "@hey-api/client-fetch",
input: "http://maas-ui-demo.internal:5240/MAAS/a/openapi.json",
Expand All @@ -10,4 +16,4 @@ export default {
},
experimentalParser: true,
plugins: [defineCustomPlugin(), "@hey-api/typescript", "@hey-api/sdk"],
};
};
12 changes: 6 additions & 6 deletions src/app/apiclient/plugin/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { handler } from "./plugin";
import type { Config } from "./types";

export const defaultConfig: Plugin.Config<Config> = {
_dependencies: ["@hey-api/typescript", "@hey-api/sdk"],
_handler: handler,
_handlerLegacy: () => {},
name: "custom-name-plugin",
_dependencies: ["@hey-api/typescript", "@hey-api/sdk"],
_handler: handler,
_handlerLegacy: () => {},
name: "custom-name-plugin",
};

export const defineConfig: Plugin.DefineConfig<Config> = (config) => ({
...defaultConfig,
...config,
...defaultConfig,
...config,
});
2 changes: 1 addition & 1 deletion src/app/apiclient/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { defaultConfig, defineConfig } from "./config";

export type { Config } from "./types";
export type { Config } from "./types";
4 changes: 2 additions & 2 deletions src/app/apiclient/plugin/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface Config {
name: string;
}
name: string;
}

0 comments on commit e3e0124

Please sign in to comment.