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
DSP-740 Update List Name #1727
DSP-740 Update List Name #1727
Conversation
...rc/main/scala/org/knora/webapi/messages/admin/responder/listsmessages/ListsMessagesADM.scala
Outdated
Show resolved
Hide resolved
...rc/main/scala/org/knora/webapi/messages/admin/responder/listsmessages/ListsMessagesADM.scala
Outdated
Show resolved
Hide resolved
labels: Seq[StringLiteralV2], | ||
comments: Seq[StringLiteralV2]) extends ListADMJsonProtocol { | ||
name: Option[String] = None, | ||
labels: Option[Seq[StringLiteralV2]] = None, |
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.
If I understand correctly, the reason for the Option
is that if you submit an empty list, it should remove all labels. Is that right? If so, could you add a test for that?
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.
no, if you submit labels=[]
it will return a BedRequestException
. At the time being, the idea is that the update route should not be used to delete the properties. This will change later.
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.
So why use Option
?
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.
because without it, the user needs to repeat the labels and comments in the payload even if she wants to only change the name
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.
So when labels
and comments
are optional, user can simply use the following request body to update only the name
of the list without having to give/repeat the values of labels
and comments
{
"listIri": "listIri",
"projectIri": "someprojectiri",
"name": "another name"
}
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, I understand, thanks.
@benjamingeer I just added your points about making the checks clear. Also, the test data is added. |
@SepidehAlassi could you add the fixed to the docs for PR #1724 in this PR? Also, just found about it yesterday myself. We actually have developer guidelines regarding the naming of PRs: https://docs.dasch.swiss/developers/dsp/contribution/#pull-request-guidelines |
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.
Looks good, thank you!
Done! :-) |
Thank you for reviewing this. |
@benjamingeer the update of |
Yes please! |
resolves DSP-740
also
closes #1520 and closes #1528
Note: This does not break JS-lib but Knora-py.