Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(value): make impossible to set list root node as a value (DEV-973) #2088
fix(value): make impossible to set list root node as a value (DEV-973) #2088
Changes from 4 commits
d1c775b
29998c3
8455366
748feb1
5953676
6176715
eeafd44
eae72df
4b16ae0
35eac06
b74ee41
58b4551
d14daa9
db58026
fb35176
388f4a8
0ce84d9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check seems to be request specific. Did you check if
fromJsonLDObject
should never allow a root node?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get your question. In the case of list values, yes it shouldn't be allowed a root node as value. That's actually the clue of this bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, than that's fine. I thought there might be cases where the value can be a root node (although I don't know what cases there could be).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, that this check is implemented in the correct place. It should be probably better to move it to here:
dsp-api/webapi/src/main/scala/org/knora/webapi/responders/v2/ValuesResponderV2.scala
Lines 195 to 201 in 3a0902e
This way, you will also be able to write the missing tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subotic Good point, moved checking method to
ResourceUtilV2
and added test toValuesResponderV2Spec
.