diff --git a/src/NodeParser/IntrinsicNodeParser.ts b/src/NodeParser/IntrinsicNodeParser.ts index 2acaab4b2..931c5cc98 100644 --- a/src/NodeParser/IntrinsicNodeParser.ts +++ b/src/NodeParser/IntrinsicNodeParser.ts @@ -12,6 +12,7 @@ export const intrinsicMethods: Record string) | undefine Lowercase: (v) => v.toLowerCase(), Capitalize: (v) => v[0].toUpperCase() + v.slice(1), Uncapitalize: (v) => v[0].toLowerCase() + v.slice(1), + NoInfer: (v) => v, }; export class IntrinsicNodeParser implements SubNodeParser { diff --git a/test/valid-data/string-literals-intrinsic/main.ts b/test/valid-data/string-literals-intrinsic/main.ts index b304e2c7d..95187a1ec 100644 --- a/test/valid-data/string-literals-intrinsic/main.ts +++ b/test/valid-data/string-literals-intrinsic/main.ts @@ -4,6 +4,7 @@ type ResultUpper = Uppercase; type ResultLower = Lowercase; type ResultCapitalize = Capitalize; type ResultUncapitalize = Uncapitalize; +type ResultNoInfer = NoInfer; export interface MyObject { result: Result; @@ -11,4 +12,5 @@ export interface MyObject { resultLower: ResultLower; resultCapitalize: ResultCapitalize; resultUncapitalize: ResultUncapitalize; + resultNoInfer: ResultNoInfer; } diff --git a/test/valid-data/string-literals-intrinsic/schema.json b/test/valid-data/string-literals-intrinsic/schema.json index 724f98802..e75ab5f7f 100644 --- a/test/valid-data/string-literals-intrinsic/schema.json +++ b/test/valid-data/string-literals-intrinsic/schema.json @@ -49,6 +49,15 @@ "SUCCESS" ], "type": "string" + }, + "resultNoInfer": { + "enum": [ + "ok", + "fail", + "ABORT", + "Success" + ], + "type": "string" } }, "required": [ @@ -56,7 +65,8 @@ "resultUpper", "resultLower", "resultCapitalize", - "resultUncapitalize" + "resultUncapitalize", + "resultNoInfer" ], "type": "object" }