NelmioApiDoc doesn't group anymore endpoints of entities when using ApiPlatform

Viewed 13

I've just upgraded to api-platform/core:^3.

I don't use the integrated Swagger UI but, instead, I installed NelmioApiDoc.

What happened BEFORE THE UPGRADE

Before the upgrade (until api-platform/core:2.6), the integration was perfect and I was able to see the entities managed by ApiPlatform correctly grouped.

Upgrading first to api-platform/core:2.7, the documentation started to become messy: I still had the groups, but the api prefix was wrong and the endpoints were duplicated also in the "default" section:

The (WRONG) documentation generated for each entity: no api prefix in the route The (WRONG) documentation generated for each entity: no api prefix in the route

As the routes didn't have the prefix, I could not test the endpoints from inside the docs.

In default section, instead, the routes was correct (they had the /api/ prefix) but I could not test them anyway from the documentation as the details of the endpoint was not present.

enter image description here The endpoints documented in the "default" section (duplicated as they are also in the groups as shown above)

What happens AFTER THE UPGRADE

Now I've upgraded to api-platform/core:3 and the documentation is completely broken:

I don't have the entities grouped anymore and, instead, I only have endpoints described in the "default" section.

There are routes that should not exist (like /api/.well-known/genid/{id}) and the correct ones cannot be used as it is impossible to pass payloads:

enter image description here This is how the endpoint is rendered (wrongly) in NelmioApiDoc

enter image description here This is how the endpoint is rendered (correctly) in the integrated Swagger UI of ApiPlatform (and how I like to have it in NelmioApiDoc, too - and like I had it before the upgrade)

Those are some endpoints that should not be where they are:

enter image description here

Any ideas about how to make NelmioApiDoc correctly get the info about endpoints from ApiPlatform?

0 Answers
Related