When giving an invalid value for the :responses route parameter, the code compiles and runs without exceptions if default Schema coercion is used. However, when :coercion :spec is applied to an endpoint with an invalid :responsesparameter, a compilation error is thrown.
An example of an invalid :responses param with default coercion, working fine:
Syntax error (IllegalArgumentException) compiling at (core.clj:12:3).
No implementation of method: :specify of protocol: #'compojure.api.coercion.spec/Specify found for class: nil
I'm not sure if an error should be thrown anytime when a value like {200 {}} for :responses is given, or if this should be considered valid. In any case, it is inconsistent that changing the coercion setting causes an error which is unrelated to coercion to be thrown.
Library Version(s)
2.0.0-alpha28
Problem
When giving an invalid value for the
:responses
route parameter, the code compiles and runs without exceptions if default Schema coercion is used. However, when:coercion :spec
is applied to an endpoint with an invalid:responses
parameter, a compilation error is thrown.An example of an invalid
:responses
param with default coercion, working fine:An example of an invalid
:responses
param with spec coercion, resulting in a compilation error.The error thrown is:
I'm not sure if an error should be thrown anytime when a value like
{200 {}}
for:responses
is given, or if this should be considered valid. In any case, it is inconsistent that changing the coercion setting causes an error which is unrelated to coercion to be thrown.