fix(adms): align API surface with live ADMS wire format#192
Open
ShiwaliKusum wants to merge 5 commits into
Open
fix(adms): align API surface with live ADMS wire format#192ShiwaliKusum wants to merge 5 commits into
ShiwaliKusum wants to merge 5 commits into
Conversation
Mirrors cloud-sdk-java contrib-java/adms commit e5dd1da's wire-format
audit. The Java audit identified 12 fixes against the canonical CDS
sources + live ADMS tenant. Cross-verified Python state vs CDS:
- 7 fixes were already correct in Python (UpdateDocumentInput fields,
RestoreContentVersion envelope, DeleteContentVersion body shape,
DownloadDocument GET function, StartJob payload, JobStatus function,
LateHostBusinessObjectNodeID casing).
- 5 namespace-prefix fixes were genuinely missing (lock, unlock,
complete_multipart_upload, generate_upload_urls, mark_default) —
Python used the short form which CAP accepts leniently but is not
the canonical OData V4 wire format.
For cross-SDK consistency with Java, ALL 12 bound/unbound action paths
now use the fully-qualified com.sap.adm.{DocumentService,AdminService,
ConfigurationService}.X form:
DocumentService bound actions on DocumentRelation:
UpdateDocument, CompleteMultipartUpload,
RestoreDocumentContentVersion, DeleteDocumentContentVersion,
LockDocumentAndRelation, UnlockDocumentAndRelation,
GenerateDocumentUploadURLs, DownloadDocument (function)
DocumentService unbound:
StartJob, JobStatus (function)
AdminService unbound:
StartJob, JobStatus (function)
ConfigurationService bound on DocumentTypeBusinessObjectTypeMap:
markDefault
Test changes:
- Tightened 7 substring assertions in test_client.py to include the
namespace prefix so the wire contract is captured in tests.
Also includes prior work on this branch:
- extra_headers support on sync + async HTTP verbs (for x-subaccount-id
header on ApplicationTenant operations)
- subaccount_id parameter on all 4 ApplicationTenant config methods
No API surface changes, no model changes, no behavioural changes —
purely wire-protocol alignment with Java commit e5dd1da.
Interactive CLI for testing all ADMS APIs against a real ADM instance. Used during this PR's development to verify each of the 12 wire-format fixes returns the expected response from the live tenant. WILL BE REMOVED BEFORE MERGE — kept in this PR only as a debugging aid so reviewers can reproduce the live-tenant verification if desired. Usage: set -a && source .env.adms && set +a .venv/bin/python scripts/adms_cli.py
- Remove MimeTypePolicy from __init__.py (renamed to FileExtensionPolicy in _models.py) - Rename FileExtensionPolicy entity set to DocumentTypeFileExtensionPolicy - Drop get_file_extension_policy by UUID; delete now uses composite key (DocumentTypeID + FileExtension) - Fix build_doctype_botype_map_key_path to use composite key (DocumentTypeID + BusinessObjectNodeTypeUniqueID) - Update get_type_mapping / delete_type_mapping / mark_default to accept composite key params - Make doc_content_version_id optional in get_download_url (omit parentheses content when None) - Drop post-update GET in update_document; return partial response from UpdateDocument action directly - Fix X-SubaccountId header casing - Align job API namespace constants with canonical server wire format - Expand adms_cli.py with rfu (full upload) command and additional fixes from live tenant testing
|
I766515 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
NicoleMGomes
reviewed
Jul 1, 2026
NicoleMGomes
reviewed
Jul 1, 2026
Contributor
|
PR description is not following our template. Only raise PRs to us once it's complete. |
added 2 commits
July 2, 2026 09:21
…lt type mapping The ADM DocumentTypeBusinessObjectTypeMap entity uses a composite key (DocumentTypeID + BusinessObjectNodeTypeUniqueID). The previous single-argument signature used a fabricated DocumentTypeBOTypeMapID that was never accepted by the service (HTTP 400), so this signature change is a bug-fix, not a breaking API change. Added note in docstrings to clarify.
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.
Description
Aligns the ADMS Python SDK API surface with the live ADM service wire format. Several entity paths, key structures, and method signatures were incorrect — they compiled but failed at runtime (HTTP 400/404) against the real service.
Configuration API fixes:
DocumentTypeBusinessObjectTypeMapuses a composite key (DocumentTypeID+BusinessObjectNodeTypeUniqueID), not a single UUID.get_type_mapping,delete_type_mapping, andmark_defaultupdated accordingly.FileExtensionPolicyentity set renamed fromFileExtensionPolicytoDocumentTypeFileExtensionPolicy(matches$metadata). Model fields corrected toDocumentTypeID+FileExtensioncomposite key;get_file_extension_policy(uuid)removed as no such UUID key exists in ADM.CreateDocumentTypeBoTypeMapInputwire field names corrected fromDocumentTypeId/BusinessObjectNodeTypeUniqueIdtoDocumentTypeID/BusinessObjectNodeTypeUniqueID.MimeTypePolicyremoved from public__init__exports (no longer referenced by any public model).Document API fixes:
update()(sync + async): removed the implicit follow-up GET — theUpdateDocumentaction returns the partial response directly from ADM; callers who need the full document should callget()explicitly.get_download_url()(sync + async):doc_content_version_idis now optional (None→DownloadDocument()for latest version), matching the ODataCore.OptionalParameterannotation.Job API fixes:
StartJobandJobStatuscalled without namespace prefix (unbound action/function imports do not use namespace prefix per OData spec).Related Issue
Closes #https://jira.tools.sap/browse/RBSADMS-47
Type of Change
How to Test
set -a && source .env.adms && set +auv run pytest tests/adms/unit/ -vuv run pytest tests/adms/integration/ -vcfl,cmg,cmd,cgf,jz,jscommands work against the live tenant usingscripts/adms_cli.pyChecklist
Breaking Changes
get_type_mappinganddelete_type_mappingnow require two arguments (document_type_id,business_object_node_type_unique_id) instead of one. However, the previous single-argument version accepted aDocumentTypeBOTypeMapIDthat the ADM service never supported — every call returned HTTP 400. Since the old signature was non-functional, this is treated as a bug fix rather than a breaking API change.get_file_extension_policy(uuid)is removed. The ADM entity has no UUID primary key; policies are identified by(DocumentTypeID, FileExtension). The old method would have always returned HTTP 404.update()no longer performs an implicit GET after updating a document. The return value is now the partial action response from ADM (only changed fields). Callers requiring the full document after an update should calldocuments.get()explicitly.Additional Notes
All fixes were validated against a live ADM playground tenant. The
scripts/adms_cli.pyinteractive CLI (kept locally, not included in this PR) was used for end-to-end verification of each endpoint.