Disable Swagger on prod results in "Serialization for the format html is not supported"
See original GitHub issueHey,
I changed the route for swagger_ui to /docs.
swagger_ui:
path: /docs
controller: api_platform.swagger.action.ui
On prod I disabled swagger:
api_platform:
enable_swagger: false
However, when requesting /docs on prod I get an 500 with the following message:
[2018-10-18 13:31:21] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Serializer\Exception\NotEncodableValueException: "Serialization for the format html is not supported" at /var/www/html/vendor/symfony/serializer/Serializer.php line 107 {"exception":"[object] (Symfony\\Component\\Serializer\\Exception\\NotEncodableValueException(code: 0): Serialization for the format html is not supported at /var/www/html/vendor/symfony/serializer/Serializer.php:107)"} []
Has anybody ever stumbled across it and knows how to get rid of that?
Best, Christian
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to Turn Off Swagger-ui in Production - Baeldung
This solution is probably the most rigorous, as it makes Swagger disabled by default and guarantees it cannot be enabled in “prod”.
Read more >why swagger is not working if i use the json to gson mapper ...
GSON ([GsonProperties][1]) spring.gson.date-format= # Format to use when serializing Date objects. spring.gson.disable-html-escaping= ...
Read more >Confluent REST Proxy API Reference
REST Proxy can convert data stored in Kafka in serialized form into a JSON-compatible embedded format. These formats are supported: Raw binary data...
Read more >Describing Responses - Swagger
JSON is the most common format for data exchange, but not the only one possible. ... headers to provide additional information on the...
Read more >Spring Boot RESTful API Documentation with Swagger 2
The current version defines a set HTML, JavaScript, and CSS assets to dynamically generate ... Springfox supports both Swagger 1.2 and 2.0.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have the same result even with enable_docs: false
I also disabled docs on prod and it’s working now:
enable_docs: false