DeathGun44 commented on code in PR #6158: URL: https://github.com/apache/fineract/pull/6158#discussion_r3782960027
########## integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/helpers/ClientChargeCommandsApi.java: ########## @@ -0,0 +1,104 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.integrationtests.client.feign.helpers; + +import feign.Headers; +import feign.Param; +import feign.RequestLine; +import java.math.BigDecimal; +import org.apache.fineract.client.models.PostClientsClientIdChargesResponse; + +/** + * Applies a client charge whose {@code amount} carries decimal places. + * + * <p> + * The server parses {@code amount} as a {@code BigDecimal} - rounding it to the currency's decimal places is exactly + * what {@code ClientChargeRoundingTest} exercises - but {@code ClientChargesApiResourceSwagger} declares it as an + * {@code Integer}, so the generated {@code PostClientsClientIdChargesRequest} cannot carry 19.876 or 0.55. + * + * <p> + * The Swagger DTO is simply wrong here and correcting it is the right fix, but it is a breaking OpenAPI change + * (swagger-brake R010, {@code integer} to {@code number}) and belongs in its own change rather than in a test + * migration. Until then this keeps the call typed end to end, binding the response to the generated model. + */ +@Headers({ "Accept: application/json", "Content-Type: application/json" }) +public interface ClientChargeCommandsApi { Review Comment: Fixed! That retype is the only non-additive change in the PR. Across the nine touched production files the diff is additive apart from three lines: this one, LoanTransactionsApiResourceSwagger going public so InteropApiResource can reference it, and a copy-paste fix to the loanrepayment operation summary (develop had it as "Disburse Loan by Account Id"). So R010 on amount should be the only thing the API check reports. -- 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]
