Skip to content

fix: Restrict coding schemes of ADE to valid coding schemes#22981

Closed
jason-p-pickering wants to merge 4 commits intomasterfrom
DHIS2-20941
Closed

fix: Restrict coding schemes of ADE to valid coding schemes#22981
jason-p-pickering wants to merge 4 commits intomasterfrom
DHIS2-20941

Conversation

@jason-p-pickering
Copy link
Contributor

@jason-p-pickering jason-p-pickering commented Feb 17, 2026

Fixes https://dhis2.atlassian.net/browse/DHIS2-20941

Coding schemes of ADE requests/exchanges could be set to any string. Here we restrict them to valid coding schemes:

  1. UID
  2. CODE
  3. ATTRIBUTE:UID
  4. NULL (implied UID). Not possible through the UI.

Case sensitivity is not considered as either case can be valid.

@jason-p-pickering jason-p-pickering requested a review from a team February 17, 2026 14:58
@sonarqubecloud
Copy link

Copy link
Contributor

@jbee jbee left a comment

Choose a reason for hiding this comment

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

When it comes to simply format validation the best way to go about it is to not use String fields but specific types like UID or in this case there is a new class IdProperty which makes sure the value is proper or an error occurs. ATM the issue we have is that you don't get nice HTTP level responses from it. Usually these low level parsing methods will throw a IllegalArgumentException which I think becomes a generic BAD REQUEST forwarding the message. While this not particularly nice for the user I think we have to avoid writing code for trivial matters like these.

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.

3 participants

Comments