docs: document period type label and displayLabel [DHIS2-20845] - #1785
Open
karolinelien wants to merge 1 commit into
Open
docs: document period type label and displayLabel [DHIS2-20845]#1785karolinelien wants to merge 1 commit into
karolinelien wants to merge 1 commit into
Conversation
Adds a "Period types" subsection to the Web API introduction chapter, covering GET /api/periodTypes and the new writable `label` property. Documents that `label` is the only writable property, that period types cannot be created or deleted, that the period type is identified by `name` in the request body, and that a label is cleared with an empty string. Notes the ALL authority requirement and the 400 response for an unknown name. Since `displayLabel` currently mirrors `label` and is null when no label is set, the section tells clients to render `displayLabel` and fall back to `displayName`. AI Assisted Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
karolinelien
marked this pull request as ready for review
August 27, 2026 11:05
maikelarabori
approved these changes
Aug 27, 2026
maikelarabori
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Just one minor comment.
Thx!
|
|
||
| To remove a custom label, set `label` to an empty string: | ||
|
|
||
| ```json |
Contributor
There was a problem hiding this comment.
You can also do:
{
"name": "FinancialFeb",
"label": null
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the
label/displayLabelsupport onPeriodTypeadded in 2.43, following up on dhis2/dhis2-releases#261.Adds a
Period typessubsection to the Web API introduction chapter (src/developer/web-api/overview.md), inside the existing Date and period format section and just after the period-format table, since that is where period types are already described. CoversGET /api/periodTypeswith a property table markinglabelas the only writable field, plus aCustom period type labelssubsection with thePUTrequest, the success response, the verify response, and clearing a label with an empty string.Three details were checked against
dhis2-corerather than taken from the release note, and differ from it:isoDuration,frequencyOrder, and so on).PeriodTypeController.putPeriodTypeonly readsgetName()andgetLabel(), so everything else is silently ignored. The docs showname+labelonly.namereturns400 Bad Requestwith the message"<name> does not exist."—DefaultPeriodService.updatePeriodTypeLabelthrowsIllegalArgumentException, whichCrudControllerAdvicemaps tobadRequest. The status was not stated anywhere.displayLabelisnull, notdisplayName, when no label is set —PeriodType.getDisplayLabel()returnslabeldirectly (with aTODOfor the real implementation). The section therefore tells clients to renderdisplayLabeland fall back todisplayName, so apps adoptingdisplayLabelnow do not show blanks.Also documents the
ALLauthority requirement (@RequiresAuthority(anyOf = ALL)).Targets
masteronly. If the 2.43 docs should carry it as well, that is a cherry-pick onto the2.43branch.AI Assisted