Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection is being reversed by coll-of #406

Closed
rlovtangen opened this issue Jan 17, 2019 · 2 comments · Fixed by metosin/spec-tools#164
Closed

Collection is being reversed by coll-of #406

rlovtangen opened this issue Jan 17, 2019 · 2 comments · Fixed by metosin/spec-tools#164
Labels

Comments

@rlovtangen
Copy link

Library Version(s)

2.0.0-alpha27

Problem

Given a route like

(api/GET "/foo" []
      {:responses {status/ok {:schema ::int-list}}}
      (response/ok (list 1 2 3)))

with a spec like

(s/def ::int-list
  (su/spec
    (s/coll-of int?)
    {}))

the response returns the collection is reversed order:

$ curl -X GET --header 'Accept: application/json' 'http://localhost:8003/foo'
[3,2,1]

With version 2.0.0-alpha26 and earlier the collection keeps its original order:

$ curl -X GET --header 'Accept: application/json' 'http://localhost:8003/foo'
[1,2,3]
@ikitommi ikitommi added the bug label Feb 10, 2019
@ikitommi
Copy link
Member

sorry for the lag, this is a bug.

ikitommi added a commit to metosin/spec-tools that referenced this issue Feb 10, 2019
@ikitommi
Copy link
Member

found a fix for this in spec-tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants