fix(adms): align API surface with live ADMS wire format#192
Open
ShiwaliKusum wants to merge 3 commits into
Open
fix(adms): align API surface with live ADMS wire format#192ShiwaliKusum wants to merge 3 commits into
ShiwaliKusum wants to merge 3 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. |
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.
Summary
MimeTypePolicyfrom public exports (class was renamed toFileExtensionPolicy)FileExtensionPolicyentity set path toDocumentTypeFileExtensionPolicyto match server wire formatget_file_extension_policyby UUID;delete_file_extension_policynow uses composite key (DocumentTypeID+FileExtension)build_doctype_botype_map_key_pathto use composite key (DocumentTypeID+BusinessObjectNodeTypeUniqueID) instead of single UUIDget_type_mapping/delete_type_mapping/mark_defaultsignatures accordinglydoc_content_version_idoptional inget_download_url(omit parentheses content whenNone)update_document; return partial response fromUpdateDocumentaction directlyX-SubaccountIdheader casingadms_cli.pywith full-upload (rfu) command and fixes validated against live tenantTest plan
uv run python scripts/adms_cli.pystarts withoutImportErrorrfucommand creates a document relation, generates upload URL, PUTs file bytes, and completes successfullyget_all_file_extension_policieshitsDocumentTypeFileExtensionPolicyendpointget_type_mapping/delete_type_mappinguse composite key pathget_download_urlwithoutdoc_content_version_idomits version parameter from URL