Skip to content

Commit

Permalink
fix: bring back the allowOperationIds option (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Himenon authored Apr 7, 2021
1 parent 8803743 commit cbccec3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import { EOL } from "os";
import * as Api from "./api";
import type * as Types from "./types";

export interface Option {
allowOperationIds?: string[];
}

export class CodeGenerator {
private rootSchema: Types.OpenApi.Document;
private resolvedReferenceDocument: Types.OpenApi.Document;
private parser: Api.OpenApiTools.Parser;
constructor(private readonly entryPoint: string) {
constructor(private readonly entryPoint: string, option?: Option) {
this.rootSchema = Api.FileSystem.loadJsonOrYaml(entryPoint);
this.resolvedReferenceDocument = Api.ResolveReference.resolve(entryPoint, entryPoint, JSON.parse(JSON.stringify(this.rootSchema)));
this.parser = this.createParser();
this.parser = this.createParser(option?.allowOperationIds);
}

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

0 comments on commit cbccec3

Please sign in to comment.