edk12564 commented on PR #5744:
URL: https://github.com/apache/fineract/pull/5744#issuecomment-4201026445

   Hi Sandro! Thanks for the comment.
   
   That's a really interesting point. It is true that once these operationIds 
are finished being added (remainder to be added by @Ambika-Sony and from here 
https://github.com/apache/fineract/pull/5597), new endpoints in Fineract could 
result in deduplication again if named generically. If I am understanding 
correctly, your idea is to write a script that reads the fineract.json, 
compares it to a predefined spec, and makes edits to the generated 
fineract.json with operationIds generated from path + http method. Is that 
right?
   
   Overall I agree some kind of automated check better for future 
maintainability purposes. But we have to be careful with implementation. There 
might be a few problems: 
   
   - we'd have to update our predefined spec manually when new endpoints are 
added, since we cannot use the build to verify against itself
   - there are some edge cases where the method name does not properly convey 
the functionality. however, changing the method breaks other items in the 
codebase (for example, in batch steps which directly call endpoints). i was 
using operationId as a way of translating these bad method names into something 
usable for tests. for example, in FinancialActivityAccountsApiResource, we have 
createGLAccount. however, this endpoint actually just creates a mapping between 
a FinancialActivityAccount and a GLAccount that already exists. there is 
another createGLAccount that handles creating GL accounts.
   - path + http method might be too verbose. for example, 
retrieveTransactionByLoanExternalIdAndTransactionExternalId would become 
loansExternalIdLoanExternalIdTransactionsExternalIdExternalTransactionId().
   
   I think looking over each endpoint and its functionality might take a long 
time, but it's allowing me to properly translate these method names into usable 
names for tests. Which I think is still valuable. 
   
   What do you think about this?


-- 
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]

Reply via email to