ring-swagger

ring-swagger & compojure-api
Sid 2018-06-05T16:05:10.000688Z

is there some way to control the sorting of the JSON responses in the swagger-ui?

ikitommi 2018-06-05T16:06:36.000592Z

Fo you mean the fields in an api response? Or the list of apis in the ui?

Sid 2018-06-05T16:06:44.000708Z

fields in the api response

ikitommi 2018-06-05T16:10:05.000215Z

I don't think so. If you return a hashmap, it has no order. There are libs like https://github.com/frankiesardo/linked which provide sorted maps & sets.

valtteri 2018-06-05T17:48:52.000160Z

You can try your luck with array-map which is in the core.

valtteri 2018-06-05T17:51:12.000248Z

> An array-map maintains the insertion order of the keys. Look up is linear, which is not a problem for small maps (say less than 10 keys). If your map is large, you should use hash-map instead. From the docs https://clojuredocs.org/clojure.core/array-map