Repository navigation
feat(api): serve every API path under /api/v1 and deprecate the unversioned paths - #9995
Merged
Merged
Conversation
…sioned paths ApiPathAliases adds an /api/v1/ alias of every unversioned API route and resource to routes.php, after the originals so their precedence stays. Versioned routes and standard protocol paths get none. files/multipart is the new name of filesMultipart, which keeps working. UnversionedPathDeprecationMiddleware adds the RFC 9745 Deprecation header and a successor-version Link to responses on the unversioned paths. The root OpenAPI document names /api/v1 in its server URL and lists each unversioned path as a deprecated twin. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
marked this pull request as draft
November 12, 2026 12:03
Assisted-by: ClaudeCode:claude-opus-5-5
The old path still answers with the Deprecation and successor Link headers; the document now passes the kebab-case path rule. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
marked this pull request as ready for review
November 12, 2026 15:13
This was referenced Nov 12, 2026
Assisted-by: ClaudeCode:claude-opus-5-5
… their v1 aliases in tests The deprecation middleware no longer overwrites a Deprecation or Link header a controller already set, so the favourite and available-actions responses keep naming their own successor. Route tests that pin one route per name read the declared routes without the /api/v1 aliases, and the multipart upload follows main's files-multipart name. Assisted-by: ClaudeCode:claude-opus-5-5
This was referenced Nov 12, 2026
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ❌ | ||||
| psalm | ❌ | ||||
| phpstan | ❌ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ❌ | ||||
| test-l10n-parity | ❌ | ||||
| format | ❌ | ||||
| check-schema-l10n | ✅ | ||||
| test-newman-route-ratchet | ❌ | ||||
| composer | ✅ | ✅ 169/169 | |||
| npm | ✅ | ✅ 639/639 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ 57637/57862 · 27 skipped (worst of 5 legs: PHP 8.3, NC stable32, pgsql; counts from 5 of 8 legs) | ||||
| Newman | ❌ | ||||
| Playwright | ❌ 332/383 · 5 skipped · 106 did not run | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-11-15 04:03 UTC
Download the full PDF report from the workflow artifacts.
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.
What this changes
Every OpenRegister API path is now served under
/api/v1/as well as at its unversioned path. The unversioned paths keep working and are deprecated./api/<path>is also served as/api/v1/<path>, with the same controller, requirements and defaults.ApiPathAliases::withVersionedAliases()wraps the declaration inappinfo/routes.php, so a new route gets its alias without anyone writing it: 1,023 aliases today, 45 of them for the nine resources. The aliases come after the original routes, and no unversioned route can match an/api/v1/path (a test checks that no route starts with/api/{), so the precedence of the originals does not change./api/v2/audit,/api/mcp/v1/...) or for standard protocol paths (StandardProtocolPaths: MCP, GraphQL, WFS, iCalendar feeds, metrics, health, federation).files/multipart.POST /api/objects/{register}/{schema}/{id}/files/multipartis the new name offilesMultipart. The old path keeps working and gets no/api/v1/alias of its own; its successor is/api/v1/.../files/multipart.UnversionedPathDeprecationMiddlewareaddsDeprecation: @1794441600(RFC 9745, 12 November 2026) andLink: </index.php/apps/openregister/api/v1/...>; rel="successor-version"to responses on the unversioned paths. It only decorates. It is registered afterApiVersionMiddleware, so a deprecated contract version's ownDeprecationandLinkheaders win. NoSunsetdate is set, because none has been decided.https://{host}/index.php/apps/openregister/api/v1. Each unversioned path is listed as a deprecated twin (/api/...with a path-level server,deprecated: trueand a description naming the successor). The oldfilesMultipartspelling is not listed: it still answers, with the sameDeprecationandLinkheaders, but its camelCase breaks the kebab-case path rule. A test keeps the twins in step with the versioned paths and checks thatfilesMultipartstays out.docs/features/api-generation.md("Versioned paths") and as REQ-OAS-PATH-001 inopenspec/specs/openapi-generation/spec.md.Spectral, NL API Design Rules ruleset
npx @stoplight/spectral-cli lint openapi.json --ruleset https://static.developer.overheid.nl/adr/ruleset.yamlinclude-major-version-in-uriis gone, and the lastpaths-kebab-casewent with thefilesMultiparttwin.The Common Ground checker's local scan (
npm run scan:local, rubenvdlinde/CommonGroundChecker#3) agrees on this branch with--register --api-spec openapi.json:openapiandadrvalidator(API Design Rules) both pass, score 90.Stacking
Stacked on #9985 (problem details), which is in turn built on
fix/openapi-api-design-rules. Both PRs use the sameStandardProtocolPathslist. Merge in that order. origin/main is merged in (no rebase).Tests
ApiPathAliasesTest(successors, alias generation, and the shippedroutes.php: every unversioned API route has an alias with the same requirements and defaults, no alias reuses a route name,filesMultiparthas no v1 alias),UnversionedPathDeprecationMiddlewareTest,MiddlewareRegistrarTest(new order) andOpenApiControllerTest::testUnversionedPathsAreDeprecatedTwins. They fail on main: the classes do not exist there and the document has no/api/v1server.Verified locally
hydra/scripts/diff-check.sh --base origin/main --gates-timeout 1500with the floor compare, on a fresh clone of this branch: units, floor, php -l, phpstan and the touched PHPUnit tests pass. The one NEW phpcs finding (line length of the newfiles/multipartroute) is fixed. Gate 67 (contract parity) fails onlib/Contract/EmailLinkReaderInterface.phpandObjectServiceInterface.php, which this branch does not touch: inherited from main. phpcs reports 256 inherited line-length findings inappinfo/routes.php, on lines this branch does not touch.WriteRoutesRequireRequestTokenTestpass (47 tests, 4,952 assertions). php -l and phpcs on the edited files are clean.composer check:strict. The integrator runs it.Not in this PR
filesMultipartinsrc/mail-sidebar/components/ObjectsTab.vue, so its own calls now carry aDeprecationheader. Moving the frontend to/api/v1/belongs in a separate PR.Assumptions
/api/v1/" read as:/api/v1/is the new canonical form (that is what theinclude-major-version-in-urirule asks for), and the existing unversioned paths stay as deprecated aliases.AI assistance: drafted with Claude Code (claude-opus-5-5) and reviewed before submission.