You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/rest_api/extending_rest_api/adding_custom_media_type.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ The following example adds the handling of a new media type `application/app.api
12
12
You need the following elements:
13
13
14
14
-`ValueObjectVisitor` - to create the new response corresponding to the new media type
15
-
-`ValueObjectVisitorDispatcher` - to have this `ValueObjectVisitor` used to visit the default controller result
16
-
-`Output\Visitor` - service associating this new `ValueObjectVisitorDispatcher` with the new media type
15
+
-`ValueObjectVisitorResolver` - to have this `ValueObjectVisitor` used to visit the default controller result
16
+
-`Output\Visitor` - service associating this new `ValueObjectVisitorResolver` with the new media type
17
17
18
18
!!! note
19
19
20
20
You can change the vendor name (from default `vnd.ibexa.api` to new `app.api` like in this example), or you can create a new media type in the default vendor (like `vnd.ibexa.api.Greeting` in the [Creating a new REST resource](creating_new_rest_resource.md) example).
21
-
To do so, tag your new ValueObjectVisitor with `ibexa.rest.output.value_object.visitor` to add it to the existing `ValueObjectVisitorDispatcher`, and a new one isn't needed.
21
+
To do so, tag your new `ValueObjectVisitor` with `ibexa.rest.output.value_object.visitor` to add it to the existing `ValueObjectVisitorResolver`, and a new one isn't needed.
22
22
This way, the `media-type` attribute is also easier to create, because the default `Output\Generator` uses this default vendor.
23
23
This example presents creating a new vendor as a good practice, to highlight that this is custom extensions that isn't available in a regular [[= product_name =]] installation.
24
24
@@ -41,27 +41,27 @@ This tag has a `type` property to associate the new `ValueObjectVisitor` with th
The following new pair of `Ouput\Visitor` entries associates `Accept` headers starting with `application/app.api.` to the new `ValueObjectVisitorDispatcher` for both XML and JSON.
64
+
The following new pair of `Ouput\Visitor` entries associates `Accept` headers starting with `application/app.api.` to the new `ValueObjectVisitorResolver` for both XML and JSON.
65
65
A priority is set higher than other `ibexa.rest.output.visitor` tagged built-in services.
0 commit comments