-
Notifications
You must be signed in to change notification settings - Fork 11
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
"(giant block of JSON) has non-unique elements" validation error should be better presented #1220
Comments
@Bjwebb is it fairly straightforward to remove the giant block of JSON and give some sort of meaningful feedback on where the error is so that the user can track it down? |
I'm having a look at this to see what we can easily do. @duncandewhurst can you share the data that had this issue? (cove link has expired) |
Looking into this, we already overwrite the We can check OCIDs instead, if we know it's a record*. This should also speed up validation of records in CoVE, because checking the OCIDs for uniqueness is quicker than checking the whole record (see #155). . * From the validation function, the context we have is a bit limited (the key {'description': 'The records for this data package.', 'type': 'array', 'minItems': 1, 'items': {'$ref': '#/definitions/record'}, 'uniqueItems': True} So, we can check this is about records using the |
Additionally, for the case where ids/ocids are missing, we fallback to the message "Array has non-unique elements" This ensures we don't get a block of python repr data in the error message: OpenDataServices/cove#1220
Additionally, for the case where ids/ocids are missing, we fallback to the message "Array has non-unique elements" This ensures we don't get a block of python repr data in the error message: OpenDataServices/cove#1220 There's also been a change of case from "Non-unique ID Values" to "Non-unique id values".
There's a lib-cove PR for this now: OpenDataServices/lib-cove#35 Here's what it looks like in CoVE [link]: There's a new message for arrays missing ids/ocids too [link]: There's also been a change of case from "Non-unique ID Values" to "Non-unique id values", as this seems more consistent with what we're doing elsewhere: [link]: |
Thanks @Bjwebb, this looks good to me! |
Added 2019-09-10 by @Bjwebb:
In #895 (comment) @duncandewhurst wrote:
The text was updated successfully, but these errors were encountered: