Skip to content
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

json-schema generation, specifying :additionalProperties #716

Closed
NoahTheDuke opened this issue Jun 29, 2022 · 0 comments · Fixed by #719
Closed

json-schema generation, specifying :additionalProperties #716

NoahTheDuke opened this issue Jun 29, 2022 · 0 comments · Fixed by #719

Comments

@NoahTheDuke
Copy link
Contributor

Hey friends,

I have this schema:

(def Item
  (m/schema
    [:map {:closed true}
     [:description [:maybe :string]]
     [:id :int]
     [:name :string]
     [:type :string]]))

Calling malli.json-schema/transform on it returns:

{:type "object",
 :properties
 {:description {:oneOf [{:type "string"} {:type "null"}]},
  :id {:type "integer"},
  :name {:type "string"},
  :type {:type "string"}},
 :required [:description :id :name :type]}

I would like it if {:closed true} would set :additionalProperties false, which would align it with the spec.

Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant