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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide validation for file ids that are not formatted like a URI #4222

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Sep 2, 2022

We should probably merge sul-dlss/sdr-api#494 first or this will trigger a lot.

Why was this change made? 馃

This will allow us to find places where we have non-standard URI creation

How was this change tested? 馃え

CI

This will allow us to find places where we have non-standard URI creation
@justinlittman
Copy link
Contributor

Why not fix the problem and make it cocina validation? It is clearer to have all model validation in a single location.

@jcoyne
Copy link
Contributor Author

jcoyne commented Sep 6, 2022

@justinlittman we use the cocina models in sdr-api that use encoded identifiers, not URIs.

@justinlittman
Copy link
Contributor

Ah, right.

@@ -28,6 +28,10 @@ def generate_or_existing_file_id
"#{ID_NAMESPACE}/file/#{druid}-#{resource_id}/#{file_id}"
end

Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider adding a comment to bring the content of the PR discussion into the code. Something like

# this validation is useful for (e.g. sdr-api that uses) encoded identifiers, not URIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants