Comments (2)
Keywords should be the default, schemas and types are more than predicates. Also keyword serialization is trivial while predicates are a special case there as well.
from malli.
I also like the type-schemas as a better default. Still, the first alpha should ship with both, as basically every pre-alpha user (us included) is using the predicates already. For 1.0.0, we can revisit the default.
For people, who already care, it's relatively easy just to pick either one, by creating a custom registry and picking just either one:
(def registry
(merge
(predicate-schemas) ;; drop this
(type-schemas) ;; or this
(class-schemas)
(comparator-schemas)
(base-schemas)))
, the impls being currently:
(defn predicate-schemas []
(->> [#'any? #'some? #'number? #'integer? #'int? #'pos-int? #'neg-int? #'nat-int? #'pos? #'neg? #'float? #'double?
#'boolean? #'string? #'ident? #'simple-ident? #'qualified-ident? #'keyword? #'simple-keyword?
#'qualified-keyword? #'symbol? #'simple-symbol? #'qualified-symbol? #'uuid? #'uri? #?(:clj #'decimal?)
#'inst? #'seqable? #'indexed? #'map? #'vector? #'list? #'seq? #'char? #'set? #'nil? #'false? #'true?
#'zero? #?(:clj #'rational?) #'coll? #'empty? #'associative? #'sequential? #?(:clj #'ratio?) #?(:clj #'bytes?)]
(reduce -register-var {})))
(defn type-schemas []
{:string (-string-schema)
:int (-int-schema)
:double (-double-schema)
:boolean (-boolean-schema)
:keyword (-keyword-schema)
:symbol (-symbol-schema)
:qualified-keyword (-qualified-keyword-schema)
:qualified-symbol (-qualified-symbol-schema)
:uuid (-uuid-schema)})
from malli.
Related Issues (20)
- Unparsing map value by catn schema does not always keep entry positional order HOT 2
- mu/assoc fails when used with mu/get and local registry HOT 2
- `strip-extra-keys-transformer` behavior changed after version 0.10.3 HOT 2
- `:map` with default key merged with `[:map {:closed true}]` results in virtually open map HOT 1
- Add malli.generator support for :gen/return
- mx/defn + pretty thrower = Exception message always says 'nil' in 'Function Var'
- Validate :or on map keys HOT 2
- function schemas that can use input values in output schemas HOT 4
- Wrong number of args (5) passed to: clojure.lang.PersistentVector Error
- Problematic execution order of decode/encode HOT 2
- malli.core/schema doesn't work for lists HOT 1
- Pluggable Pretty printing of exception via malli.core/-fail!
- Decoding with seqexp doesn't decode numbers properly
- malli.core/into-schema? returns true i.f.f. implements protocol interface (not protocol) HOT 5
- Feature: extend-protocol IntoSchema for java.lang.Class and protocols HOT 5
- Multiple error messages and error paths from :fn validation HOT 2
- Malli ExceptionInfo is not enough to figure out where the exception occurred HOT 2
- Humanize gobbles some errors when interacting with :vector HOT 2
- Custom validation functions: Allow programmatically defining `:error/path`
- Default pretty printer not compatible with cider (and more?) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from malli.