Is there a way to change Malli's JSONSchema transformer at the function level as an option? I've noticed some differences with Zod's behaviour which is causing some trouble with LLM structured output APIs. Specifically :multi transforms to oneOf but Zod's z.discriminatedUnion transforms to anyOf with the discriminator key marked as 'required'.
you can set the :json-schema property for a malli schema, and that'll get used instead of the programmatically generated one
you could also define your own :multi2 and then add a (defmethod malli.json-schema/accept :multi2 ...) and extend the generation that way
in the general case malli can't do what you ask, since the :multi :dispatch can be an arbitrary function
I guess we could detect the common special case where it is a literal kw....
could you file an issue with some examples of malli & zod outputs? this might interest others as well.
Sure nws