groupoffice icon indicating copy to clipboard operation
groupoffice copied to clipboard

#1269 - parse doc block to identify whether method should be used in API

Open michalcharvat opened this issue 9 months ago • 3 comments

The doc block is parsed to detect the @noapi tag, which allows you to exclude a getter from the API while still keeping clean method names starting with get.

michalcharvat avatar Apr 18 '25 10:04 michalcharvat

A problem with this approach is that it won’t work in the paid / encoded modules. What do you need it for? Perhaps use a different name?

mschering avatar Jun 25 '25 14:06 mschering

The reason is simple — to keep the code clean while still allowing you to use the getter as usual. Currently, if you create a getX method, it will automatically be used by the API. With this hint, you can instruct the API parser to exclude that method from the API output.

I have uses or seen somewhere an array of properties that allowed you to include, exclude, or cast attributes when interacting with the API. Maybe the idea with the arrays isnt bad because sometimes you need to exclude passwords etc

If we’re talking about paid modules, I’m not entirely sure at the moment. Previously, we had to encode one project where we used the @remotable flag in the documentation, which also registered methods for Ext.Direct—and there was no problem.

michalcharvat avatar Jun 26 '25 19:06 michalcharvat

You can also override the atypicalApiProperties() method and list the names you want to exclude.

mschering avatar Nov 24 '25 10:11 mschering