Skip to content

Instantly share code, notes, and snippets.

@botris
Created September 10, 2020 11:08
Show Gist options
  • Save botris/07b3565440209dad57b1faa701b70b27 to your computer and use it in GitHub Desktop.
Save botris/07b3565440209dad57b1faa701b70b27 to your computer and use it in GitHub Desktop.
API Platform - handle 2 endpoints on the same entity
<?php
/**
* @ApiResource(
* itemOperations={
* "get"={
* "path"="/entity/{id}",
* "openapi_context" = {
* "parameters" = {
* {
* "name" = "id",
* "in" = "path",
* "required" = "true",
* }
* }
* },
* "path"="/entity_alternative/{id}",
* "controller"=AlternativeController::class,
* "openapi_context" = {
* "parameters" = {
* {
* "name" = "id",
* "in" = "path",
* "required" = "true",
* }
* }
* }
* }
* }
* )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment