Skip to content

Commit ab98ae8

Browse files
authored
Merge pull request #5715
FINERACT-2568: Remove unnecessary @consumes annotations from GET and DELETE endpoints
2 parents 13d4f1e + 81a3809 commit ab98ae8

138 files changed

Lines changed: 27 additions & 464 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fineract-accounting/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public class GLClosuresApiResource {
8080
private final OfficeReadPlatformService officeReadPlatformService;
8181

8282
@GET
83-
@Consumes({ MediaType.APPLICATION_JSON })
8483
@Produces({ MediaType.APPLICATION_JSON })
8584
@Operation(summary = "List Accounting closures", description = """
8685
Example Requests:
@@ -95,7 +94,6 @@ public List<GLClosureData> retrieveAllClosures(@QueryParam("officeId") @Paramete
9594

9695
@GET
9796
@Path("{glClosureId}")
98-
@Consumes({ MediaType.APPLICATION_JSON })
9997
@Produces({ MediaType.APPLICATION_JSON })
10098
@Operation(summary = "Retrieve an Accounting Closure", description = """
10199
Example Requests:
@@ -148,7 +146,6 @@ public CommandProcessingResult updateGLClosure(@PathParam("glClosureId") @Parame
148146

149147
@DELETE
150148
@Path("{glClosureId}")
151-
@Consumes({ MediaType.APPLICATION_JSON })
152149
@Produces({ MediaType.APPLICATION_JSON })
153150
@Operation(summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.")
154151
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class)))

fineract-accounting/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,13 @@ public class FinancialActivityAccountsApiResource {
7676

7777
@GET
7878
@Path("template")
79-
@Consumes({ MediaType.APPLICATION_JSON })
8079
@Produces({ MediaType.APPLICATION_JSON })
8180
public FinancialActivityAccountData retrieveTemplate() {
8281
context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.RESOURCE_NAME_FOR_PERMISSION);
8382
return financialActivityAccountReadPlatformService.getFinancialActivityAccountTemplate();
8483
}
8584

8685
@GET
87-
@Consumes({ MediaType.APPLICATION_JSON })
8886
@Produces({ MediaType.APPLICATION_JSON })
8987
@Operation(summary = "List Financial Activities to Accounts Mappings", description = """
9088
Example Requests:
@@ -97,7 +95,6 @@ public List<FinancialActivityAccountData> retrieveAll() {
9795

9896
@GET
9997
@Path("{mappingId}")
100-
@Consumes({ MediaType.APPLICATION_JSON })
10198
@Produces({ MediaType.APPLICATION_JSON })
10299
@Operation(summary = "Retrieve a Financial Activity to Account Mapping\n", description = """
103100
Example Requests:
@@ -148,7 +145,6 @@ public CommandProcessingResult updateGLAccount(@PathParam("mappingId") @Paramete
148145

149146
@DELETE
150147
@Path("{mappingId}")
151-
@Consumes({ MediaType.APPLICATION_JSON })
152148
@Produces({ MediaType.APPLICATION_JSON })
153149
@Operation(summary = "Delete a Financial Activity to Account Mapping", operationId = "deleteGLAccountMappingFinancialActivityAccount")
154150
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.DeleteFinancialActivityAccountsResponse.class)))

fineract-accounting/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public class GLAccountsApiResource {
9292

9393
@GET
9494
@Path("template")
95-
@Consumes({ MediaType.APPLICATION_JSON })
9695
@Produces({ MediaType.APPLICATION_JSON })
9796
@Operation(tags = {
9897
"General Ledger Account" }, summary = "Retrieve GL Accounts Template", description = """
@@ -122,7 +121,6 @@ public GLAccountData retrieveNewAccountDetails(@QueryParam("type") @Parameter(de
122121
}
123122

124123
@GET
125-
@Consumes({ MediaType.APPLICATION_JSON })
126124
@Produces({ MediaType.APPLICATION_JSON })
127125
@Operation(tags = {
128126
"General Ledger Account" }, summary = "List General Ledger Account", description = """
@@ -153,7 +151,6 @@ public List<GLAccountData> retrieveAllAccounts(@QueryParam("type") @Parameter(de
153151

154152
@GET
155153
@Path("{glAccountId}")
156-
@Consumes({ MediaType.APPLICATION_JSON })
157154
@Produces({ MediaType.APPLICATION_JSON })
158155
@Operation(tags = { "General Ledger Account" }, summary = "Retrieve a General Ledger Account", description = """
159156
Example Requests:
@@ -212,7 +209,6 @@ public CommandProcessingResult updateGLAccount(@PathParam("glAccountId") @Parame
212209

213210
@DELETE
214211
@Path("{glAccountId}")
215-
@Consumes({ MediaType.APPLICATION_JSON })
216212
@Produces({ MediaType.APPLICATION_JSON })
217213
@Operation(tags = {
218214
"General Ledger Account" }, summary = "Delete a GL Account", operationId = "deleteGLAccount", description = "Deletes a GL Account")

fineract-accounting/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public CommandProcessingResult modifyProvisioningEntry(@PathParam("entryId") @Pa
108108

109109
@GET
110110
@Path("{entryId}")
111-
@Consumes({ MediaType.APPLICATION_JSON })
112111
@Produces({ MediaType.APPLICATION_JSON })
113112
@Operation(summary = "Retrieves a Provisioning Entry", description = "Returns the details of a generated Provisioning Entry.")
114113
public ProvisioningEntryData retrieveProvisioningEntry(@PathParam("entryId") @Parameter(description = "entryId") final Long entryId) {
@@ -118,7 +117,6 @@ public ProvisioningEntryData retrieveProvisioningEntry(@PathParam("entryId") @Pa
118117

119118
@GET
120119
@Path("entries")
121-
@Consumes({ MediaType.APPLICATION_JSON })
122120
@Produces({ MediaType.APPLICATION_JSON })
123121
public Page<LoanProductProvisioningEntryData> retrieveProviioningEntries(@QueryParam("entryId") final Long entryId,
124122
@QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
@@ -132,7 +130,6 @@ public Page<LoanProductProvisioningEntryData> retrieveProviioningEntries(@QueryP
132130
}
133131

134132
@GET
135-
@Consumes({ MediaType.APPLICATION_JSON })
136133
@Produces({ MediaType.APPLICATION_JSON })
137134
@Operation(summary = "List all Provisioning Entries")
138135
public Page<ProvisioningEntryData> retrieveAllProvisioningEntries(

fineract-accounting/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public class AccountingRuleApiResource {
9393

9494
@GET
9595
@Path("template")
96-
@Consumes({ MediaType.APPLICATION_JSON })
9796
@Produces({ MediaType.APPLICATION_JSON })
9897
@Operation(summary = "Retrieve Accounting Rule Details Template", description = """
9998
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
@@ -109,7 +108,6 @@ public AccountingRuleData retrieveTemplate() {
109108
}
110109

111110
@GET
112-
@Consumes({ MediaType.APPLICATION_JSON })
113111
@Produces({ MediaType.APPLICATION_JSON })
114112
@Operation(summary = "Retrieve Accounting Rules", description = """
115113
Returns the list of defined accounting rules.
@@ -131,7 +129,6 @@ public List<AccountingRuleData> retrieveAllAccountingRules(@Context final UriInf
131129

132130
@GET
133131
@Path("{accountingRuleId}")
134-
@Consumes({ MediaType.APPLICATION_JSON })
135132
@Produces({ MediaType.APPLICATION_JSON })
136133
@Operation(summary = "Retrieve a Accounting rule", description = """
137134
Returns the details of a defined Accounting rule.
@@ -190,7 +187,6 @@ public CommandProcessingResult updateAccountingRule(
190187

191188
@DELETE
192189
@Path("{accountingRuleId}")
193-
@Consumes({ MediaType.APPLICATION_JSON })
194190
@Produces({ MediaType.APPLICATION_JSON })
195191
@Operation(summary = "Delete a Accounting Rule", description = "Deletes a Accounting rule.")
196192
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.DeleteAccountingRulesResponse.class)))

fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package org.apache.fineract.organisation.teller.api;
2020

2121
import io.swagger.v3.oas.annotations.tags.Tag;
22-
import jakarta.ws.rs.Consumes;
2322
import jakarta.ws.rs.GET;
2423
import jakarta.ws.rs.Path;
2524
import jakarta.ws.rs.Produces;
@@ -43,7 +42,6 @@ public class CashierApiResource {
4342
private final TellerManagementReadPlatformService readPlatformService;
4443

4544
@GET
46-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
4745
@Produces(MediaType.APPLICATION_JSON)
4846
public Collection<CashierData> getCashierData(@QueryParam("officeId") final Long officeId, @QueryParam("tellerId") final Long tellerId,
4947
@QueryParam("staffId") final Long staffId, @QueryParam("date") final String date) {

fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public class TellerApiResource {
7373
private final DefaultToApiJsonSerializer<String> apiJsonSerializer;
7474

7575
@GET
76-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
7776
@Produces(MediaType.APPLICATION_JSON)
7877
@Operation(summary = "List all tellers", description = "Retrieves list tellers")
7978
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class))))
@@ -83,7 +82,6 @@ public Collection<TellerData> getTellerData(@QueryParam("officeId") @Parameter(d
8382

8483
@GET
8584
@Path("{tellerId}")
86-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
8785
@Produces(MediaType.APPLICATION_JSON)
8886
@Operation(summary = "Retrieve tellers", description = "")
8987
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class)))
@@ -124,7 +122,6 @@ public CommandProcessingResult updateTeller(@PathParam("tellerId") @Parameter(de
124122

125123
@DELETE
126124
@Path("{tellerId}")
127-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
128125
@Produces(MediaType.APPLICATION_JSON)
129126
public CommandProcessingResult deleteTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) {
130127
final CommandWrapper request = new CommandWrapperBuilder().deleteTeller(tellerId).build();
@@ -133,7 +130,6 @@ public CommandProcessingResult deleteTeller(@PathParam("tellerId") @Parameter(de
133130

134131
@GET
135132
@Path("{tellerId}/cashiers")
136-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
137133
@Produces(MediaType.APPLICATION_JSON)
138134
@Operation(summary = "List Cashiers", description = "")
139135
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersResponse.class)))
@@ -153,7 +149,6 @@ public CashiersForTeller getCashierData(@PathParam("tellerId") @Parameter(descri
153149

154150
@GET
155151
@Path("{tellerId}/cashiers/{cashierId}")
156-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
157152
@Produces(MediaType.APPLICATION_JSON)
158153
@Operation(summary = "Retrieve a cashier", description = "")
159154
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashierIdResponse.class)))
@@ -164,7 +159,6 @@ public CashierData findCashierData(@PathParam("tellerId") @Parameter(description
164159

165160
@GET
166161
@Path("{tellerId}/cashiers/template")
167-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
168162
@Produces(MediaType.APPLICATION_JSON)
169163
@Operation(summary = "Find Cashiers", description = "")
170164
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersTemplateResponse.class)))
@@ -217,7 +211,6 @@ public CommandProcessingResult updateCashier(@PathParam("tellerId") @Parameter(d
217211

218212
@DELETE
219213
@Path("{tellerId}/cashiers/{cashierId}")
220-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
221214
@Produces(MediaType.APPLICATION_JSON)
222215
@Operation(summary = "Delete Cashier", description = "")
223216
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.DeleteTellersTellerIdCashiersCashierIdResponse.class)))
@@ -264,7 +257,6 @@ public CommandProcessingResult settleCashFromCashier(@PathParam("tellerId") @Par
264257

265258
@GET
266259
@Path("{tellerId}/cashiers/{cashierId}/transactions")
267-
@Consumes({ MediaType.APPLICATION_JSON })
268260
@Produces(MediaType.APPLICATION_JSON)
269261
@Operation(summary = "Retrieve Cashier Transactions", description = "")
270262
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class)))
@@ -284,7 +276,6 @@ public Page<CashierTransactionData> getTransactionsForCashier(
284276

285277
@GET
286278
@Path("{tellerId}/cashiers/{cashierId}/summaryandtransactions")
287-
@Consumes({ MediaType.APPLICATION_JSON })
288279
@Produces(MediaType.APPLICATION_JSON)
289280
@Operation(summary = "Retrieve Transactions With Summary For Cashier", description = "")
290281
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class)))
@@ -306,7 +297,6 @@ public CashierTransactionsWithSummaryData getTransactionsWithSummaryForCashier(
306297

307298
@GET
308299
@Path("{tellerId}/cashiers/{cashierId}/transactions/template")
309-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
310300
@Produces(MediaType.APPLICATION_JSON)
311301
@Operation(summary = "Retrieve Cashier Transaction Template", description = "")
312302
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse.class)))
@@ -318,7 +308,6 @@ public CashierTransactionData getCashierTxnTemplate(@PathParam("tellerId") @Para
318308

319309
@GET
320310
@Path("{tellerId}/transactions")
321-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
322311
@Produces(MediaType.APPLICATION_JSON)
323312
public Collection<TellerTransactionData> getTransactionData(
324313
@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
@@ -331,7 +320,6 @@ public Collection<TellerTransactionData> getTransactionData(
331320

332321
@GET
333322
@Path("{tellerId}/transactions/{transactionId}")
334-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
335323
@Produces(MediaType.APPLICATION_JSON)
336324
public TellerTransactionData findTransactionData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerid,
337325
@PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId) {
@@ -340,7 +328,6 @@ public TellerTransactionData findTransactionData(@PathParam("tellerId") @Paramet
340328

341329
@GET
342330
@Path("{tellerId}/journals")
343-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
344331
@Produces(MediaType.APPLICATION_JSON)
345332
public Collection<TellerJournalData> getJournalData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
346333
@QueryParam("cashierId") @Parameter(description = "cashierId") final Long cashierDate,

fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package org.apache.fineract.organisation.teller.api;
2020

2121
import io.swagger.v3.oas.annotations.tags.Tag;
22-
import jakarta.ws.rs.Consumes;
2322
import jakarta.ws.rs.GET;
2423
import jakarta.ws.rs.Path;
2524
import jakarta.ws.rs.Produces;
@@ -41,7 +40,6 @@ public class TellerJournalApiResource {
4140
private final TellerManagementReadPlatformService readPlatformService;
4241

4342
@GET
44-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
4543
@Produces(MediaType.APPLICATION_JSON)
4644
public Collection<TellerJournalData> getJournalData(@QueryParam("officeId") final Long officeId,
4745
@QueryParam("tellerId") final Long tellerId, @QueryParam("cashierId") final Long cashierId,

fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public class ChargesApiResource {
7171
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
7272

7373
@GET
74-
@Consumes({ MediaType.APPLICATION_JSON })
7574
@Produces({ MediaType.APPLICATION_JSON })
7675
@Operation(summary = "Retrieve Charges", description = """
7776
Returns the list of defined charges.
@@ -86,7 +85,6 @@ public List<ChargeData> retrieveAllCharges() {
8685

8786
@GET
8887
@Path("{chargeId}")
89-
@Consumes({ MediaType.APPLICATION_JSON })
9088
@Produces({ MediaType.APPLICATION_JSON })
9189
@Operation(summary = "Retrieve a Charge", description = """
9290
Returns the details of a defined Charge.
@@ -111,7 +109,6 @@ public ChargeData retrieveCharge(@PathParam("chargeId") @Parameter(description =
111109

112110
@GET
113111
@Path("template")
114-
@Consumes({ MediaType.APPLICATION_JSON })
115112
@Produces({ MediaType.APPLICATION_JSON })
116113
@Operation(summary = "Retrieve Charge Template", description = """
117114
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:

fineract-core/src/main/java/org/apache/fineract/infrastructure/businessdate/api/BusinessDateApiResource.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public class BusinessDateApiResource {
5252
private final BusinessDateMapper businessDateMapper;
5353

5454
@GET
55-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
5655
@Produces(MediaType.APPLICATION_JSON)
5756
@Operation(summary = "List all business dates", description = "")
5857
public List<BusinessDateResponse> getBusinessDates() {
@@ -61,7 +60,6 @@ public List<BusinessDateResponse> getBusinessDates() {
6160

6261
@GET
6362
@Path("{type}")
64-
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
6563
@Produces(MediaType.APPLICATION_JSON)
6664
@Operation(summary = "Retrieve a specific Business date", description = "")
6765
public BusinessDateResponse getBusinessDate(@PathParam("type") @Parameter(description = "type") final String type) {

0 commit comments

Comments
 (0)