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

RESTWS-940: PersonAttributeResource should not try to hydrate the attribute itself #611

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

ibacher
Copy link
Member

@ibacher ibacher commented Jun 10, 2024

Description of what I changed

Previously, PersonAttributeResource1_8#getDisplayString() had two different formats:

  1. For attributes without an attribute type, an empty string
  2. For concepts, the concept display string
  3. For anything else, AttributeType = <AttributeValue>; e.g., Current Location = 4

This PR ensures that getDisplayString() continues to work like 1 and 2 above, but replaces 3 with something more similar to 2, that is, the display string for the value. This means that in the Current Location example above, getDisplayString() would return a string like "Ward 3".

The AttributeType name can be fetched via a custom display, and the raw value can be read via the value property. Nevertheless, this is technically a breaking change.

Issue I worked on

see https://issues.openmrs.org/browse/RESTWS-940

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.

    No? Unsure? -> configure your IDE, format the code and add the changes with git add . && git commit --amend

  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)

    No? -> write tests and add them to this commit git add . && git commit --amend

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

    No? -> execute above command

  • All new and existing tests passed.

    No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.

  • My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@coveralls
Copy link

Coverage Status

coverage: 47.118% (-0.008%) from 47.126%
when pulling e4e37d3 on RESTWS-940
into 6bd939a on master.

@ibacher ibacher merged commit 14e6f5b into master Jun 10, 2024
1 check passed
@ibacher ibacher deleted the RESTWS-940 branch June 10, 2024 17:12
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.

2 participants