-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
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
Any way to support multi ? #38
Comments
Hello, sorry for the late response. @Schema({ strict: true })
class Test {
@Field({
type: "multi",
rules: [
{ type: "boolean" },
{ type: "number" }
], default: true
})
public prop!: boolean | number;
} |
Oh great ! I miss Field wich can in fact allow all types ... interesting . I will try :) |
I will soon add the @multi decorator, which can be used in two ways: @Schema({
async: true,
})
class Test {
@String()
@Number()
@Boolean()
name!: string | number | boolean;
} and @Schema({
async: true,
})
class Test {
@Multi({
rules: [
{ type: "string" },
{ type: "number" },
{ type: "boolean" },
],
})
name!: string | number | boolean;
} Bot translate to a multi property.
|
@AmauryD great ! I will wait for the next release :) . This is totally out of this topic, but, can you open the options in Schema ? ( to allow custom metas ? icebob/fastest-validator#341 ) ( if you work on this project, it's maybe not too much work to add this ? else, I can try to do a PR ) |
I can allow unknown keys in @Schema decorators. If that's what you mean. The types will follow when your PR is merged upstream. |
I didn't have another use case with multi at the moment . But field works great, so I will close this issue . Thank you |
Hello, is there a way to use multi from fastest-validator ? (search return nothing, so I think no) .
The text was updated successfully, but these errors were encountered: