ContentTooLarge Status Code Not Recognized in Generated Route File Using Guardrail and Pekko #1537
-
I'm using Guardrail to generate Scala code from an OpenAPI specification. The generated code is leveraging the org.apache.pekko.http.scaladsl.model.StatusCodes library, but the status code ContentTooLarge is used, which doesn't exist in the Pekko HTTP model. This causes the following compilation error:
Below is my OpenApi.yaml
Upon investigating, I found that Pekko doesn't include a ContentTooLarge status code. Instead, PayloadTooLarge (413) would be a more appropriate standard HTTP status code for this scenario. The ContentTooLarge status is generated in the route file by Guardrail. Since the route file is auto-generated, I cannot directly overwrite or modify it. This creates a problem when trying to compile the project, as the status code does not exist in the Pekko HTTP library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ContentTooLarge exists in Pekko HTTP 1.1.0 and above. |
Beta Was this translation helpful? Give feedback.
ContentTooLarge exists in Pekko HTTP 1.1.0 and above.
https://github.com/apache/pekko-http/blob/91315b324e7ca45c9a4892b09a0609bb69afa391/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/StatusCode.scala#L154