This is an automated email from the ASF dual-hosted git repository.
ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 3bcac21 swagger resource fixed for creating datatable & entries
(FINERACT-1365)
3bcac21 is described below
commit 3bcac21f5785e4659fa6301f13f2c2179924a738
Author: Danish Jamal <[email protected]>
AuthorDate: Sat Aug 7 21:18:52 2021 +0530
swagger resource fixed for creating datatable & entries (FINERACT-1365)
---
.../dataqueries/api/DatatablesApiResource.java | 2 +-
.../api/DatatablesApiResourceSwagger.java | 27 +++++++++++++++++-----
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java
index 2df2878..4918f77 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java
@@ -284,7 +284,7 @@ public class DatatablesApiResource {
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Create Entry in Data Table", description = "Adds a
row to the data table.\n" + "\n"
+ "Note that the default datatable UI functionality converts any
field name containing spaces to underscores when using the API. This means the
field name \"Business Description\" is considered the same as
\"Business_Description\". So you shouldn't have both \"versions\" in any data
table.")
- @RequestBody(required = true, content = @Content(schema =
@Schema(implementation =
DatatablesApiResourceSwagger.PostDataTablesAppTableIdRequest.class)))
+ @RequestBody(required = true, content = @Content(schema =
@Schema(implementation = String.class)), description = "{\n
\"BusinessDescription\": \"Livestock sales\",\n \"Comment\": \"First comment
made\",\n \"Education_cv\": \"Primary\",\n \"Gender_cd\": 6,\n
\"HighestRatePaid\": 8.5,\n \"NextVisit\": \"01 October 2012\",\n
\"YearsinBusiness\": 5,\n \"dateFormat\": \"dd MMMM yyyy\",\n \"locale\":
\"en\"\n}")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
DatatablesApiResourceSwagger.PostDataTablesAppTableIdResponse.class))) })
public String createDatatableEntry(@PathParam("datatable")
@Parameter(description = "datatable") final String datatable,
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java
index 4f7bdf8..379d51f 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java
@@ -50,17 +50,32 @@ final class DatatablesApiResourceSwagger {
@Schema(description = "PostDataTablesRequest")
public static final class PostDataTablesRequest {
- private PostDataTablesRequest() {
+ private PostDataTablesRequest() {}
+ static final class PostColumnHeaderData {
+
+ private PostColumnHeaderData() {}
+
+ @Schema(required = true, example = "DOB")
+ public String name;
+ @Schema(required = true, example = "String", description = "Any of
them: Boolean | Date | DateTime | Decimal | Dropdown | Number | String | Text")
+ public String type;
+ @Schema(example = "Gender", description = "Used in Code Value
fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown,
otherwise an error is returned.")
+ public String code;
+ @Schema(example = "true", description = "Defaults to false")
+ public Boolean mandatory;
+ @Schema(example = "1653", description = "Length of the text field.
Mandatory if type String is used, otherwise an error is returned.")
+ public Long length;
}
- @Schema(example = "m_client")
- public String applicationTableName;
- @Schema(example = "extra_client_details")
- public String registeredTableName;
+ @Schema(required = true, example = "m_client")
+ public String apptableName;
+ @Schema(required = true, example = "extra_client_details")
+ public String datatableName;
@Schema(required = false, description = "Allows to create multiple
entries in the Data Table. Optional, defaults to false. If this property is not
provided Data Table will allow only one entry.", example = "true")
public boolean multiRow;
- public List<ResultsetColumnHeaderData> columnHeaderData;
+ @Schema(required = true)
+ public List<PostColumnHeaderData> columns;
}
@Schema(description = "PostDataTablesResponse")