fix: Align SDK endpoints and tests with OpenAPI spec #47
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.
Multiple Socket SDK endpoints were not properly aligned with the OpenAPI specification, causing unit tests to fail and incorrect API behavior. The PURL endpoint deduplication logic was grouping by
batchIndex
instead ofinputPurl
, causing different packages with the same batch index to be incorrectly merged into a single result.Root Cause
Deduplication Logic: The
Dedupe.dedupe()
function was usingbatchIndex
for grouping packages instead ofinputPurl
, which caused different packages that happened to have the same batch index to be merged together incorrectly.API Specification Misalignment: Several SDK endpoints had incorrect URL paths, HTTP methods, and response handling that didn't match the actual OpenAPI specification, leading to failed API calls and incorrect behavior.
Missing Functionality: Some endpoints were missing methods (like
apitokens.list()
) and parameters (likebase_path
for file uploads) that are available in the API.Fix
Fixed Deduplication Logic: Updated
Dedupe.dedupe()
to always group byinputPurl
instead ofbatchIndex
, ensuring different packages remain separate even if they share the same batch index. Maintained backward compatibility by keeping thebatched
parameter but ignoring its value.Aligned API Endpoints: Updated multiple endpoints to match OpenAPI specifications:
apitokens.list()
and enhanced parameter handlingEnhanced File Upload Support: Added
base_path
parameter to file upload methods for cleaner file organization and better key naming in multipart uploads.Comprehensive Test Updates: Updated all unit tests to reflect correct API behavior and added proper mocking for 40+ endpoints.
Public Changelog
inputPurl
instead ofbatchIndex
, ensuring different packages remain separate in resultsbase_path
parameter support in file upload methods for cleaner file organizationapitokens.list()
method for retrieving organization API tokens