-
Notifications
You must be signed in to change notification settings - Fork 257
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
Fix malli swagger defs w/ custom registries #589
Conversation
...so we can fix metosin#558.
...so that all of the absolute $ref's to them will resolve
@opqdonut I can merge master and resolve that conflict. Anything else needed in here? |
{:status 200 | ||
:body (meta-merge swagger {:paths paths})})) | ||
:body (meta-merge swagger {:paths paths :definitions definitions})})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update the existing tests and add a new one that uses a registry!
oh and you also need to bump the malli dep to 0.10.4 |
bump here: #597 |
right, that's now merged so @cap10morgan can just re-merge master |
Locally I'm getting an odd error trying to run the tests on this branch:
If you scroll through the stacktrace to the first mention of the test code, it's coming from here. This is confusing because I'm not sure how my changes would have caused this. Is the clue in the |
Looks to me like the problem is a response with a :responses {500 {:description "fail"}} A fix and a test for malli is probably the right solution to this. |
the malli fix is now out in 0.11.0 dep bump PR for reitit here: #607 |
Dep bump merged. Please merge master to this PR and the tests should pass! |
I merged master but still had a couple of test failures. I haven't had a chance to look into them yet but I will when I do. |
I updated the swagger test expectations in 182524b but let me know if those aren't good expectations (i.e. if you'd rather the actual result were different rather than the expected value). |
Yeah the changed assertions are fine! Could you add a test that uses the registry/definitions though? It's useful as documentation and a regression test even though this is mostly tested on the malli level. |
... and if you don't feel like working on those tests, just tell me. We can merge this and I'll add some tests. |
Happy to! But I probably won't get to them until tomorrow. If you don't want to wait on me, feel free to add them and merge. |
No great rush, but at some point we want to be able to get a release candidate out. I'm happy to wait for you for a week at least. |
test/cljc/reitit/swagger_test.clj
Outdated
:x-anyOf [{:type "object"} | ||
{:type "string"}]} | ||
::resp-map {:type "object"} | ||
::resp-string {:type "string", :minLength 1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the :definitions
are now on three levels: inside the :schema
, inside :put
and at the top level of the swagger spec. Is that what we want? By reading the spec, it seems only the top-level :definitions
is supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's not ideal. Only the top-level one gets used for anything I believe. Want me to explore eliminating the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can find an easy way to do that, it would be nice. I think swagger validators will complain about the intermediate ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The malli side of that work is in metosin/malli#900
I'm not sure how to point a leiningen project (or this leiningen project) at a git commit or a local working directory of malli to test that the new test expectations are correct. I tried adding e.g. Can you give me a pointer on how you all usually do that? Otherwise I can write up just enough of a deps.edn to run the tests and submit that too if desired. |
Deps-to-deps and lein-to-lein local dependencies would be easy. Unfortunately for deps-to-lein the easiest way is to install the malli jar in your local maven repository. See https://github.com/metosin/malli#installing-locally . I've done something like this:
|
Hmm... I did all that but I'm still getting the old output w/ non-root definitions in the swagger tests. Any idea why that might be? |
The currently-pushed tests fail for me with a new malli. This is what I did: In the malli repo:
Then in the reitit repo:
|
@opqdonut OK thank you for those detailed steps. I'll look into this again today and hopefully confirm that my local changes to the reitit tests are happy w/ the malli changes. |
@opqdonut Hmm... I still can't get it to use malli master HEAD for some reason. I'm still seeing non-root |
...which should only be at the top level now.
Here are the failures I'm getting for commit 59812a3 (with an unreleased malli). It looks like a bunch of FAIL in reitit.swagger-test/swagger-test (swagger_test.clj:352)
swagger-spec
expected: {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}},
:info {:title "my-api"},
:paths {"/api/malli/plus/{z}" {:get {:parameters [{:description "",
:format "int64",
:in "query",
:name :x,
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name :y,
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"},
:put {:parameters [{:description "",
:in "body",
:name "body",
:required true,
:schema {:additionalProperties {:$ref "#/definitions/reitit.swagger-test~1req-val"},
:type "object"}}],
:responses {200 {:description "",
:schema {:$ref "#/definitions/reitit.swagger-test~1resp-map",
:x-anyOf [{:$ref "#/definitions/reitit.swagger-test~1resp-map"}
{:$ref "#/definitions/reitit.swagger-test~1resp-string"}]}},
500 {:description "fail"}},
:summary "plus put with definitions"}},
"/api/schema/plus/{z}" {:get {:parameters [{:description "",
:format "int32",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int32",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}},
"/api/spec/plus/{z}" {:get {:operationId "GetPlus",
:parameters [{:description "",
:format "int64",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:options {:parameters [],
:responses {200 {:description "200"}},
:summary "options"},
:patch {:operationId "Patch",
:parameters [],
:responses {:default {:description ""}},
:summary "patch"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}}},
:swagger "2.0",
:x-id #{:reitit.swagger-test/math}}
actual: {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}},
:info {:title "my-api"},
:paths {"/api/malli/plus/{z}" {:get {:definitions nil,
:parameters [{:description "",
:format "int64",
:in "query",
:name :x,
:required true,
:schema nil,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name :y,
:required true,
:schema nil,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:schema nil,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:definitions nil,
:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:schema nil,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"},
:put {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}},
:parameters [{:description "",
:in "body",
:name "body",
:required true,
:schema {:additionalProperties {:$ref "#/definitions/reitit.swagger-test~1req-val"},
:type "object"}}],
:responses {200 {:description "",
:schema {:$ref "#/definitions/reitit.swagger-test~1resp-map",
:x-anyOf [{:$ref "#/definitions/reitit.swagger-test~1resp-map"}
{:$ref "#/definitions/reitit.swagger-test~1resp-string"}]}},
500 {:description "fail"}},
:summary "plus put with definitions"}},
"/api/schema/plus/{z}" {:get {:parameters [{:description "",
:format "int32",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int32",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}},
"/api/spec/plus/{z}" {:get {:operationId "GetPlus",
:parameters [{:description "",
:format "int64",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:options {:parameters [],
:responses {200 {:description "200"}},
:summary "options"},
:patch {:operationId "Patch",
:parameters [],
:responses {:default {:description ""}},
:summary "patch"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}}},
:swagger "2.0",
:x-id #{:reitit.swagger-test/math}}
diff: + {:paths {"/api/malli/plus/{z}" {:get {:definitions nil,
:parameters [{:schema nil}
{:schema nil}
{:schema nil}]},
:post {:definitions nil,
:parameters [nil
{:schema nil}]},
:put {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}}}}}}
FAIL in reitit.swagger-test/swagger-test (swagger_test.clj:359)
swagger-spec ring-async swagger-spec
expected: {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}},
:info {:title "my-api"},
:paths {"/api/malli/plus/{z}" {:get {:parameters [{:description "",
:format "int64",
:in "query",
:name :x,
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name :y,
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"},
:put {:parameters [{:description "",
:in "body",
:name "body",
:required true,
:schema {:additionalProperties {:$ref "#/definitions/reitit.swagger-test~1req-val"},
:type "object"}}],
:responses {200 {:description "",
:schema {:$ref "#/definitions/reitit.swagger-test~1resp-map",
:x-anyOf [{:$ref "#/definitions/reitit.swagger-test~1resp-map"}
{:$ref "#/definitions/reitit.swagger-test~1resp-string"}]}},
500 {:description "fail"}},
:summary "plus put with definitions"}},
"/api/schema/plus/{z}" {:get {:parameters [{:description "",
:format "int32",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int32",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}},
"/api/spec/plus/{z}" {:get {:operationId "GetPlus",
:parameters [{:description "",
:format "int64",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:options {:parameters [],
:responses {200 {:description "200"}},
:summary "options"},
:patch {:operationId "Patch",
:parameters [],
:responses {:default {:description ""}},
:summary "patch"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}}},
:swagger "2.0",
:x-id #{:reitit.swagger-test/math}}
actual: {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}},
:info {:title "my-api"},
:paths {"/api/malli/plus/{z}" {:get {:definitions nil,
:parameters [{:description "",
:format "int64",
:in "query",
:name :x,
:required true,
:schema nil,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name :y,
:required true,
:schema nil,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:schema nil,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:definitions nil,
:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name :z,
:required true,
:schema nil,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {:total {:format "int64",
:type "integer"}},
:required [:total],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"},
:put {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}},
:parameters [{:description "",
:in "body",
:name "body",
:required true,
:schema {:additionalProperties {:$ref "#/definitions/reitit.swagger-test~1req-val"},
:type "object"}}],
:responses {200 {:description "",
:schema {:$ref "#/definitions/reitit.swagger-test~1resp-map",
:x-anyOf [{:$ref "#/definitions/reitit.swagger-test~1resp-map"}
{:$ref "#/definitions/reitit.swagger-test~1resp-string"}]}},
500 {:description "fail"}},
:summary "plus put with definitions"}},
"/api/schema/plus/{z}" {:get {:parameters [{:description "",
:format "int32",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int32",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int32",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:additionalProperties false,
:properties {"total" {:format "int32",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}},
"/api/spec/plus/{z}" {:get {:operationId "GetPlus",
:parameters [{:description "",
:format "int64",
:in "query",
:name "x",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "query",
:name "y",
:required true,
:type "integer"}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus"},
:options {:parameters [],
:responses {200 {:description "200"}},
:summary "options"},
:patch {:operationId "Patch",
:parameters [],
:responses {:default {:description ""}},
:summary "patch"},
:post {:parameters [{:description "",
:in "body",
:name "body",
:required false,
:schema {:items {:format "int64",
:type "integer"},
:type "array",
:x-nullable true}}
{:description "",
:format "int64",
:in "path",
:name "z",
:required true,
:type "integer"}],
:responses {200 {:description "",
:schema {:properties {"total" {:format "int64",
:type "integer"}},
:required ["total"],
:type "object"}},
400 {:description "kosh",
:schema {:type "string"}},
500 {:description "fail"}},
:summary "plus with body"}}},
:swagger "2.0",
:x-id #{:reitit.swagger-test/math}}
diff: + {:paths {"/api/malli/plus/{z}" {:get {:definitions nil,
:parameters [{:schema nil}
{:schema nil}
{:schema nil}]},
:post {:definitions nil,
:parameters [nil
{:schema nil}]},
:put {:definitions {:reitit.swagger-test/req-key {:type "string",
:x-anyOf [{:type "string"}
{:type "string"}]},
:reitit.swagger-test/req-val {:type "object",
:x-anyOf [{:type "object"}
{:type "string"}]},
:reitit.swagger-test/resp-map {:type "object"},
:reitit.swagger-test/resp-string {:minLength 1,
:type "string"}}}}}}
FAIL in reitit.swagger-test/multipart-test (swagger_test.clj:499)
#'reitit.coercion.malli/coercion
expected: [{:description "",
:in "formData",
:name "file",
:required true,
:type "file"}
{:description "",
:in "formData",
:name "more",
:required true,
:type "string"}]
actual: [{:description "",
:in "formData",
:name "file",
:required true,
:schema nil,
:type "file"}
{:description "",
:in "formData",
:name "more",
:required true,
:schema nil,
:type "string"}]
diff: + [{:schema nil} {:schema nil}]
Ran 109 tests in 22.809 seconds
14088 assertions, 3 failures, 0 errors. |
FYI I'm going on a long vacation, but I hope @ikitommi will pick up reviewing this. |
Hi, any news on this pull request being merged to reitit/master? Is there something I can do to assist? |
1 similar comment
Hi, any news on this pull request being merged to reitit/master? Is there something I can do to assist? |
This PR is still waiting for someone to fix the test failures (see my long comment above). I've been assuming @cap10morgan will do it, but if they're stuck, I can also have a look at some point. |
Yeah I wasn't sure what else to try here short of just using tools.deps everywhere to integrate the local library modifications. It seemed like it was using the locally-installed libs but then exhibiting the pre-modification behavior. |
This conflicts with Tommi's #628. I'll rework this PR and get it in. |
Fixes #558
Relies on the changes in metosin/malli#863
Lifts the
definitions
to the root of theswagger.json
document so that all of the$ref
s to them can resolve. Also fixes some naming / encoding issues with them and a circular ref problem I was noticing where sometimes a definition would just become a ref to itself.