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.

Disable Swagger on prod results in "Serialization for the format html is not supported"

See original GitHub issue

Hey,

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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
cvecommented, Nov 4, 2019

I have the same result even with enable_docs: false

1reaction
christiansiewertcommented, Oct 18, 2018

I also disabled docs on prod and it’s working now:

enable_docs: false

Read more comments on GitHub >

github_iconTop 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 >

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