feat(api): add /structure/{type} handlers for all DPM artefact types#71
Merged
Conversation
Wires REST endpoints for the 11 remaining artefact types alongside the existing category and release handlers, following SDMX-style URL grammar (wildcards, ~/+/* release tokens, pagination, allstubs detail). Notable shape decisions: - modules embed children=tables (full shape); tablegroups embed tables and child-group stubs, both release-versioned independently; - contexts use virtual versioning driven by downstream property/item code drift; - operations carry the full nested tree (versions → nodes → operand references → locations) inline; - properties version through ItemCategory rows in the property meta-category and surface enumeration via PropertyCategory. Every endpoint batch-loads its dependents; per-endpoint query-budget tests prevent N+1 regressions. _get_all_releases now sorts NULLs LAST so null-dated releases (e.g. EBA's 26.0.10) don't break the virtual- versioning iteration in _version_at_release. STRUCTURE = "structure" removed from ArtefactType — it was never a real artefact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds REST router wiring and tests for additional /api/v1/structure/{type} artefact endpoints, extending the structure API beyond the existing category/release handlers.
Changes:
- Adds registered handlers for table, tablegroup, module, framework, property, variable, context, operator, operation, datatype, and organisation.
- Adds
references=childrensupport and removes the non-artefactstructureenum value. - Adds broad endpoint, detail, references, empty-result, versioning, and query-budget regression tests.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/dpmcore/server/routers/structure.py |
Registers new structure handlers and updates artefact/reference enums. |
tests/unit/server/test_structure_table.py |
Covers table endpoint payloads, versions, variables, and references. |
tests/unit/server/test_structure_tablegroup.py |
Covers tablegroup hierarchy and children expansion. |
tests/unit/server/test_structure_module.py |
Covers module endpoint, table children, and query budget. |
tests/unit/server/test_structure_framework.py |
Covers framework endpoint and module children filtering. |
tests/unit/server/test_structure_property.py |
Covers property versions, enumerations, and references. |
tests/unit/server/test_structure_variable.py |
Covers variable versions, enumeration, keys, and references. |
tests/unit/server/test_structure_context.py |
Covers virtual context versioning and compositions. |
tests/unit/server/test_structure_operator.py |
Covers unowned operator endpoint and arguments. |
tests/unit/server/test_structure_operation.py |
Covers operation versions, nodes, references, and locations. |
tests/unit/server/test_structure_datatype.py |
Covers datatype hierarchy and children expansion. |
tests/unit/server/test_structure_organisation.py |
Covers organisation filtering and response shape. |
tests/unit/server/test_structure_versioning_regression.py |
Adds release-ordering and per-version enumeration regressions. |
andres-sole
approved these changes
May 27, 2026
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.
Wires REST endpoints for the 11 remaining artefact types alongside the existing category and release handlers, following SDMX-style URL grammar (wildcards, ~/+/* release tokens, pagination, allstubs detail).
Notable shape decisions:
Every endpoint batch-loads its dependents; per-endpoint query-budget tests prevent N+1 regressions. _get_all_releases now sorts NULLs LAST so null-dated releases (e.g. EBA's 26.0.10) don't break the virtual- versioning iteration in _version_at_release. STRUCTURE = "structure" removed from ArtefactType — it was never a real artefact.
Summary
Checklist
ruff format,ruff check,mypy)pytest) with 100% branch coverage (coverage report --fail-under=100)Impact / Risk
Notes