-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support enum with null to make nullable (#2034)
- Loading branch information
1 parent
de7e150
commit 33574c1
Showing
15 changed files
with
585 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/parsers/src/openapi/3.1/schemas/primitives/UnknownConverter.node.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { noop } from "ts-essentials"; | ||
import { FernRegistry } from "../../../../client/generated"; | ||
import { | ||
BaseOpenApiV3_1ConverterNodeConstructorArgs, | ||
BaseOpenApiV3_1ConverterNodeWithExample, | ||
} from "../../../BaseOpenApiV3_1Converter.node"; | ||
import { SchemaConverterNode } from "../SchemaConverter.node"; | ||
|
||
export declare namespace UnknownConverterNode { | ||
export interface Output extends FernRegistry.api.latest.TypeShape.Alias { | ||
type: "alias"; | ||
value: FernRegistry.api.latest.TypeReference.Unknown; | ||
} | ||
} | ||
|
||
export class UnknownConverterNode extends BaseOpenApiV3_1ConverterNodeWithExample< | ||
unknown, | ||
UnknownConverterNode.Output | ||
> { | ||
displayName: string | undefined; | ||
shape: SchemaConverterNode | undefined; | ||
|
||
constructor(args: BaseOpenApiV3_1ConverterNodeConstructorArgs<unknown>) { | ||
super(args); | ||
this.safeParse(); | ||
} | ||
|
||
parse(): void { | ||
noop(); | ||
} | ||
|
||
convert(): UnknownConverterNode.Output | undefined { | ||
return { | ||
type: "alias", | ||
value: { | ||
type: "unknown", | ||
displayName: undefined, | ||
}, | ||
}; | ||
} | ||
|
||
example(): undefined { | ||
return undefined; | ||
} | ||
} |
Oops, something went wrong.