Skip to content
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

feat(api-v2): Accept custom new value IRI when updating value #1698

Merged
merged 6 commits into from Sep 8, 2020

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Sep 4, 2020

https://dasch.myjetbrains.com/youtrack/issue/DSP-543

  • Accept a custom new value IRI when updating a value.
  • Require custom value IRIs to have the correct format.
  • Require custom resource IRIs to have the correct format.
  • Add tests and clarify some existing tests.
  • Add docs.

@benjamingeer benjamingeer self-assigned this Sep 4, 2020
@benjamingeer benjamingeer marked this pull request as draft September 4, 2020 08:29
Benjamin Geer added 2 commits September 7, 2020 12:02
@benjamingeer benjamingeer marked this pull request as ready for review September 7, 2020 11:26
@benjamingeer benjamingeer added API/V2 enhancement improve existing code or new feature labels Sep 8, 2020
Copy link
Contributor

@SepidehAlassi SepidehAlassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is great, thanks for this.

* @param resourceID the ID of the containing resource.
* @return the validated IRI.
*/
def validateCustomValueIri(customValueIri: SmartIri, projectCode: String, resourceID: String): SmartIri = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding the validation of custom resource and value IRIs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

intValueAsInt should ===(intValue)
}

"not update an integer value with a custom new value version IRI that is the same as the current IRI" in {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in another PR, we can think about making these parameter validation tests unit tests in messages instead of e2e ones. We are trying to do so in admin API currently because e2e tests are expensive.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

@benjamingeer
Copy link
Author

Thanks for the review!

@benjamingeer benjamingeer merged commit 4d8f867 into develop Sep 8, 2020
@benjamingeer benjamingeer deleted the wip/DSP-543-update-value branch September 8, 2020 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API/V2 enhancement improve existing code or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants