-
Notifications
You must be signed in to change notification settings - Fork 13
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
Attempt to add an affiliation for a newly added contributor results in web ui error #2150
Comments
A newly created contributor doesn't have any When I open the Turing contributor in the meditor then click on the plus button for affiliations, I get a console error reporting that @mvandenburgh, could you confirm my reasoning? If I'm right, then updating the schema to have |
This is correct. To verify, I manually modified the schema and pointed my local dev instance at it, and it fixed this issue. |
In dandischema we have Optional[list]. That's legit. Defaulting to None is legit for Optional. There is a good number of such elements of type array and default null in the jsonschema, not just "affiliation", so fixing for it alone makes little sense to me. According to above discussion it is valid (RECOMMENDED is not MUST) as far as jsonschema concerned, and such records do pass jsonschema validation, right? If it was not - pydantic export to jsonschema had to be fixed up, but I don't think that is the case here. So, where is the bug then really which is to be fixed in code? The vue UI library? |
You're right, @yarikoptic, If instead we want to keep the type as-is, we'll have to see what we can do in the client. But the error in the meditor occurs inside the framework code, so we'll essentially need to work around the issue in some way. The reason I don't really love that approach is that we would be implicitly treating the Let me know what you'd like to do here. (And in case you're unaware, there's a parallel discussion happening over at dandi/dandi-schema#282 (comment).) |
There may be another way around this without changing the type or the default value of The generation of JSON schemas for "affiliation": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Affiliation"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "An organization that this person is affiliated with.",
"nskey": "schema",
"title": "Affiliation"
} This standard generation doesn't have the default value and type disagreement issue. Be aware that if the customized function is removed. All JSON schema generation of |
There is indeed no semantic difference and ambiguity as two different values provide the same semantic. My point is that if we were to address it as changing to @candleindark thanks for digging that up. In my view, it just brings us back to us detecting some shortcoming of UI and providing a workaround instead of a proper solution. So, it seems we are making yet another circle to the same problem. IMHO it would be better both short and long term to (at last) address this issue properly by consulting with upstream. How difficult would be to construct minimal demonstration of the issue for both definitions? Related, we pin/use
There was v3.0.0 in Nov, 2024 "Vjsf 3 is a complete rewrite of the library compatible with Vue 3 and Vuetify 3.". And we have fresh (thanks @waxlamp !) So overall question is -- may be that version already addressed it and proper solution for us is really migration to Vue 3 + vjsf 3 ? I guess should be easy to discover if we have minimal reproducer. |
Here's a codepen that demonstrates the VJSF 2 issue. Note that the top level value is an array, and clicking on the plus button causes the same error as we're seeing in the meditor. If you remove line 6 (or change the default value to I don't think there's any simple workaround for this. The reason we haven't run into the problem before is that we seem to populate most instances of these list-valued metadata items with
Mike and I just looked into this and it turns out that yes, VJSF 3 does solve this problem. So to solve this problem, we can just wait for the Vue 3 upgrade to happen (Mike will have some news about this at Monday's meeting).
It seems we agree 😄 Upgrading to Vue3 should solve the immediate issue, but I think we should still talk about "fixing" the typing problem in our schema. Just to reiterate: list-valued items should not be |
happening on https://dandiarchive.org/dandiset/000029/draft which you are welcome to torture directly - it is a test one
The text was updated successfully, but these errors were encountered: