Comments (4)
Yes, this is because of the auto-flattening of sequence schemas so it's a feature. You can escape it by wrapping it with non-sequence schema like :schema
:
(mx/defn ^:malli/always f [xs :- [:schema [:* :int]]]
(malli.core/validate [:* :int] xs))
or just use non-sequential like :vector
:
(mx/defn ^:malli/always f [xs :- [:vector :int]]
(malli.core/validate [:* :int] xs))
I don't think we should change this, maybe just document this into https://github.com/metosin/malli/blob/master/docs/function-schemas.md. PR most welcome on this.
from malli.
would you have time to document this? e.g. PR most welcome
from malli.
from malli.
No auto-wrapping now, flattening is needed to describe Varargs. Thanks!
from malli.
Related Issues (20)
- :and should short-circuit explanation - in some cases HOT 1
- Swagger JSON missing global definitions from schema used in request spec HOT 2
- mx/defn and optional named arguments? HOT 4
- malli.dev.cljs/start! no longer prints errors for instrumented functions in the console HOT 2
- Invalid Swagger JSON with [:or :nil] alternatives HOT 1
- Feature: Using Java classes as schemas HOT 2
- Not supported 3.1.0 openapi schema HOT 1
- Is it possible to represent an increasing sequence? HOT 1
- Parser losing metadata? HOT 1
- function guard should be instrumented by default HOT 1
- Nested map destructuring in `mx/defn` wraps extra collection
- Instrumenting multimethods? HOT 3
- json-transformer should coerce doubles with zero fractional part to longs HOT 1
- Support masked Var References in JSON Schema / Swagger
- :and has different behavior when using a registry HOT 3
- Wrapping fn args in a multi-schema HOT 1
- Feature Request: ClojureDart Support HOT 1
- m/deref-recursive doesn't play nice with :merge schema HOT 2
- properties are not preserved by the `:merge` schema HOT 3
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.