feat(pinning): add WithFilterMatch for spec-compliant name search - #102
Merged
Conversation
…search ListPins exposed only WithFilterName (exact match by default), so callers could not request the IPFS Pinning Services API's match query param for substring name search (match=partial). Add WithFilterMatch(strategy) threading the TextMatchingStrategy enum through ListOption into GetPinsParams.Match, which the generated client already serializes as the match query param. End-to-end test asserts name + match=partial are actually sent on the wire; option tests cover the full exact/iexact/partial/ipartial enum.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Coverage ReportTotal Coverage: 11.2% Generated from commit: 81c3cdc |
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.
Adds a WithFilterMatch option to ListPins so callers can request substring name search (match=partial) per the IPFS Pinning Services API TextMatchingStrategy.
ListPins exposed only WithFilterName, which defaults to an exact name match. The spec's name filter supports a match query param (exact, iexact, partial, ipartial) where partial matches anywhere in the name. The generated pinning client already serializes GetPinsParams.Match into the match query param, but ListPins dropped it and there was no public option to set it.
Changes:
End-to-end test asserts name + match=partial are sent together on the wire; option tests cover the full exact/iexact/partial/ipartial enum. All tests pass.
This pull request adds support for the IPFS Pinning Services API's
TextMatchingStrategyparameter when searching and listing pinned items by name.Key Changes:
New function
WithFilterMatch: Added a new list option function that allows specifying a text matching strategy (exact, iexact, partial, or ipartial) to be used in combination with the existingWithFilterNamefilter. This enables clients to perform substring matching anywhere in pin names, per the IPFS Pinning Services API specification.API parameter propagation: Updated the
ListPinsmethod to send thematchquery parameter to the server when a matching strategy is specified, complementing the existingnameparameter. This ensures the matching strategy is properly transmitted to the pinning service.Zero-value behavior: When no matching strategy is set (empty value), the parameter is not sent, preserving backward compatibility with existing behavior.
Tests Added:
WithFilterMatchcorrectly sets all four supported matching strategies (exact, iexact, partial, ipartial).WithFilterNameis combined withWithFilterMatch(Partial), both thenameandmatch=partialquery parameters are correctly sent to the server, enabling substring-based pin searches.