Use passTemplate wire key + add Pass.patch (partial update)#6
Merged
Conversation
added 2 commits
June 6, 2026 17:14
Send passTemplate request param and deserialize the passTemplate response field on Pass; expose it via getPassTemplate(). Aligns the client with the API contract standardizing on passTemplate. Leaves PassTemplate.passTypeId (Apple/Google id) untouched.
Adds a static patch() for partial updates so a single field can be changed without a full payload (put stays a full replace). Java's HttpURLConnection cannot send PATCH, so patch posts with the server's _method=PATCH override.
Owner
Author
|
Updated: adds |
Tests hit api.passninja.com directly, so they errored without live creds/network. Add a JDK HttpServer mock (no new dependency) and a passninja.apiBaseUrl system-property override so the suite runs offline and deterministically.
Owner
Author
|
Also fixed the test suite: it made real calls to api.passninja.com (erroring without live creds/network). Added a JDK |
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.
What
Switch to the
passTemplatewire key, matching the API contract that is standardizing onpassTemplate(away from the legacypassType).Changes
model/Pass.javapassTemplateparam.@JsonPropertyispassTemplate; accessor renamedgetPassType()→getPassTemplate();toString()updated.README.mdupdated togetPassTemplate().Untouched on purpose:
PassTemplate.passTypeId/pass_type_id— that is the Apple/Google pass type identifier, a different field.passType) — only the wire key and public accessor change.Compatibility
The API accepts both
passTemplateandpassTypeon input and echoes back whichever key the caller sends, so sendingpassTemplatereturnspassTemplate.