Skip to content

Commit

Permalink
Prevent OpenAPI emitter from tripping on ErrorTypes in ADL output
Browse files Browse the repository at this point in the history
  • Loading branch information
daviwil committed Jun 25, 2021
1 parent 6067557 commit 5fd38c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/adl/lib/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export function isStringType(program: Program, target: Type): boolean {
return intrinsicType !== undefined && intrinsicType === "string";
}

export function isErrorType(type: Type): boolean {
return type.kind === "Intrinsic" && type.name === "ErrorType";
}

const numericTypesKey = Symbol();
export function numeric(program: Program, target: Type) {
if (!isIntrinsic(program, target)) {
Expand Down

0 comments on commit 5fd38c3

Please sign in to comment.