-
Notifications
You must be signed in to change notification settings - Fork 16
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
declarative schemas #11
Labels
Comments
How about describing schema in hiccup style (s/defschema Model
(st/schema
[:type/map {:description "Model description"}
[:size :type/int {:optional true
:default 0 :min 10 :max 20
:description "number 10-20"}]
[:gender :type/enum {:values [:male :female]
:default :male
:description "gender"}]])) |
Could be alternative, but it would need to be converted to "real" Schema representation by some function. And we still need the Schemas for min/max etc. |
Sure, I meant it as a way to describe schema by end user, like me, who just want's to model api ins and outs. Internally it can be the "real" Schema or whatever. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For web apps, Schemas are used to both validate & document the apis. Would be nice if one could create the schemas more declaratively. There could be a
schema
function in schema-tools that would read declarations (using multimethod dispatch) and create the needed schema structures for those.Something like:
The text was updated successfully, but these errors were encountered: