Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsonapi
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
jsonapi
Commits
0e6d7937
Unverified
Commit
0e6d7937
authored
7 years ago
by
Mateu Aguiló Bosch
Committed by
Mateu Aguiló Bosch
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2933160
by e0ipso: Translate the related route parameter to the internal field name
parent
0a56ad4c
No related branches found
Branches containing commit
Tags
8.x-1.6
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Controller/RequestHandler.php
+4
-2
4 additions, 2 deletions
src/Controller/RequestHandler.php
with
4 additions
and
2 deletions
src/Controller/RequestHandler.php
+
4
−
2
View file @
0e6d7937
...
...
@@ -116,11 +116,13 @@ class RequestHandler implements ContainerAwareInterface, ContainerInjectionInter
return
NULL
;
}
$format
=
$request
->
getContentType
();
$resource_type
=
$current_context
->
getResourceType
();
$field_related
=
$resource_type
->
getInternalName
(
$request
->
get
(
'related'
));
try
{
return
$serializer
->
deserialize
(
$received
,
$serialization_class
,
$format
,
[
'related'
=>
$
request
->
get
(
'
related
'
)
,
'related'
=>
$
field_
related
,
'target_entity'
=>
$request
->
get
(
$current_context
->
getResourceType
()
->
getEntityTypeId
()),
'resource_type'
=>
$
current_context
->
getR
esource
T
ype
()
,
'resource_type'
=>
$
r
esource
_t
ype
,
]);
}
catch
(
UnexpectedValueException
$e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment