Closed rlovtangen closed 4 years ago
2.0.0-alpha27
Given a route like
(api/GET "/foo" [] {:responses {status/ok {:schema ::foobar}}} (response/ok {:foo (list "bar")} ))
with a spec like
(s/def ::foo (su/spec (s/coll-of string? :distinct true :into #{}) {})) (s/def ::foobar (st/spec (s/and (s/keys :req-un [::foo])) {}))
With 2.0.0-alpha26 the list is being coerced into a Set due to :into #{}:
:into #{}
$ curl -X GET --header 'Accept: application/edn' 'http://localhost:8003/foo' {:foo #{"bar"}}
With 2.0.0-alpha27 it is not:
$ curl -X GET --header 'Accept: application/edn' 'http://localhost:8003/foo' {:foo ("bar")}
This seems to be caused by s/and. If I remove s/and (which is not necessary in this example because I have only one predicate):
s/and
(s/def ::foobar (st/spec (s/keys :req-un [::foo]) {}))
then :foo is a Set like with 2.0.0-alpha26:
:foo
Works with 2.0.0-alpha30.
Library Version(s)
2.0.0-alpha27
Problem
Given a route like
with a spec like
With 2.0.0-alpha26 the list is being coerced into a Set due to
:into #{}
:With 2.0.0-alpha27 it is not:
This seems to be caused by
s/and
. If I removes/and
(which is not necessary in this example because I have only one predicate):then
:foo
is a Set like with 2.0.0-alpha26: