Skip to content

[Docs] Document SDK marshaller #592

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

Open
roxblnfk opened this issue Apr 9, 2025 · 6 comments
Open

[Docs] Document SDK marshaller #592

roxblnfk opened this issue Apr 9, 2025 · 6 comments
Labels
Documentation Improvements or additions to documentation

Comments

@roxblnfk
Copy link
Collaborator

roxblnfk commented Apr 9, 2025

Documentation for the marshaller is completely missing. New users have no way to learn how to serialize data objects, typed lists, and more.
It's necessary to explain attributes like Marshal, MarshalArray, types, and so on.

@roxblnfk roxblnfk added the Documentation Improvements or additions to documentation label Apr 9, 2025
@KorDum
Copy link

KorDum commented Apr 14, 2025

Apparently, it will be necessary to modify it a bit for static analyzers:
#595
#596

@mtorromeo
Copy link

This is a fundamental concept that needs documenting.

Is there at least an example that I can take a look at?

@roxblnfk
Copy link
Collaborator Author

@mtorromeo
Copy link

For my use case I ended up using a custom DataConverter, which is also not documented for PHP.

The difference between DataConverters and marshalling is also not clear, which is a byproduct of the lacking documentation on these topics.

@KorDum
Copy link

KorDum commented May 29, 2025

I'm writing this so it won't be forgotten when describing it. We've just encountered an unobvious behavior: unlike Symfony Serializer, (un-)marshaller creates an object past the constructor, which makes the use of initializations through the constructor promotion not work and the field remains uninitialized.

See example:

public function __contrcutor(
    public ?Some $some = null, // the field will not be initialized
) {}
public ?Some $some = null; // will be ok

public function __contrcutor(?Some $some = null)
{
    $this->some = $some;
}

@roxblnfk
Copy link
Collaborator Author

@KorDum yes. Because in the first case the default value is related to parameter, not property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants