Cocoa-Puffs commented on code in PR #4732:
URL: https://github.com/apache/fineract/pull/4732#discussion_r2123483674
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/InternalProgressiveLoanApiResourceSwagger.java:
##########
@@ -37,7 +37,7 @@ private ProgressiveLoanInterestScheduleModel() {}
@Schema(example = "[]")
public TreeSet<InterestRate> interestRates;
@Schema(example = "{}")
- public Map<Integer, List<LoanTermVariationsData>> loanTermVariations;
+ public Map<Integer, List<InternalLoanTermVariationsData>>
loanTermVariations;
Review Comment:
There is a naming collision in the swagger schema.
**org.apache.fineract.portfolio.loanaccount.service.InternalProgressiveLoanApiResourceSwagger.LoanTermVariationsData
org.apache.fineract.portfolio.loanaccount.rescheduleloan.api.RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse.LoanTermVariationsData**
These two classes, while having different types in certain fields, use the
same name. Our code generator first created the client representation from the
loan term variations data found in the internal api resource. When it was
generating the GetLoanRescheduleRequestResponse, because it already had a
LoanTermVariationsData created, it reused that variation data instead of
building the one found next to that response object. This can cause issues on
the client side, because instead of LocalDate fields the object had String
fields.
As a first try I tried to use the fully qualified name in
**RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse** like so:
`public
Set<org.apache.fineract.portfolio.loanaccount.rescheduleloan.api.RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse.LoanTermVariationsData>
loanTermVariationsData;`
But it didn't work, it still used the other LoanTermVariationsData.
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/InternalProgressiveLoanApiResourceSwagger.java:
##########
@@ -37,7 +37,7 @@ private ProgressiveLoanInterestScheduleModel() {}
@Schema(example = "[]")
public TreeSet<InterestRate> interestRates;
@Schema(example = "{}")
- public Map<Integer, List<LoanTermVariationsData>> loanTermVariations;
+ public Map<Integer, List<InternalLoanTermVariationsData>>
loanTermVariations;
Review Comment:
There is a naming collision in the swagger schema.
**org.apache.fineract.portfolio.loanaccount.service.InternalProgressiveLoanApiResourceSwagger.LoanTermVariationsData**
**org.apache.fineract.portfolio.loanaccount.rescheduleloan.api.RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse.LoanTermVariationsData**
These two classes, while having different types in certain fields, use the
same name. Our code generator first created the client representation from the
loan term variations data found in the internal api resource. When it was
generating the GetLoanRescheduleRequestResponse, because it already had a
LoanTermVariationsData created, it reused that variation data instead of
building the one found next to that response object. This can cause issues on
the client side, because instead of LocalDate fields the object had String
fields.
As a first try I tried to use the fully qualified name in
**RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse** like so:
`public
Set<org.apache.fineract.portfolio.loanaccount.rescheduleloan.api.RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse.LoanTermVariationsData>
loanTermVariationsData;`
But it didn't work, it still used the other LoanTermVariationsData.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]