-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
Description
I have recently updated api-platform/core
from beta
to rc2
. Since that the swagger ui overwrites all our html encoder responses. I feel like there is something wrong with the condition here: https://github.com/api-platform/core/blob/master/src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php#L27-L28
If we request for instance an url like http://fancy-api.com/documents/1
and we have an html encoder registered the condition for exiting that function are not met:
if ('html' !== $request->getRequestFormat(null)
|| (!$request->attributes->has('_api_resource_class') && !$request->attributes->has('_api_respond'))
) {
return;
}
reads:
if (false
|| (!true && !false)
) {
return;
}
I think in the earlier version the swagger ui was only triggered on the route /apidoc
. Maybe it would be possible to have something like this:
/doc
--> swagger ui
/doc.jsonld
--> hydra doc
What do you guys think?