Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid field name fixed in GetDataTablesResponse (FINERACT-1372) #1828

Merged
merged 1 commit into from
Sep 5, 2021

Conversation

danishjamal104
Copy link
Contributor

Description

Field renamed to match the api actual response, below are the fields renamed.

  • appTableName to applicationTableName
  • datatableName to registeredTableName
  • column to columnHeaderData

For more info refer Apache Fineract JIRA ticket #1372.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests

  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.

  • Create/update unit or integration tests for verifying the changes made.

  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.

  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/api-docs/apiLive.htm with details of any API changes

  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@ptuomola
Copy link
Contributor

ptuomola commented Aug 15, 2021 via email

@danishjamal104
Copy link
Contributor Author

Hi Danish - many thanks for all of your pull requests fixing the Swagger client API definitions - this is great work! What I was thinking about is: how do we best review these and ensure the fixes are correct. One option would be for me to simply look at the changes you’ve made and compare that to the function signature manually. That of course works, but is pretty error-prone and manual: if we make any mistakes in comparison, then there may still be differences and the Swagger client will not work. Also this is “one-off”: if there are any changes in the future to either Swagger definition or to the function signature, there is no guarantee they will stay in synch. To me, the real solution would be to actually write some test cases that use the generated Swagger client to call the APIs. If they work, then clearly the definitions are correct as well. If they don’t work, then there’s still some difference (or some other problem) with the Swagger definitions. The other benefit with this would be that these test cases could then be part of the automatic build, and ensure the APIs remain working also in the future. In fact, we’ve before discussed that it would make sense to move all the current integration tests (which work via direct REST calls to the API) to be done through the Swagger generated client instead. Would be great to get your thoughts - if there’s an easier way to make sure things are “in synch” then let’s consider that as well. Alternatively, if you think writing tests makes sense as an approach, would you have time to also write some simple test cases through the generated Swagger client for the fixes that you submit? That way their correctness would be automatically verified both now and in the future. Cc’ing the Dev list for any other ideas/suggestions as well Thanks Best regards Petri

hey @ptuomola , first of all thanks for taking a look at my PR. As far testing is considered their is already test cases defined for different endpoints which internally make use of fineract client. Take a look at below SS it gets the FIneractClient instance and uses is for making request to different endpoints.
The main issue arises when we test the client api using more data. For example, In earlier stage when I tested the client API for getting client info, it was working fine but as soon as I linked it with the group then the exception is thrown, so the main issue was that the generated class defines groups field as a list of String and the api returned the empty group list but when the client was linked with group then the list of groups object was returned. Hence the test cases wasn't able to recognise the error and was passing it.
Summarising the example, [] is a valid List<String> and List<Groups>. So when api sends List<Groups> then it throws error. This is one of the example, as I was integrating the generated client sdk I encountered many such type issues which was initially working fine but later failed.

Screenshot 2021-08-15 at 12 21 09 PM

@awasum awasum mentioned this pull request Aug 20, 2021
6 tasks
Copy link
Contributor

@ptuomola ptuomola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ptuomola ptuomola merged commit c46e228 into apache:develop Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants