google-api-php-client-services icon indicating copy to clipboard operation
google-api-php-client-services copied to clipboard

feat: Add relevant attribute descriptions where available

Open razvanphp opened this issue 1 year ago • 3 comments

Closes #4591

This is already really helpful for Walletobjects API, see the attached screenshot.

  • [x] ~I'm still working on adding the Enums as class const, doing great progress.~

Screenshot 2025-03-11 at 14 09 38

razvanphp avatar Feb 28 '25 14:02 razvanphp

I finished my work on this PR, please have a look. I did not regenerate all the classes yet so it does not get huge for review, but I checked it locally with real walletobjects schema at least and all tests pass.

It looks like this now:

Screenshot 2025-03-11 at 17 35 12

Screenshot 2025-03-11 at 14 12 02

razvanphp avatar Mar 11 '25 17:03 razvanphp

My only concern with adding description will be the size of the whole repo, the descriptions are not short and given the number of sub packages in this repo, this will really become problematic as I can see it jumping from 80Mb to 140Mb easily with this change, could you try to generate everything and see how much space it all takes on disk?

See: https://github.com/googleapis/google-api-php-client-services/issues/595

Tofandel avatar Mar 12 '25 09:03 Tofandel

Yeah, I know the discussion, but the Resources have the full description already, I think that problem needs to be solved anyway, no matter if we add this or not.

razvanphp avatar Mar 12 '25 09:03 razvanphp

@bshaffer can you please have a look at this? Really depend on it to develop our passbook lib further.

Thank you!

razvanphp avatar May 16 '25 14:05 razvanphp

This looks great! thanks for your contribution!

Hmm, since I made changes, I can't merge unless I get another approver.

cc @Hectorhammett (or @razvanphp can make my changes and force-push to remove my commits)

bshaffer avatar Jun 06 '25 19:06 bshaffer

Rebased on current main, fixed the tests and force pushed. Thank you for looking into this!

razvanphp avatar Jun 06 '25 19:06 razvanphp

There is one aspect to discuss before we merge this, how to handle this?

Error: Typed property Google\Service\Walletobjects\LoyaltyObject::$classId must not be accessed before initialization

Before, we were using only doc-block for type-hint, now using native strict type hinting.

Should I make those attributes nullable like before? It should be backwards compatible, or do you have another suggestion?

razvanphp avatar Jun 27 '25 16:06 razvanphp

LGTM!

Hectorhammett avatar Nov 12 '25 21:11 Hectorhammett