Alfresco / rest-api-explorer

Public REST API Explorer
Apache License 2.0
36 stars 25 forks source link

ACS-3525: API for manual triggering rules on a folder #173

Closed krdabrowski closed 1 year ago

krdabrowski commented 1 year ago

https://alfresco.atlassian.net/browse/ACS-3525

krdabrowski commented 1 year ago

@tpage-alfresco @mpichura IMO simply: includeSubFolders and executeInheritedRules would fits the most, but I'm not sure if it's not against convention.

tpage-alfresco commented 1 year ago

I'm pretty sure it's against the convention. My vote would be are since this is the plural form of is. It doesn't read particularly well in all situations. I had a quick look through the API Explorer and there are lots of other examples that don't start with is or has, etc. so maybe we could check with Stefan or Jamal if this is a convention we're still meant to follow - maybe I'm out of date?

mpichura commented 1 year ago

When it comes to Java, IIRC, the most encouraged convention is that the name of the boolean field should not contain is prefix as should the getter (e.g., field name enabled, getter isEnabled(), setter setEnabled(boolean enabled)). I personally find this convention most intuitive and meaningful, however we seem not to always follow it. Moreover, IIRC, many Java libraries using reflection (e.g., Jackson) used to rely on such naming convention. That way, in Java classes I think I would aim towards eachSubFolderIcluded (getter isEachSubFolderIncluded(), setter setEachSubFolderIncluded(boolean included)) and eachInheritedRuleExecuted (getter isEachInheritedRuleExecuted(), setter setEachInheritedRuleExecuted(boolean executed)). But I'll leave the choice to you. When it comes to JSON fields - I really don't know - we don't seem to use YAML files to generate Java code (request/response POJOs, endpoints) and I think I even noticed that some of our request/response classes are a bit different from what we have defined in YAML. Also - looking at sample YAML boolean fields - there is no consistency.

krdabrowski commented 1 year ago

The approach with "isEach" suffix will probably fit the most for this case. Thanks @mpichura !