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

Fix for XML not updating when blank or nil values are sent via JSON using REST API #1307

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

codycooperross
Copy link
Contributor

@codycooperross codycooperross commented Jan 7, 2025

Purpose

closes: datacite/datacite#2264

Approach

The read_attrs method was only used in one place to detect when @params 1) contains no values except xml or 2) contains values that might initiate XML regeneration, then using that condition to set the regenerate parameter. This PR rewrites that method to detect any changes, including blank or nil values, anywhere in the metadata-related values of the @params aside from schemaVersion, which is set earlier in the cleanse method and thus always has a value.

Open Questions and Pre-Merge TODOs

Learning

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@codycooperross codycooperross requested a review from a team January 7, 2025 21:48
@codycooperross codycooperross removed the request for review from a team January 7, 2025 21:54
@codycooperross codycooperross requested a review from a team January 7, 2025 22:39
@svogt0511 svogt0511 self-requested a review January 10, 2025 21:35
@codycooperross codycooperross merged commit 6accc8f into master Jan 10, 2025
19 checks passed
@codycooperross codycooperross deleted the blank-value-fix branch January 10, 2025 21:40
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.

XML may not be updated if a DOI record is updated with nil or blank JSON attributes using the REST API
3 participants