feat(investment): add issueDate, purchaseDate, issuerCNPJ fields#82
Open
Gabrielpanga wants to merge 1 commit into
Open
feat(investment): add issueDate, purchaseDate, issuerCNPJ fields#82Gabrielpanga wants to merge 1 commit into
Gabrielpanga wants to merge 1 commit into
Conversation
The Pluggy API returns three Investment fields the DTO does not map. Under Gson's FieldNamingPolicy.IDENTITY, Java field names must match the API JSON keys byte-for-byte, so unmapped/misnamed fields are silently dropped to null. - issueDate: the existing `issuerDate` field is a misnaming (extra `r`) with no matching API key, so it was always null. Added the correct `issueDate` and marked `issuerDate` @deprecated (kept for backward compatibility). - purchaseDate: was not mapped. - issuerCNPJ: was not mapped (casing verified against api.pluggy.ai/oas3.json, CNPJ is upper-case in the spec). issueDate/purchaseDate are date-time strings -> Date, matching the existing `date`/`dueDate` mapping; issuerCNPJ is a string.
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.
Problem
The Pluggy API returns three
Investmentfields that the DTO does not map. The SDK uses GsonFieldNamingPolicy.IDENTITY, so a Java field name must match the API JSON key byte-for-byte — unmapped or misnamed fields silently resolve tonull.issueDateissuerDate(extrar)nullpurchaseDatenullissuerCNPJnullChange
issueDate(Date),purchaseDate(Date),issuerCNPJ(String).issuerDatebut mark it@Deprecated, pointing toissueDate— no breaking change for existing consumers.Casing / types verified against the spec
Checked
api.pluggy.ai/oas3.json→components.schemas.Investment.properties:issueDate:string/date-time→DatepurchaseDate:string/date-time→DateissuerCNPJ:string(CNPJ upper-case in the spec) →StringissueDate/purchaseDateuseDateto match the existingdate/dueDate/issuerDatemapping.Verification
mvn -B package→ BUILD SUCCESS, 4/4 unit tests pass.