Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MarshalOptions attributes to support Laravel Queue payload #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yanlyan
Copy link

@yanlyan yanlyan commented Mar 29, 2023

  • add LaravelQueue flag on MarshalOptions
  • add StructName on MarshalOptions option to custom class name

@elliotchance
Copy link
Owner

  • LaravelQueue is not relevant to this library.
  • I'm not convinced that StructName is useful either.

@yanlyan
Copy link
Author

yanlyan commented Mar 30, 2023

Hello @elliotchance
I'm new to open-source things, but can I fork this repo and use my customized library to meet my requirements?

@elliotchance
Copy link
Owner

You could fork it and modify it, but that is highly not recommended because now you'l have a separate version that won't be easy to update with bug fixes.

Some other approaches (with the most recommened at the top):

  1. Fix your input data so that you don't have to make changes. Either by decoding/encoding it through PHP or whatever.
  2. Decode the data into something more flexible like a map, then build the struct yourself by pulling out attributes as needed.
  3. Handle any augmentation before parsing it. You might do a string replace on the raw data, for example.

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.

3 participants