metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.48k stars 210 forks source link

Remove non-root swagger definitions #900

Closed cap10morgan closed 1 year ago

cap10morgan commented 1 year ago

As per discussion in https://github.com/metosin/reitit/pull/589#discussion_r1174793547 this removes the non-root :definitions from the swagger output.

cap10morgan commented 1 year ago

I removed all of the trailing commas in the swagger-test data in https://github.com/metosin/malli/pull/900/commits/26bda9b12bbc14b00f5006aab59fb52423ffba3c, but let me know if you'd rather I not do that. I was having to remove the ones from the deleted non-root definitions in the test expectations and decided it might be better to just clean it all up in one commit first.

cap10morgan commented 1 year ago

The one failing test also failed before my changes.

opqdonut commented 1 year ago

Thanks for removing the commas in a separate commit!

All tests seem to pass now. The failures were caused by a clojars outage, but now all the deps downloaded fine and the tests passed as well.

I have a nagging thought that the :definitions inside :schema might be worth leaving in. I'll investigate a bit and see what various validators say.

opqdonut commented 1 year ago

Ok, we only need the top-level :definitions since all the references are of the form "$ref": "#/definitions/.... I think this is good to go.

cap10morgan commented 1 year ago

OK, and now with this merged reitit-malli's test expectations need to be updated, at least. I'll work up a PR for that push those changes to the existing PR later today.