-
Notifications
You must be signed in to change notification settings - Fork 556
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
JSON Schema - Uniqueness check on property in an array of objects #1993
Labels
Comments
https://json-schema.org/understanding-json-schema/reference/array.html#uniqueness
That's not how uniqueness works in Jason schema so if using the conversion
feature here it won't be how it works either
…On Fri, Dec 20, 2019, 10:46 AM Rambo ***@***.***> wrote:
*Question*
Is there a way to have a uniqueness check on a property in an array of
objects within an array?
for example:
model: [
{
description: 'Calendars',
id: 'Calendar', // <--- must be unique
type: 'object'
},
{
description: 'A date which can be assigned to a calendar.',
id: 'Date', // <--- must be unique
type: 'object'
}
]
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1993?email_source=notifications&email_token=ADB4XNNZYVJRB2OOIY2BNB3QZTZFLA5CNFSM4J6AHOSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ICAML7Q>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADB4XNO62LLHGFQIZP4URV3QZTZFLANCNFSM4J6AHOSA>
.
|
Ahh okay, can ngx-formly allow custom validation via Json schema? Perhaps I need to do this in my custom array type component and access the model state. 🤔 |
Currently if you'd like to add it you can use the map function to further
change a formly field based on configuration
You can add a key to your base schema to represent it as there will be no
errors in doing that.
…On Fri, Dec 20, 2019, 1:12 PM Rambo ***@***.***> wrote:
Ahh okay, can ngx-formly allow custom validation via Json schema?
Perhaps I need to do this in my custom array type component and access the
model state. 🤔
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1993?email_source=notifications&email_token=ADB4XNICGDSRKDYVNPHUG5DQZUKJJA5CNFSM4J6AHOSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHN35IY#issuecomment-568049315>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADB4XNM36YCYC5DML2LAR5TQZUKJJANCNFSM4J6AHOSA>
.
|
as @kenisteward pointed either use a {
"type": ...,
"widget": {
"formlyConfig": {
"wrappers": ["custom_wrapper"]
validators: {
validation: ['customUniqueValidation'],
},
}
}
} to define a custom validation you may check our demo example https://formly.dev/examples/validation/custom-validation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Question
Is there a way to have a uniqueness check on a property in an array of objects within an array?
for example:
The text was updated successfully, but these errors were encountered: