-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat/marshaller #69
Feat/marshaller #69
Conversation
soyuka
commented
Jan 30, 2023
Q | A |
---|---|
Branch? | main for features / current stable version branch for bug fixes |
Bug fix? | yes/no |
New feature? | yes/no |
Deprecations? | yes/no |
Tickets | Fix #... |
License | MIT |
Doc PR | api-platform/docs#... |
|
||
$context = new Context( | ||
new TypeOption( | ||
gettype($controllerResult) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gettype($controllerResult) | |
get_class($controllerResult) |
); | ||
|
||
$input = new InputStream(); | ||
fwrite($input->resource(), json_encode($data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? , what is $data
?
$dataDeserialized = $this->marshaller->unmarshal( | ||
$input, | ||
AttributeResource::class, | ||
'json', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: how to use jsonld
?
$event->setResponse(new Response( | ||
$controllerResult, | ||
if( | ||
\gettype($controllerResult) === 'string' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_string?
815fc71
to
d7e00c5
Compare
|
||
return new AttributeResources(new AttributeResource(1, 'Foo'), new AttributeResource(2, 'Bar')); | ||
return new Collection(new AttributeResource(1, 'Foo'), new AttributeResource(2, 'Bar')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: revert
? \gettype($controllerResult) | ||
: \get_class($controllerResult) | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: remove this
- add a proxy for @id etc.
} | ||
|
||
return $resource; | ||
return new AttributeResource($uriVariables['identifier'], 'Foo'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: revert
ae6649e
to
0a362d3
Compare
6d03ee5
to
412d5b2
Compare
d2dbe99
to
cad9e4f
Compare