Skip to content

Commit 8e00fa9

Browse files
committed
fix: update output handling in plugins and add output documentation
1 parent 1b76c64 commit 8e00fa9

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

packages/openapi-ts/src/generate/legacy/output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const generateLegacyOutput = async ({
8888

8989
for (const name of config.pluginOrder) {
9090
const plugin = config.plugins[name]!;
91-
const outputParts = (plugin.output ?? '').toString().split('/');
91+
const outputParts = (plugin.output ?? '').split('/');
9292
const outputDir = path.resolve(
9393
config.output.path,
9494
...outputParts.slice(0, outputParts.length - 1),

packages/openapi-ts/src/ir/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class IRContext<Spec extends Record<string, any> = any> {
142142
dependencies: plugin.dependencies ?? [],
143143
handler: plugin.handler,
144144
name: plugin.name,
145-
output: plugin.output! as string,
145+
output: plugin.output!,
146146
});
147147
this.plugins[instance.name] = instance;
148148
return instance;

packages/openapi-ts/src/plugins/@angular/common/types.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ export type UserConfig = Plugin.Name<'@angular/common'> & {
5656
* Options for generating HTTP resource APIs.
5757
*/
5858
httpResource?: AngularHttpResourceOptions;
59+
60+
/**
61+
* Name of the generated file.
62+
*
63+
* @default '@angular/common'
64+
*/
65+
output?: string;
5966
};
6067

6168
export type AngularCommonPlugin = DefinePlugin<UserConfig, UserConfig>;

0 commit comments

Comments
 (0)