question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@ApiSubresource route overriding other collection routes with same path

See original GitHub issue

I’ve noticed that if you add a collectionOperations that uses the same path as an existing @ApiSubresource, then the route operation is missing from the generated Swagger docs.

I’ve found the workaround is to re-name the {id} parameter to something else, that does not clash with the @ApiSubresource path, but this took some working out. It looks like the \ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer::normalize() method does not combine the routes together, but instead allows the @ApiSubresource version to overwrite the other routes.

I think that \ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer::normalize() (or it’s dependencies) could do with updating to combine not overwrite the route docs.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
soyukacommented, Mar 1, 2019

Should be moved to the api-platform/core repository

0reactions
toby-griffithscommented, Apr 8, 2019

Thank you @soyuka

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to expose different GET routes for the same entity
For the moment, I have one GET route for an item : /api/users/{id} I would like to have 3 GET routes for an...
Read more >
Working with routes for HTTP APIs - Amazon API Gateway
Routes direct incoming API requests to backend resources. Routes consist of two parts: an HTTP method and a resource path—for example, GET /pets...
Read more >
Rails Routing from the Outside In - Ruby on Rails Guides
How to automatically create paths and URLs using route helpers. ... the Singular Form; Using :as in Nested Resources; Overriding Named Route Parameters....
Read more >
Attribute Routing in ASP.NET Web API 2 | Microsoft Learn
This topic discusses how to enable attribute routing in ASP. ... That way, you can combine both types of routing in the same...
Read more >
Routing — Falcon 3.1.1 documentation
a collection of those same items. Another class might use a suffixed responder to handle a shortlink route in addition to the regular...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found