We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum is given:
enum Test { A = 'aaa', B = 'bbb', }
And validated class:
class TestClass { @IsEnum(Test) type: Test; }
Result json schema:
"TestClass": { "properties": { "type": { "enum": [ "A", "B" ], "type": "string" } }, "type": "object", "required": [ "type" ] },
I suppose in result schema enum values should be used, but not keys. However I'm not 100% sure about all cases.
If my assumption is correct, then it can be fixed by changing Object.keys to Object.values here:
Object.keys
Object.values
class-validator-jsonschema/src/defaultConverters.ts
Line 115 in b7bd8be
The text was updated successfully, but these errors were encountered:
You're 100% right, good catch! Published a fix in v1.3.1.
v1.3.1
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Enum is given:
And validated class:
Result json schema:
I suppose in result schema enum values should be used, but not keys. However I'm not 100% sure about all cases.
If my assumption is correct, then it can be fixed by changing
Object.keys
toObject.values
here:class-validator-jsonschema/src/defaultConverters.ts
Line 115 in b7bd8be
The text was updated successfully, but these errors were encountered: