Skip to content

fix: rewrite dtm spec paths to include /service/dtm prefix at build time#27

Merged
schplitt merged 1 commit into
mainfrom
fix/dtm-service-path-prefix
Jun 2, 2026
Merged

fix: rewrite dtm spec paths to include /service/dtm prefix at build time#27
schplitt merged 1 commit into
mainfrom
fix/dtm-service-path-prefix

Conversation

@schplitt

@schplitt schplitt commented Jun 2, 2026

Copy link
Copy Markdown
Owner

DTM OpenAPI spec paths are relative to the service root (e.g. /assets, /definitions/properties) but the actual Cumulocity endpoints live at /service/dtm/.... Without the prefix the agent would attempt requests against non-existent tenant-root paths and always get 404s.

Add servicePrefix to openapi-builds.json DTM source entries. In tsdown.config.ts, rewriteSpecPaths() rewrites every spec path key and the servers[0].url placeholder at bundle time when a servicePrefix is configured. The core spec has no prefix and is unchanged.

BUNDLED_OPENAPI_OPERATIONS now generates /service/dtm/... patterns so createOpenApiPartRestrictionRules correctly blocks DTM endpoints when DTM is disabled. Update tests to match the new canonical paths.

DTM OpenAPI spec paths are relative to the service root (e.g. /assets,
/definitions/properties) but the actual Cumulocity endpoints live at
/service/dtm/.... Without the prefix the agent would attempt requests
against non-existent tenant-root paths and always get 404s.

Add servicePrefix to openapi-builds.json DTM source entries. In
tsdown.config.ts, rewriteSpecPaths() rewrites every spec path key and
the servers[0].url placeholder at bundle time when a servicePrefix is
configured. The core spec has no prefix and is unchanged.

BUNDLED_OPENAPI_OPERATIONS now generates /service/dtm/... patterns so
createOpenApiPartRestrictionRules correctly blocks DTM endpoints when
DTM is disabled. Update tests to match the new canonical paths.
@schplitt
schplitt merged commit 8920eb4 into main Jun 2, 2026
1 check passed
@schplitt
schplitt deleted the fix/dtm-service-path-prefix branch June 2, 2026 09:22
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.

1 participant