Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

razvanphp
Copy link
Contributor

@razvanphp razvanphp commented Feb 28, 2025

Closes #4591

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

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

Screenshot 2025-03-11 at 14 09 38

@razvanphp razvanphp requested review from yoshi-approver and a team as code owners February 28, 2025 14:40
razvanphp added a commit to razvanphp/google-wallet-sdk that referenced this pull request Feb 28, 2025
@razvanphp razvanphp force-pushed the add-attribute-description branch from 677f715 to 775e5e1 Compare February 28, 2025 14:42
razvanphp added a commit to razvanphp/google-wallet-sdk that referenced this pull request Feb 28, 2025
razvanphp added a commit to razvanphp/google-wallet-sdk that referenced this pull request Mar 11, 2025
…s (step 3) (googleapis#6295)

Added deprecated props support. Tests are also adjusted.
@razvanphp
Copy link
Contributor Author

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

@Tofandel
Copy link

Tofandel commented Mar 12, 2025

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: #595

@razvanphp
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Thank you!

Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

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

This looks great! thanks for your contribution!

@bshaffer
Copy link
Contributor

bshaffer commented Jun 6, 2025

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)

@razvanphp razvanphp force-pushed the add-attribute-description branch from d50fe02 to f6e03fe Compare June 6, 2025 19:13
@razvanphp
Copy link
Contributor Author

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

@razvanphp
Copy link
Contributor Author

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?

* @deprecated
*/
public $kind;
public string $kind;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to add the typehints for these. This could lead to errorsbeing thrown such as

Typed property Foo::$bar must not be accessed before initialization

Where they wouldn't have been thrown previously

Copy link
Contributor

Choose a reason for hiding this comment

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

@razvanphp @bshaffer I agree with this comment, everything lgtm except this new error being thrown. I would change this but then I would not be able to review thanks to the new merging rules.

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.

TransitType enum not generated
4 participants