heys folks, any way to set constrained between two keys
of the same schema?
@quieterkali try s/constrained
with schema and a custom function.
ok @ikitommi will try that now π
what i am doing wrong here please?
(s/defschema ProfileConnector
"Schema for profile's connexion"
{:profile-one IdProfile
:profile-two (s/constrained IdProfile #(not (= :profile-one %)))})
validation is not being applied π
IdProfile
is another costum validation and is working fine
You need to constrain the map-schema.
i'll be right back
thanks π
(s/constrained
{:profile-one IdProfile
:profile-two IdProfile}
#(not= (:profile-one %) (:profile-two %))
'profiles-should-differ)
@ikitommi you saved my day, thank you very much π
and i learnt that i can consstrained the whole schema, this is very very very handy
happy to help
Hello channel ! If I do this :body-params [x :- Long y :- Long]
in a request handler, then the βparametersβ value in swagger.json contains a generated schema, which is named something like Body17343
, which contains my x
and y
definitions. Is there a way to give this automatic schema a name, while preserving the x and y bindings ?