ring-swagger

ring-swagger & compojure-api
ikitommi 2019-03-21T20:22:07.053200Z

@slipset pushed spec-tools 0.9.1 with the visitable st/merge (added also to json-schema), thanks!

slipset 2019-03-21T20:23:10.054100Z

Well, thank you!

slipset 2019-03-21T20:30:01.056Z

Should I create an issue for the merge case I mentioned above?

slipset 2019-03-21T20:30:37.056900Z

I didn’t manage to narrow it down super easily, but could spend some time doing that if it’s interesting for you.

slipset 2019-03-21T20:31:11.057300Z

I might also outline why I’m doing this:

slipset 2019-03-21T20:31:35.057800Z

Our entities, if you will, have a spec for their fields eg

slipset 2019-03-21T20:32:01.058400Z

(s/def ::foo (s/keys :req-un [:name :description]))

slipset 2019-03-21T20:33:04.059600Z

This is what you’d need to send to the api in order to create a foo. The api however returns this with some metadata, so the return has more fields than the input.

slipset 2019-03-21T20:33:52.060600Z

Also, there is a difference in the spec for wether it’s a create or an update. a create only contains :name and :field as above, but the update also needs an :id

slipset 2019-03-21T20:34:57.061900Z

My idea was then to generate these additional specs based on the spec for foo which only contained the user supplied fields, :name and :description.

slipset 2019-03-21T20:35:00.062100Z

Does this make sense?