Forked from dsbaars/Representation.CollectionRepresentation.yml
Last active
June 3, 2019 13:06
-
-
Save igormukhingmailcom/fd5a6e577fc0ff7adbeeef09822ace14 to your computer and use it in GitHub Desktop.
Revisions
-
igormukhingmailcom revised this gist
Jun 3, 2019 . No changes.There are no files selected for viewing
-
igormukhingmailcom revised this gist
Jun 3, 2019 . No changes.There are no files selected for viewing
-
igormukhingmailcom revised this gist
Jun 3, 2019 . No changes.There are no files selected for viewing
-
igormukhingmailcom revised this gist
Jun 3, 2019 . 5 changed files with 44 additions and 35 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # config/serializer/hateoas/AbstractSegmentedRepresentation.yml Hateoas\Representation\AbstractSegmentedRepresentation: exclusion_policy: ALL expose: false properties: limit: expose: true groups: [ Default, Hateoas ] total: expose: true groups: [ Default, Hateoas ] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,9 @@ # config/serializer/hateoas/CollectionRepresentation.yml Hateoas\Representation\CollectionRepresentation: exclusion_policy: ALL expose: false virtual_properties: getResources: serialized_name: items expose: true groups: [ Default, Hateoas ] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,65 +1,57 @@ # config/serializer/hateoas/PaginatedRepresentation.yml Hateoas\Representation\PaginatedRepresentation: exclusion_policy: ALL expose: false custom_accessor_order: [page, limit, pages, total] relations: - rel: self href: route: expr(object.getRoute()) parameters: "expr(object.getParameters() + {page: object.getPage()})" absolute: expr(object.isAbsolute()) exclusion: groups: [ Default, Hateoas ] - rel: first href: route: expr(object.getRoute()) parameters: "expr(object.getParameters() + {page: 1})" absolute: expr(object.isAbsolute()) exclusion: groups: [ Default, Hateoas ] - rel: last href: route: expr(object.getRoute()) parameters: "expr(object.getParameters() + {page: object.getPages()})" absolute: expr(object.isAbsolute()) exclusion: groups: [ Default, Hateoas ] exclude_if: expr(object.getPages() === null) - rel: next href: route: expr(object.getRoute()) parameters: "expr(object.getParameters() + {page: object.getPage()+1})" absolute: expr(object.isAbsolute()) exclusion: groups: [ Default, Hateoas ] exclude_if: expr(object.getPages() !== null && (object.getPage() + 1) > object.getPages()) - rel: previous href: route: expr(object.getRoute()) parameters: "expr(object.getParameters() + {page: object.getPage()-1})" absolute: expr(object.isAbsolute()) exclusion: groups: [ Default, Hateoas ] exclude_if: expr((object.getPage() - 1) < 1) properties: page: expose: true groups: [ Default, Hateoas ] limit: expose: true groups: [ Default, Hateoas ] pages: expose: true groups: [ Default, Hateoas ] total: expose: true groups: [ Default, Hateoas ] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ # config/serializer/hateoas/RouteAwareRepresentation.yml Hateoas\Representation\RouteAwareRepresentation: exclusion_policy: ALL expose: false properties: inline: expose: true This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ # config/packages/jms_serializer.yml jms_serializer: metadata: directories: hateoas: namespace_prefix: "Hateoas\\Representation" path: "%kernel.project_dir%/config/serializer/hateoas/" -
dsbaars created this gist
May 23, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ Hateoas\Representation\CollectionRepresentation: exclusion_policy: all exclude: false expose: true properties: rel: exclude: false expose: true groups: [ Default, Hateoas ] resources: exclude: false expose: true groups: [ Default, Hateoas ] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,65 @@ Hateoas\Representation\PaginatedRepresentation: custom_accessor_order: [page, limit, pages, total] relations: - rel: self href: route: expr(object.getRoute()) parameters: parameters: page: expr(object.getPage()) _format: json absolute: expr(object.isAbsolute()) exclusion: groups: [Hateoas] - rel: first href: route: expr(object.getRoute()) parameters: page: 1 _format: json absolute: expr(object.isAbsolute()) exclusion: groups: [Hateoas] - rel: last href: route: expr(object.getRoute()) parameters: page: expr(object.getPages()) _format: json absolute: expr(object.isAbsolute()) exclusion: groups: [Hateoas] exclude_if: expr(object.getPages() === null) - rel: next href: route: expr(object.getRoute()) parameters: page: expr(object.getPage()+1) _format: json absolute: expr(object.isAbsolute()) exclusion: groups: [Hateoas] exclude_if: expr(object.getPages() !== null && (object.getPage() + 1) > object.getPages()) - rel: previous href: route: expr(object.getRoute()) parameters: page: expr(object.getPage()-1) _format: json absolute: expr(object.isAbsolute()) exclusion: groups: [Hateoas] exclude_if: expr((object.getPage() - 1) < 1) properties: page: expose: true groups: [Hateoas] limit: expose: true groups: [Hateoas] pages: expose: true groups: [Hateoas] total: expose: true groups: [Hateoas] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ Hateoas\Representation\RouteAwareRepresentation: properties: inline: expose: true groups: [ Default, Hateoas ] serialized_name: _embedded