malli

richiardiandrea 2025-03-06T23:03:21.628769Z

Hi all, I got a bunch of pointer missing errors for my swagger :ref s when using malli - I think that's because these live in a registry - is there a way to pass them down to create-swagger-handler?

richiardiandrea 2025-03-06T23:14:01.245669Z

Ok I see the :registrykey on schemas - that seems to require the mc/schema wrapper

richiardiandrea 2025-03-06T23:30:10.055539Z

Ok I think I see what is going on - we register malli spec with a namespace: (r/register! :survey/site-type [:enum ...]) and the ref is "#ref": "$ref":"#/definitions/survey~1site-type" while the declaration is "definitions:{"survey/site-type": ...} worth filing a bug (and fix with some hint at the location)?

opqdonut 2025-03-07T10:28:44.355609Z

hmmm ISTR that the actual key can still contain / , but it needs to be encoded as ~1 in the $ref

opqdonut 2025-03-07T10:29:28.821879Z

it's been quite some time since I touched this code

opqdonut 2025-03-07T10:29:59.763239Z

feel free to report the issue anyway so I'll remembed to investigate

richiardiandrea 2025-03-07T17:33:02.241869Z

will open an issue - is this malli or reitit ?

richiardiandrea 2025-03-07T17:33:12.164589Z

thank you for your answers folks

opqdonut 2025-03-10T05:59:48.457279Z

malli, I think

richiardiandrea 2025-03-10T17:20:57.248259Z

oh - I opened it here but I can do another one https://github.com/metosin/malli/issues/1172

richiardiandrea 2025-03-11T16:38:28.655389Z

Moved the issue to malli

👀 1
2025-03-07T00:20:58.727709Z

Not sure, there's this comment:

;; '/' must be encoded as '~1' in JSON Schema - 
    {:$ref (apply str definitions-path (str/replace ref #"/" "~1"))}))

2025-03-07T00:21:58.554119Z

I guess the declaration should be updated to use ~1?

2025-03-07T00:22:24.393399Z

Yeah, that seems like a bug worth filing.

👍 1