Skip to content

Commit

Permalink
feat: context inputSpec and opts are deeply readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphe committed Mar 10, 2024
1 parent a734e32 commit fbfa110
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/codegen/src/context.ts
Expand Up @@ -5,15 +5,19 @@ import type {
TypeReferenceNode,
} from "typescript";
import type { Opts } from ".";
import { Document, SchemaObject } from "./openApi3-x";
import { Document } from "./openApi3-x";
import _ from "lodash";

export type OnlyMode = "readOnly" | "writeOnly";
export type OnlyModes = Record<OnlyMode, boolean>;

export type ReadonlyDeep<T> = {
readonly [P in keyof T]: ReadonlyDeep<T[P]>;
};

export type OazapftsContext = {
readonly inputSpec: Document;
readonly opts: Opts;
readonly inputSpec: ReadonlyDeep<Document>;
readonly opts: ReadonlyDeep<Opts>;
readonly isConverted: boolean;

spec: Document;
Expand Down

0 comments on commit fbfa110

Please sign in to comment.