Open
Description
Hey friends, I've found a small difference between [:sequential {:max 1} schema]
and [:? schema]
when transformed with malli.json-schema
:
(m.js/transform
(m/schema
[:map {:closed true}
[:data [:?
[:map {:closed true}
[:id :int]
[:description [:maybe :string]]
[:name :string]]]]]))
; {:type "object",
; :properties {:data {}},
; :required [:data],
; :additionalProperties false}
(m.js/transform
(m/schema
[:map {:closed true}
[:data [:sequential {:max 1}
[:map {:closed true}
[:id :int]
[:description [:maybe :string]]
[:name :string]]]]]))
; {:type "object",
; :properties
; {:data
; {:type "array",
; :items
; {:type "object",
; :properties
; {:id {:type "integer"},
; :description {:oneOf [{:type "string"} {:type "null"}]},
; :name {:type "string"}},
; :required [:id :description :name],
; :additionalProperties false},
; :maxItems 1}},
; :required [:data],
; :additionalProperties false}
Is this intentional? If not, I can dig in to try to fix it.