Skip to content

Commit cbccec3

Browse files
authored
fix: bring back the allowOperationIds option (#40)
1 parent 8803743 commit cbccec3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import { EOL } from "os";
33
import * as Api from "./api";
44
import type * as Types from "./types";
55

6+
export interface Option {
7+
allowOperationIds?: string[];
8+
}
9+
610
export class CodeGenerator {
711
private rootSchema: Types.OpenApi.Document;
812
private resolvedReferenceDocument: Types.OpenApi.Document;
913
private parser: Api.OpenApiTools.Parser;
10-
constructor(private readonly entryPoint: string) {
14+
constructor(private readonly entryPoint: string, option?: Option) {
1115
this.rootSchema = Api.FileSystem.loadJsonOrYaml(entryPoint);
1216
this.resolvedReferenceDocument = Api.ResolveReference.resolve(entryPoint, entryPoint, JSON.parse(JSON.stringify(this.rootSchema)));
13-
this.parser = this.createParser();
17+
this.parser = this.createParser(option?.allowOperationIds);
1418
}
1519

1620
private createParser(allowOperationIds?: string[]): Api.OpenApiTools.Parser {

0 commit comments

Comments
 (0)