profile
viewpoint

domino-clj/domino 127

A Clojure/Script data flow engine

cljdoc/clojars-stats 3

DEPRECATED An API to access predefined queries over Clojars' download statistics https://github.com/cljdoc/clojars-stats/issues/5

ikitommi/com.tbaldridge.hermod 1

A mailbox based distributed computing library

ikitommi/agent2 0

2-way non-blocking messags for Clojure Agents

ikitommi/aleph 0

asynchronous communication for clojure

ikitommi/astar 0

Pathfinding using A* algorithm

ikitommi/awesome-clojure 0

A curated list of awesome Clojure libraries and resources. Inspired by awesome-... stuff

ikitommi/backtick 0

Clojure's syntax-quote reader macro as a normal macro

ikitommi/bacon.js 0

FRP (functional reactive programming) library for Javascript

ikitommi/badigeon 0

A Clojure build library based on tools.deps.

pull request commentmetosin/malli

Initial implementation of json-schema import

Looking forward to this. Related project: https://github.com/akovantsev/json-schema-to-clojure-spec

hkupty

comment created time in 17 minutes

issue commentmetosin/malli

Feature request or bug: adding properties directly to map keys.

Not happy with merge as the properties would be copied to children, potentially masking child properties. Also, things like serialization and walking over schemas would just see the copied properties.

(m/form [:map [:x {:optional true} :string]])
; => [:map [:x {:optional true} [:string {:optional true}]]]

In top-level, I guess the options are:

1) it's a feature

  • entry meta is just for itself (e.g. :optional)
  • having extra keys could later give warning
  • doesn't resolve things, kinda sucks

2) have a generic way for childs to access the parent data

  • pushes all the work to extensions & user provided code
  • sucks, big time

3) have a way for each schema application (transformation, value generation etc) to resolve this

  • applications use the properties differently (some short-circuit (generators), some go too deep (e.g. errors)) -> but only once per application (e.g. the generic code which pulls errors messages, looks one step up too)
  • would yield "just works", user provided code for a given application doesn't have to know about this
  • might be a good goal
  • need to implement and see if this is better than 1

... for the 3, there are few options, but I'll take the simplest path first and create a draft PR for reviews, have a good hunch how to do that without too many tears.

johesoman

comment created time in 11 hours

push eventmetosin/malli

Tommi Reiman

commit sha 1c6479176e47ae65a74ad9c501b2a8d67201c50c

Initial malli->mermaid conversion

view details

Tommi Reiman

commit sha b1e82834f5f69e7d4edad87dd78dbe40a5f61d12

works with cljs, uml -> class-diagram

view details

Tommi Reiman

commit sha bf156d397102f357a148eaf7acf3b6094e6ac3b3

Collect maps and enums only

view details

Tommi Reiman

commit sha 39a4ba1a4c17bf6b76dc0dab0c8f90724f48888d

Simplify

view details

Tommi Reiman

commit sha e3f9077e2c1dee6f0d05c5309d36c7586a60b2c9

cleanup

view details

Tommi Reiman

commit sha 82f08a93a5c56544a7c65a4b252be79373296cf3

Mermaid from local registry

view details

Tommi Reiman

commit sha a6abc0712133dd28b9195c42ff5e14dfd3180d9c

Consistent order

view details

Tommi Reiman

commit sha 59b14f21082d09a3a929b6dcea051417e84508e2

print the forms, not schemas (works on cljs too)

view details

Tommi Reiman

commit sha f57d4da906f74958cd6160961ee414ceb282f326

testing :min, :max and :gen/min & :gen/max on sequential schemas

view details

Tommi Reiman

commit sha 075f5ff878f3ab318f2843be64ab64823a1e7878

:string gen with min & max

view details

Tommi Reiman

commit sha 32dc790caf268ec793943a16d455e021485d362c

fix

view details

Tommi Reiman

commit sha a992edec3fbb69988067eb3330b48313fb17c497

Merge pull request #198 from metosin/MalliMermaid malli->mermaid class diagrams & :gen/min :gen/max

view details

push time in 20 hours

PR merged metosin/malli

malli->mermaid class diagrams & :gen/min :gen/max

Two things:

:gen/min & :gen/max

Ability to override :min & :max for collections & :string. Throws for invalid values:

(every? #(<= 10 % 20) (map count (mg/sample [:vector {:gen/min 10, :gen/max 20}] {:size 1000})))
; => true

(mg/generate [:string {:min 2, :gen/min 1}])
; Execution error (ExceptionInfo)
; :malli.generator/invalid-property {:key :gen/min, :value 1, :min 2}

schema visualization

Inspired by schema-viz.

Given a schema:

(def Order
  [:schema
   {:registry {"Country" [:map
                          [:name [:enum :FI :PO]]
                          [:neighbors [:vector [:ref "Country"]]]]
               "Burger" [:map
                         [:name string?]
                         [:description {:optional true} string?]
                         [:origin [:maybe "Country"]]
                         [:price pos-int?]]
               "OrderLine" [:map
                            [:burger "Burger"]
                            [:amount int?]]
               "Order" [:map
                        [:lines [:vector "OrderLine"]]
                        [:delivery [:map
                                    [:delivered boolean?]
                                    [:address [:map
                                               [:street string?]
                                               [:zip int?]
                                               [:country "Country"]]]]]]}}
   "Order"])

Creating mermaid class diagrams:

(require '[malli.mermaid :as mermaid])

(mermaid/class-diagram Order)
"classDiagram
   class Burger {
     :description string?
     :name string?
     :origin [:maybe Country]
     :price pos-int?
   }
   class Country {
     :name [:enum :FI :PO]
     :neighbors [:vector [:ref Country]]
   }
   class Order {
     :delivery Order_Delivery
     :lines [:vector OrderLine]
   }
   class OrderLine {
     :amount int?
     :burger Burger
   }
   class Order_Delivery {
     :address Order_Delivery_Address
     :delivered boolean?
   }
   class Order_Delivery_Address {
     :country Country
     :street string?
     :zip int?
   }
   Burger o-- Country
   Country o-- Country
   Order o-- OrderLine
   Order *-- Order_Delivery
   OrderLine o-- Burger
   Order_Delivery *-- Order_Delivery_Address
   Order_Delivery_Address o-- Country"

Producing:

mermaid

+214 -21

1 comment

5 changed files

ikitommi

pr closed time in 20 hours

push eventmetosin/malli

Tommi Reiman

commit sha 32dc790caf268ec793943a16d455e021485d362c

fix

view details

push time in 20 hours

push eventmetosin/malli

Tommi Reiman

commit sha f57d4da906f74958cd6160961ee414ceb282f326

testing :min, :max and :gen/min & :gen/max on sequential schemas

view details

Tommi Reiman

commit sha 075f5ff878f3ab318f2843be64ab64823a1e7878

:string gen with min & max

view details

push time in 20 hours

push eventmetosin/malli

Tommi Reiman

commit sha 59b14f21082d09a3a929b6dcea051417e84508e2

print the forms, not schemas (works on cljs too)

view details

push time in 21 hours

push eventmetosin/malli

Tommi Reiman

commit sha a6abc0712133dd28b9195c42ff5e14dfd3180d9c

Consistent order

view details

push time in 21 hours

push eventmetosin/malli

Tommi Reiman

commit sha 82f08a93a5c56544a7c65a4b252be79373296cf3

Mermaid from local registry

view details

push time in 21 hours

pull request commentmetosin/malli

Add :map qualified keyword child syntax

Will get back to this after #86 is resolved. Sorry for taking so long.

kwrooijen

comment created time in a day

push eventmetosin/spec-tools

Wanderson Ferreira

commit sha e6337be34ddbae26227864a2fdccdf8c27105754

spec coll-of distinguish between set and vector data types

view details

Wanderson Ferreira

commit sha 503d5345a5188be46a5d57eaf169ae9727b3ac5d

fix map-of-spec cpred check to verify for explicit maps

view details

Tommi Reiman

commit sha a96abb464d4a4e20c41581183d902683b5167615

Merge pull request #239 from wandersoncferreira/bugfix/match-data-type spec coll-of distinguish between set and vector data types

view details

push time in 2 days

PR merged metosin/spec-tools

spec coll-of distinguish between set and vector data types

Fixes the bug reported at #237 . Seems like the function impl/coll-of-spec has a property called cpred which was default to coll? however, both sets and vectors returns true to coll?. I made a change to verify the type of argument passed to the function, so the cpred is chosen apropriately.

Thus the OP example now has the expected behavior:

(s/valid? (ds/spec ::x #{int?}) #{1 2 3})  ;; => true
(s/valid? (ds/spec ::x #{int?}) [1 2 3])  ;; => false
+16 -3

1 comment

2 changed files

wandersoncferreira

pr closed time in 2 days

issue commentmetosin/malli

Make SCI dependency optional for smaller JS builds

thanks, will try that :)

Naomarik

comment created time in 2 days

push eventmetosin/spec-tools

Roman Rudakov

commit sha 22d072894e104fe1069a07607d7a3fbddfbf6bbc

Add spec for OpenAPI3

view details

Roman Rudakov

commit sha a2720bface59cca0e3700696c85da2513d8d098c

Start implementation of swagger generation for OpenAPI3

view details

Roman Rudakov

commit sha d2da5dc847cd1bc4243deee094f7eb52cf817a22

Add accept-spec methods for OpenAPI3 core

view details

Roman Rudakov

commit sha 666c9f7f3c2b668ec179c84e6f213f5afe1211b2

Add expand multimethod for openapi3 and some default dispatches

view details

Roman Rudakov

commit sha 9d878a7587c95618672663685d8e566c75fb88b3

Start unit tests for openapi3 core

view details

Roman Rudakov

commit sha e06f4d22f48ebc80911c183779d1467cf9b75561

Add unit tests for openapi3 core and fix some spec conversion

view details

Roman Rudakov

commit sha 5090e5405836688b2efc08252b16b90b887598d3

OpenAPI3: Handle nilable, extend headers and content

view details

Roman Rudakov

commit sha ff670b1ac394fbf9b33849bbf4362fd24885fba0

OpenAPI3: Add documentation

view details

Roman Rudakov

commit sha 9b3d2553a29568fcd0940436b882b24d672588a7

OpenAPI3: Add more documentation

view details

Roman Rudakov

commit sha 029b5f38877b6b43b98753b7ee6795ab6a18e6a6

OpenAPI3: Finish docs, add more unit tests, fix spec

view details

Roman Rudakov

commit sha 62565ac87a100a0f10185c67b495a738dd32b5a2

OpenAPI3: renamed openapi3 -> openapi

view details

Tommi Reiman

commit sha d70dfe3f3695d703a9736c215ab67daa4ab405ae

Merge pull request #236 from rrudakov/openapi3 OpenAPI3 support

view details

push time in 2 days

PR merged metosin/spec-tools

OpenAPI3 support

Known issues:

  • Project uses ring-swagger as dependency to validate generated swagger schema. Ring-swagger uses swagger2 specs so I can't write test to validate OpenAPI3 generated schema at the moment.
  • Any string can be used for content-type value
  • Callbacks in operations are not supported by current OpenAPI3 spec due to circular spec calls. I can declare callbacks as {string? any?} but I don't think it's a good idea.
+1626 -10

4 comments

7 changed files

rrudakov

pr closed time in 2 days

pull request commentmetosin/spec-tools

OpenAPI3 support

Big thanks!!

rrudakov

comment created time in 2 days

push eventmetosin/malli

Tommi Reiman

commit sha 4b279a98e9fb5c0a478635716cac9d0c6506ab37

Update README.md Add CEST talk, document map keys, fixes #189

view details

Tommi Reiman

commit sha ee150c75de1ee079f483c18bd88047453ffafa78

Update README.md document `:fn` properly

view details

Tommi Reiman

commit sha b07d17441be7a4ef8463f9cc1eb2ba55264851f4

welcome :string schema

view details

Tommi Reiman

commit sha 1cbae922d2d9c343e0e2868645bd1a73c0615e17

string errors

view details

Tommi Reiman

commit sha 51939bd076ab54288c68c4bda4e772dd5f68e1e7

Fix tests

view details

Tommi Reiman

commit sha 043046331444dd2ed169e568f591a92237f2933b

Merge pull request #205 from metosin/string welcome :string schema

view details

Tommi Reiman

commit sha 85101d12231b860702febbd09169b9226fb6e132

Update README

view details

Tommi Reiman

commit sha 2912e43b09fd89c410e35a09e23bd62e4e50e54e

Initial CHANGELOG

view details

Tommi Reiman

commit sha 5f16b75c1f91f9b2494387a0589d6d9619262fcb

Generator protocol, -generator => -schema-generator

view details

Tommi Reiman

commit sha dc5479e927accbaf7261f26aaa90e9b3bd1fc41a

Test the protocol

view details

Tommi Reiman

commit sha 449c7da5e8dc1c27fa3f5650ce913a81e4f18ab9

JsonSchema protocol

view details

Tommi Reiman

commit sha 7bd3221a8d33ece60dcfee6f95a3a5189c833e7f

SwaggerSchema & fixes to namespaced keys

view details

Tommi Reiman

commit sha ae13e3897e0cc1049c8b1bc335818ff22c14c31c

SchemaError

view details

Tommi Reiman

commit sha 93e2b5e99d7f17addf8eb353e38d9f879b399659

Fix generator tests

view details

Tommi Reiman

commit sha c0c0691ccf50fb5fc17c70021f74096fc56ca8c4

Tip to trim strings

view details

Tommi Reiman

commit sha f39b74511bdcf0dee5775458212f74c1481d6257

Fix rebase, generate full strings

view details

Tommi Reiman

commit sha d9e29fedc967791f49864b373a78099c14a5cee7

Merge pull request #204 from metosin/protocols Protocol Extensions

view details

Tommi Reiman

commit sha 10ba8b963ac419ee33729315c3defb936587447c

Update CHANGELOG

view details

Tommi Reiman

commit sha 678e754f94ba7a7f43ba75b9d132bef17f7c899f

rename m/name to m/type

view details

Tommi Reiman

commit sha a843468c0ebd48899fb8eb4e6324331c89b510bc

.

view details

push time in 3 days

push eventmetosin/malli

Tommi Reiman

commit sha dab8a45a09b19d04688485d8e96540a08fcc4773

fix :multi recursion test

view details

push time in 3 days

push eventmetosin/malli-web

Tommi Reiman

commit sha f9956a5287d8f44ec05bfbe84ba57584bf066333

fix

view details

push time in 4 days

push eventmetosin/malli-web

Tommi Reiman

commit sha eb3e38c6ed1c72c970db880dcc849f845ef2fdfc

Humanized errors

view details

push time in 4 days

startedborkdude/dynaload

started time in 4 days

push eventmetosin/malli-web

Tommi Reiman

commit sha 61d164cd8fbcaa9a05b57e4782aad79e13b99b3c

indicator

view details

push time in 4 days

push eventmetosin/malli-web

Tommi Reiman

commit sha 61e672d0077ddb551718ae6f2c424e99b201b8fc

new version

view details

push time in 4 days

push eventmetosin/malli-web

Tommi Reiman

commit sha fd84eda79766a82f38334e54bb46b415df89e586

Update deps, recursion samples, debounce 500->1000

view details

push time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha 2c978df4c860a40280f71650d3399078223fefac

recursion limit 5->4

view details

push time in 4 days

issue commentmetosin/malli

Things to be decided before initial stable release

one to go.

ikitommi

comment created time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha 8b7bb9d16d045b86618c4a43f1dc15c21f44e9bc

Update (c)

view details

push time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha 06aae0a1e7598585a9c32b65c072cddc74fb2fb3

Update README

view details

push time in 4 days

PR closed metosin/malli

Recursive schema

PR to start a conversation about recursive schemas, a prerequisite for json-schema->malli conversion

I added an entry for base-registry that accepts :recursive as a schema

This enables us to define recursive schemas even without using the registry. Something like

[:map
  [:name string?]
  [:parent {:optional true} :recursive]]

I think we need to deal to schemas like :recursive, [:and :recursive], [:or :recursive] or anything that doesn't have any real value and can lead to StackOverflow on evaluation

I was thinking in maybe support loop/recur, with something like:

[:map 
  [:family {:malli/loop :family-member}
    [:map 
      [:name string?]
      [:parent [:recursive :family-member]]]]]

What do you think?

+65 -12

40 comments

3 changed files

RafaeLeal

pr closed time in 4 days

pull request commentmetosin/malli

Recursive schema

thanks @RafaeLeal for the original draft, and for everyone for the comments. merged #209 master. Post-comments still welcome.

RafaeLeal

comment created time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha 427a1cdd56e1b2e8b33b6982e9792119e53c8a5f

m/-chidlren, polish out core things

view details

Tommi Reiman

commit sha e6426b096fa03cf74a6aaf0b80111a133265d616

:ref schema

view details

Tommi Reiman

commit sha b4b28e0167a57618c4e53300184e9c98dca6430b

polish code

view details

Tommi Reiman

commit sha eaea510e63c4ebce64d66b0ce69bfc6101f3abcf

Support for mutual recursion via registry

view details

Tommi Reiman

commit sha 88520443a1c82b267b8cbd5217356ee99c3f92ea

Handle local vs registry ref ambiguity

view details

Tommi Reiman

commit sha f503222c9f04887b4fcba4fed3f505fd575788fa

Better schema errors on missing schema elements

view details

Tommi Reiman

commit sha f7f760e7770efe95136f1b77c199f6e09314ec40

welcome :registry

view details

Tommi Reiman

commit sha 2e2c7dd50b11efb14f9bea51e3b1c254b29f70b7

Add tests

view details

Tommi Reiman

commit sha 6fea381b0304e6bd661ee5f098e2c63fde79fcec

Added tests, clj only TODO: cljs fails on maximum call stack

view details

Tommi Reiman

commit sha 496ff82751cfb8cf984188a661eef1d86fdd889d

Support property :registry anywhere

view details

Tommi Reiman

commit sha 7cbd3bdf31bec12b5b729d1bf87a7469f3c62469

fix test

view details

Tommi Reiman

commit sha 25b41ded4694b542eea094767add598b7f3b67fe

remove the :registry

view details

Tommi Reiman

commit sha ca9f32665669ab3278e7c97099557af3a7163e08

optimize :and with single branch

view details

Tommi Reiman

commit sha 32dd6e3142bafb72ca97aca062c4bcc998bdd51d

welcome :schema!

view details

Tommi Reiman

commit sha db31c012eb519c9c202885e14f193d0b3adc2db6

raise ref-max

view details

Tommi Reiman

commit sha 7a18cbf7d5e9049fb69360a90b19be48f8619bdb

fast :or validator with 1 distict child

view details

Tommi Reiman

commit sha 63b9d520460c0b934827549392863581c33698a9

Bye bye local recursion, welcome :malli.core/schema (for durable eager schema links)

view details

Tommi Reiman

commit sha dffd9abc9c6b4072e885bb34275ac8552ad56d1b

README

view details

Tommi Reiman

commit sha a6a1a7dfea503f8b734d5151f3fc320304ad288a

docs

view details

Tommi Reiman

commit sha 6e7a4d3b613423425324ed8fee56d1c06926c22c

docs

view details

push time in 4 days

PR merged metosin/malli

Recursive Schemas Impl

Displaces impl from #117, which will remain a place to discuss & history. FIxs #20 .

  • new m/Schema method -children to get child schemas instances too
  • :multi implements m/MapSchma
  • new m/RefSchma protocol with the following impls:
    • :ref - a lazy reference, enabling recursion
    • :schema, like m/schema (entity) but in data, eager
    • malli.core/schema, eager schema (value) ref, used internally. if no properties and child is a qualified keyword, derived form from the child
  • support for local :registry in any element
  • validators, explainers etc are moved from schema creation to actual m/Schema methods, to support laziness
  • m/-distance and m/-lookup helpers
  • m/from-map-syntax works with non-map child's (enums, refs)
  • updated README (local registry, recursive schemas)

TODO

  • [x] :schema for non-lazy references (retains original information)
  • [x] local recursion using :id
  • [x] local mutual recursion using :registy
  • [x] new element to ensure local registries as data
  • [x] ambiguity rules
  • [x] ensure it's done right

Current syntax:

(testing "recursion limiting"
  (are [schema]
    (is (every? (partial m/validate schema) (mg/sample schema {:size 1000})))

    ;; maybe
    [:schema {:registry {::rec [:maybe [:ref ::rec]]}}
     ::rec]

    ;; maps
    [:schema {:registry {::rec [:map [:rec {:optional true} [:ref ::rec]]]}}
     ::rec]

    ;; or
    [:schema {:registry {::tuple [:tuple boolean? [:ref ::or]]
                         ::or [:or int? ::tuple]}}
     ::or]

    ;; multi
    [:schema {:registry {::multi
                         [:multi {:dispatch :type}
                          [:int [:map [:type [:= :int]] [:int int?]]]
                          [:multi [:map [:type [:= :multi]] [:multi [:ref ::multi]]]]]}}
     [:ref ::multi]]))

Initial Syntax:

(support for local recursion removed)

malli-rec

+542 -185

1 comment

7 changed files

ikitommi

pr closed time in 4 days

pull request commentmetosin/malli

Recursive schema

Thanks for the comments. Implemented the recursion in #209. Removed the local recursion in favour of using local registries and added eager :schema and :malli.core/schema reference types.

The registry shorthand notation: Doing a generic walk (using m/accept) and adding :title property to all schemas would mean that the registry shorthand would get a new Schema :title registered so I think it's better to use the explicit :registry key.

The [:and properties schema] can be now presented as [:schema properties schema] and has always been available as [schema properties] (e.g. [string? {:title "string"}]).

Will run some more tests, if no new comments arrive, will merge the recursion to master and close both issues.

cheers.

RafaeLeal

comment created time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha d17a94fb9396a653d39278f10bd5d44a60e5bc43

update README

view details

push time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha 1636ae24e824256923f1a614b474d1b279aa6f99

lazy :map

view details

Tommi Reiman

commit sha df72f17bcb8ecf701bb7a870d245816485b973f6

recursion limit on :or

view details

Tommi Reiman

commit sha 133a5224d8534fcfda43d75d5840e1ca3e41a520

:multi satisfies MapEntries

view details

Tommi Reiman

commit sha d73acc82cf8531c951fac00df7c68562fe5c763d

:multi recursion

view details

push time in 4 days

push eventmetosin/malli

Tommi Reiman

commit sha dd3647e43fa739fc04f48b7fa1ba24db6802819a

Proper recursion limits

view details

push time in 5 days

push eventmetosin/malli

Tommi Reiman

commit sha 6e7a4d3b613423425324ed8fee56d1c06926c22c

docs

view details

push time in 5 days

push eventmetosin/malli

Tommi Reiman

commit sha a6a1a7dfea503f8b734d5151f3fc320304ad288a

docs

view details

push time in 5 days

push eventmetosin/malli

Tommi Reiman

commit sha 7a18cbf7d5e9049fb69360a90b19be48f8619bdb

fast :or validator with 1 distict child

view details

Tommi Reiman

commit sha 63b9d520460c0b934827549392863581c33698a9

Bye bye local recursion, welcome :malli.core/schema (for durable eager schema links)

view details

Tommi Reiman

commit sha dffd9abc9c6b4072e885bb34275ac8552ad56d1b

README

view details

push time in 5 days

push eventmetosin/malli

Tommi Reiman

commit sha db31c012eb519c9c202885e14f193d0b3adc2db6

raise ref-max

view details

push time in 5 days

push eventmetosin/malli

Tommi Reiman

commit sha 25b41ded4694b542eea094767add598b7f3b67fe

remove the :registry

view details

Tommi Reiman

commit sha ca9f32665669ab3278e7c97099557af3a7163e08

optimize :and with single branch

view details

Tommi Reiman

commit sha 32dd6e3142bafb72ca97aca062c4bcc998bdd51d

welcome :schema!

view details

push time in 5 days

issue commentmetosin/reitit

Swagger parameter descriptions?

doc improvements welcome

crclark

comment created time in 8 days

issue closedmetosin/reitit

Swagger parameter descriptions?

I am playing with the ring-spec-swagger example, and I noticed that the parameters don't have descriptions. Furthermore, I wasn't able to find anything about parameter descriptions in the docs. Is there a way to document each parameter?

Screen Shot 2020-05-08 at 1 27 08 PM

closed time in 8 days

crclark

issue commentmetosin/spec-tools

Require data to match coll type

sounds like a bug. PR welcome.

brjann

comment created time in 8 days

pull request commentmetosin/spec-tools

OpenAPI3 support

Looking good. I would like the openapi3 be renamed just to openapi, like the Swagger2 is just swagger. If openapi4 would be announced and it would be backwards compatible, users woudn't have to change the keys in the specs. e.g. :openapi3/type => :openapi4/type, would still be just :openapi/type.

rrudakov

comment created time in 8 days

issue commentmetosin/reitit

Unclear where swagger tags should be placed

oh, it a breaking. but the :tags has never been part of the route spec, so this is still a bug fix. need to push a minor out with this.

On Thu, Jun 25, 2020 at 12:36 PM Tommi Jalkanen notifications@github.com wrote:

I know it would be a breaking change but what about this line: https://github.com/metosin/reitit/blob/9ca88d7165c97ec1c5bb87dd5a217bc58ad1de50/modules/reitit-swagger/src/reitit/swagger.cljc#L96

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/metosin/reitit/issues/375#issuecomment-649425705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEKR3DY5AUB2OBBWQFEGEDRYMLDJANCNFSM4LF2IESQ .

Deraen

comment created time in 8 days

pull request commentmetosin/reitit

Cleanup test namespaces

thx!

Koura

comment created time in 8 days

push eventmetosin/reitit

tjalkane

commit sha 87d7e2e3c9120239f87166e28a60abfdac50d749

Fix: rename a test to make it run The renamed test is redeclared later in the same namespace causing the original one to not be run with `lein test`.

view details

tjalkane

commit sha c1c3cd26b4386ea9896245716403ac44ebc75a41

Remove duplicate require of schema.core

view details

Tommi Reiman

commit sha 0ffef07cbf6337a7f8258a06b75ed4805d41fee9

Merge pull request #415 from Koura/cleanup-test-namespaces Cleanup test namespaces

view details

push time in 8 days

PR merged metosin/reitit

Cleanup test namespaces

Make default-options-handler-test run by renaming the test and clean up duplicate require of schema.core in test/cljc/reitit/swagger_test.clj.

+4 -5

0 comment

2 changed files

Koura

pr closed time in 8 days

pull request commentmetosin/malli

Recursive Schemas Impl

Recursive schema resolution is too eager now:

(m/form
  [:and
   {:registry {::ping ::pong2
               ::pong2 ::pong
               ::pong [:and pos-int?]}}
   ::ping])
;[:and {:registry {:user/ping [:and pos-int?]
;                  :user/pong2 [:and pos-int?]
;                  :user/pong [:and pos-int?]}} 
; [:and pos-int?]]

, should retain the pointer information.

ikitommi

comment created time in 8 days

issue commentborkdude/sci

optimize build size by letting users choose core function(s)(ality)

From Slack #sci:

I think there are ... options here.

first: make all the def defns and split them into smaller parts, e.g. clojure-set-bindings, clojure-walk-bindings etc.

  1. have a global def collecting all in sci.core and create a new entrypoint ns, like sci.custom that doesn’t have the def, but an api that requires the bindings as parameter
  2. have a compiler switch (:closure-defines / :jvm-opts) which allow to empty the default registry
  3. macro-time select-keys, might work, tested something like this, coudn’t get it to work

Example of option 2 done In malli.

borkdude

comment created time in 9 days

push eventmetosin/reitit

tjalkane

commit sha 0cfe5b4ea5cf7cb031d32d0c39c2fafbdf7c95c3

Replace top-level `:tags` with `[:swagger :tags]` path in documentation

view details

Tommi Reiman

commit sha 9ca88d7165c97ec1c5bb87dd5a217bc58ad1de50

Merge pull request #414 from Koura/issue-375-remove-top-level-tags Replace top-level `:tags` with `[:swagger :tags]` path in documentation

view details

push time in 9 days

PR merged metosin/reitit

Replace top-level `:tags` with `[:swagger :tags]` path in documentation

Change :tags usage in documentation as mentioned in #375

+1 -2

0 comment

1 changed file

Koura

pr closed time in 9 days

push eventmetosin/malli

Tommi Reiman

commit sha 7cbd3bdf31bec12b5b729d1bf87a7469f3c62469

fix test

view details

push time in 9 days

pull request commentmetosin/malli

Recursive schema

Greeting from the (morning) hammock. And big thanks for giving feedback on the issue. Would like to get this right from the beginning.

Some developments:

1) registries everywhere

Pushed a small spike about allowing the :registry keyword to exist in any schema properties, like in JSON Schema. So, instead of:

(mg/generate
  [:registry
   {:registry {::ping [:maybe [:tuple [:= "ping"] [:ref ::pong]]]
               ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]}}
   ::ping])

One could say:

(mg/generate
  [:and
   {:registry {::ping [:maybe [:tuple [:= "ping"] [:ref ::pong]]]
               ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]}}
   ::ping])

I'm happier with this one.

Any thoughts on this?

2) registry nesting and masking

Also, added option to create Schemas without checking the :refs, used in to create forms of the :registry so that it survives the de/serialization process.

With the current design, nested registries (with holes) work ok and it uses the let-style silent overrides:

(mg/generate
  [:and {:registry {::pong [:maybe [:tuple neg-int? [:ref ::ping]]]
                    ::ping [:and {:description "effectively masked"} any?]}}
   [:and {:registry {::ping [:maybe [:tuple pos-int? [:ref ::pong]]]}}
    ::ping]]
  {:seed 1})
; => [2 [-1 [2 nil]]]

As a side-note, one could override any core schema like :and with the local registries. This might not be a good thing(?). One option would be to limit the registry entries to fully qualified keywords, "the user schemas" or do some other separation of "syntax" and "user" schemas.

any thoughts on this?

3) need for local :refs

This was the target:

[:maybe {:id :cons}
 [:tuple int? [:ref :cons]]])

But this seems the suggested way to do it:

[:maybe {:malli/id :cons}
 [:tuple int? [:ref {:type :local} :cons]]])

Which is IMO worst than the official:

[:and {:registry {::cons [:maybe [:tuple int? [:ref ::cons]]]}}
 ::cons]

I think the local ref thing should either be removed or the ambiguity rules should be changed so that it would also override and would be standalone and simple:

[:maybe {:malli/id :cons}
 [:tuple int? [:ref :cons]]]

thoughts?

RafaeLeal

comment created time in 9 days

push eventmetosin/malli

Tommi Reiman

commit sha 496ff82751cfb8cf984188a661eef1d86fdd889d

Support property :registry anywhere

view details

push time in 9 days

push eventmetosin/malli

Tommi Reiman

commit sha 6fea381b0304e6bd661ee5f098e2c63fde79fcec

Added tests, clj only TODO: cljs fails on maximum call stack

view details

push time in 10 days

pull request commentmetosin/malli

Recursive schema

Re-read the reference handling from JSON Schema. which supports all kind of pointers: relative, absolute and cross-document (absolute + relative).

{
  "$id": "http://example.com/path/to/user.json",
  
  "type": "object",
  "properties": {
    "email": {
      "$ref": "#/definitions/personal/email"
    },
    "birthday": {
      "$ref": "#/definitions/personal/birthday"
    },
    "settings": {
      "$ref": "user-settings.json#/definitions/settings"
    },
    "info": {
      "$ref": "../info.json#"
    },
    "root": {
      "$ref": "/other/path/to/schema.json#/definitions/root"
    },
    "external": {
      "$ref": "http://external.example.com/some-schema.json#/definitions/name"
    }
  },
  
  "definitions": {
    "personal": {
      "email": {
        "type": "string",
        "format": "email"
      },
      "birthday": {
        "type": "string",
        "format": "date"
      }
    }
  }
}

Some takeways:

  • the :definitions (e.g. :registry) can be defined at any level => should we do this too?
  • each schema document or element can have id property (was $id earlier), which can be relative or absolute
    • I believe when JSON Schema documents are loaded, all the id should be collected so that they can be referenced
    • In Clojure, I would think the absolute part as a namespace and the relative part the name of a keyword
  • absolute pointers can have two parts: pointer to the document + # + relative pointer within the document (or the id)
  • relative pointers are local within a JSON Schema document, allow pointing anywhere within a document BUT not outside od the current document: if you have nested :definitions, you can't point upwards unless using absolute pointer with the upward schema id + local reference there.
    • the current design of Malli differs here: :local definitions are nested, it pics the closest one, which could be anywhere in the schema tree upwards, e.g.
(m/validate
  [:registry {:registry {::id [:string {:min 1}]}}
   [:registry {:registry {::id2 [:string {:min 2}]}}
    [:ref ::id]]] ;; from level up
  "1")
; => true

I think the absolute pointing could be introduces later (if needed) by giving registries an scope or an id/name. Besides the default registry, one could have multiple co-existing registries and pointing to a scoped/named registry would be done using a path sequence, e.g. [registry-id, registry-key]

;; reference to default registry
:email ;; eager
[:ref :email] ;; lazy

;; reference to email from registry named `:users`
[:ref [:users :email]] ;; always lazy

;; local reference
[:ref {:type :local} :email] ;; always lazy
RafaeLeal

comment created time in 10 days

starteddjblue/portal

started time in 10 days

push eventmetosin/malli

Tommi Reiman

commit sha 2e2c7dd50b11efb14f9bea51e3b1c254b29f70b7

Add tests

view details

push time in 11 days

pull request commentmetosin/malli

Recursive schema

This works now too:

(mg/generate
  [:registry
   {:registry {::ping [:maybe [:tuple [:= "ping"] [:ref ::pong]]]
               ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]}}
   [:ref ::ping]]
  {:size 7, :seed 86})
; => ["ping" ["pong" ["ping" ["pong" ["ping" nil]]]]]

comments/suggestions on :registry syntax welcome.

love when things are simple to implement: https://github.com/metosin/malli/pull/209/commits/f7f760e7770efe95136f1b77c199f6e09314ec40.

RafaeLeal

comment created time in 11 days

push eventmetosin/malli

Tommi Reiman

commit sha f7f760e7770efe95136f1b77c199f6e09314ec40

welcome :registry

view details

push time in 11 days

pull request commentmetosin/malli

Recursive schema

One idea about the ambiguity. Should there be a way to define some ref as being local? having an explicit local reference type, would allow fully local recursion (and normal references) without having errors with registry-level things. Something like:

1) new :local type:

(mg/generate
  ::ping
  {:registry (mr/composite-registry
               (m/default-schemas)
               {::ping [:maybe {:id ::pong} [:tuple [:= "ping"] [:local ::pong]]] ;; looks just local refs
                ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]})
   :size 7, :seed 86})
; => ["ping" ["ping" ["ping" ["ping" ["ping" nil]]]]]

2) type-tagging :ref

(mg/generate
  ::ping
  {:registry (mr/composite-registry
               (m/default-schemas)
               {::ping [:maybe {:id ::pong} [:tuple [:= "ping"] [:ref {:type :local} ::pong]]] ;; looks just local refs
                ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]})
   :size 7, :seed 86})
; => ["ping" ["ping" ["ping" ["ping" ["ping" nil]]]]]
RafaeLeal

comment created time in 11 days

pull request commentmetosin/malli

Recursive schema

Checked the mutual recursion case, looks like quite simple things: https://github.com/metosin/malli/pull/209/commits/eaea510e63c4ebce64d66b0ce69bfc6101f3abcf:

(mg/generate
  ::ping
  {:registry (mr/composite-registry
               (m/default-schemas)
               {::ping [:maybe [:tuple [:= "ping"] [:ref ::pong]]]
                ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]})
   :size 7, :seed 86})
; => ["ping" ["pong" ["ping" ["pong" ["ping" nil]]]]]

tested also a fail-fast on ambiguity with refs, so instead of:

(mg/generate
  ::ping
  {:registry (mr/composite-registry
               (m/default-schemas)
               {::ping [:maybe {:id ::pong} [:tuple [:= "ping"] [:ref ::pong]]]
                ::pong [:maybe [:tuple [:= "pong"] [:ref ::ping]]]})
   :size 7, :seed 86})
; => ["ping" ["ping" ["ping" ["ping" ["ping" nil]]]]]

the default code will throw instead:

Execution error (ExceptionInfo) at malli.core/fail! (core.cljc:80).
:malli.core/ambiguous-ref {:type :ref, :ref :user/pong}
RafaeLeal

comment created time in 11 days

pull request commentmetosin/malli

Recursive schema

looking forward to that @hkupty ! The new draft PR in #209 .

RafaeLeal

comment created time in 11 days

push eventmetosin/malli

Tommi Reiman

commit sha b4b28e0167a57618c4e53300184e9c98dca6430b

polish code

view details

Tommi Reiman

commit sha eaea510e63c4ebce64d66b0ce69bfc6101f3abcf

Support for mutual recursion via registry

view details

Tommi Reiman

commit sha 88520443a1c82b267b8cbd5217356ee99c3f92ea

Handle local vs registry ref ambiguity

view details

Tommi Reiman

commit sha f503222c9f04887b4fcba4fed3f505fd575788fa

Better schema errors on missing schema elements

view details

push time in 11 days

push eventmetosin/malli

Tommi Reiman

commit sha e6426b096fa03cf74a6aaf0b80111a133265d616

:ref schema

view details

push time in 11 days

PR opened metosin/malli

Recursive Schemas Impl

Displaces impl from #117, which will remain a place to discuss & history. FIxs #20 .

TODO

  • [ ] local recursion using :id
  • [ ] local mutual recursion using :registy
  • [ ] ensure it's done right

DONE

  • new Schema method -children to get child schemas instances too
  • new :ref schema enabling local (non-mutual) recursion.

malli-rec

+193 -122

0 comment

4 changed files

pr created time in 11 days

create barnchmetosin/malli

branch : recursive1

created branch time in 11 days

pull request commentmetosin/malli

Recursive schema

One more thing related to silent overrides. There are two thing: overriding schemas in registry and just adding refs. Silent override of schemas in registry would enable things like this:

(m/validate
  [:registry
   {:registry {:and (m/-or-schema)}}
   [:and int? string?]]
  "fail")
; => true
RafaeLeal

comment created time in 12 days

pull request commentmetosin/malli

Recursive schema

Related, from Slack:

About recursive schemas. It seems that because of those, should to to add a (-children [this]) method into Schema protocol. Why? Currently, there is generic m/children function that returns the Schema AST for the children. The AST is unaware of any instance bindings such as local recursion targets. Given a Schema:

[:maybe {:id :cons}
   [:tuple int? [:ref :cons]]]

, the generator for :tuple just sees children of (int? [:ref :cons]) and doesn’t know what :cons refers to and fails.

We could hack around this by pulling out options that created :tuple and using those to re-create the child schemas, providing all the needed local context. But, this is error-prone as one needs to wire-up all generators, visitors etc. using the original options from the father schema.

(currently passing the local context via options, which seems to be a good way to do it)

Anyway, this works now:

malli-rec

with recursion, one can set the recursion limit, just like with spec. One setting, but each :ref is counted separatly, defaulting to 10.

RafaeLeal

comment created time in 12 days

pull request commentmetosin/malli

Recursive schema

Not happy that the Option 2 would adds ambiguity. What is a schema has also :id?

[:registry
 {:registry {:ping [:maybe {:id :pong} [:tuple [:= "ping"] [:ref :pong]]] ;; :ping or :pong?
             :pong [:maybe [:tuple [:= "pong"] [:ref :pong]]]}}
 [:ref :pong]]

I think the local definition (e.g. the key in :registry should win here), resulting:

{:ping [:maybe {:id :pong} [:tuple [:= "ping"] [:ref :pong]]]
 :pong [:maybe [:tuple [:= "pong"] [:ref :pong]]]}

, BUT if the :id attribute is not removed, it will cause problems when walking the schemas as the code might think the first one is still :pong. One option would be to rewrite the registry here, but it's extra code and doing that silently would be bad idea IMO, might not be the resolution user would expect. I'm starting to agree with @rschmukler that the default should be to throw. The action (to throw or to make the last one win) could be configured via options?

There would be three ways to do recursion, too many ways?

  1. schema-defined: using schema :id as :ref target
  2. local: using :registry schema :registry map keys as :ref target
  3. registry-based: using the normal schema registry entries

the 3 is a must anyway and I believe 2 is too - to allow sending schema graphs over the wire. 1 would be nice to avoid boilerplate, e.g. instead of:

[:registry
 {:schemas {:cons [:maybe [:tuple int? [:ref :cons]]]}}
 [:ref :cons]]

one could say:

[:maybe {:id :cons}
 [:tuple int? [:ref :cons]]]

If all three would be supported, the precedence could be 2->3->1 and the default would be to throw on overriding definitions? using fully qualified keys (or gensym) would allow fully local names that don't conflict.

Far from being sure how to implement this, so comments most welcome.

RafaeLeal

comment created time in 12 days

pull request commentmetosin/malli

Recursive schema

Mutual recursion needs a way to define schema graphs. Maybe something like:

(explain
  [:registry
   {:schemas [[:maybe {:id :ping} [:tuple [:eq "ping"] [:ref :pong]]]
              [:maybe {:id :pong} [:tuple [:eq "pong"] [:ref :pong]]]]}
   [:ref :pong]]
  ["ping" ["pong" ["ping" nil]]])
: => nil

or:

(explain
  [:registry
   {:schemas {:ping [:maybe [:tuple [:eq "ping"] [:ref :pong]]]
              :pong [:maybe [:tuple [:eq "pong"] [:ref :pong]]]}}
   [:ref :pong]]
  ["ping" ["pong" ["ping" nil]]])
: => nil

Will make a separate PR of the impl. let's keep this open as the history.& discussion.

RafaeLeal

comment created time in 16 days

pull request commentmetosin/malli

Recursive schema

Did a quick poke on this, using :ref schema and :id property on schemas. Both -validate and -explain can be made lazy, so the impl is quite trivial. Methods like -accept is eager and need to have local bookkeeping not to walk over same models again and run into infinite loop.

But, currently looks like this:

(def ConsCell
  [:maybe {:id :cons}
   [:tuple int? [:ref :cons]]])

(explain ConsCell [1 [2 [3 [4 nil]]]])
; => nil

(explain ConsCell [1 [2 [3 [4]]]])
;{:schema [:maybe {:id :cons} [:tuple int? [:ref :cons]]],
; :value [1 [2 [3 [4]]]],
; :errors (#Error{:path [2 2 0 2 2 0 2 2 0 2],
;                 :in [1 1 1],
;                 :schema [:tuple int? [:ref :cons]],
;                 :value [4],
;                 :type :malli.core/tuple-size})}

Qurestion: if the same :id is used with different levels, should it throw or should the last one win? (like with clojure let)

RafaeLeal

comment created time in 16 days

push eventmetosin/malli

Tommi Reiman

commit sha a4b3ccd198cea6e3f3de77afabc9181a9ed523b5

Update deps

view details

push time in 16 days

push eventmetosin/malli

Tommi Reiman

commit sha feb6fc99b548d00687781c0f8f4a6f1c1d37995a

docs

view details

push time in 16 days

push eventmetosin/malli

Tommi Reiman

commit sha 1891acc47e00a0bcbf205032ca0fc5af6fe8c8f7

Initial impl for swappable default registry

view details

Tommi Reiman

commit sha 1d406f70aca39ab4a970e86752f8b4b3d72379cf

registry defn

view details

Tommi Reiman

commit sha e4985a30c6b21dc586a1b173793ad20e532e2c6c

wip

view details

Tommi Reiman

commit sha 380bc88a241217f2bedab3ee56dfed90473bab67

mutable evil

view details

Tommi Reiman

commit sha b952dce5f8514eb6f2d67ce4a673bd0017715507

cleanup declares

view details

Tommi Reiman

commit sha 155314dc6e936491e81ab86ba3eaa0845b071207

cleanup

view details

Tommi Reiman

commit sha 008204cf6ebc94f990625c99ffcbacaad94beb72

move stuff into registry ns

view details

Tommi Reiman

commit sha eb47f566784c79760a9491146724b3c6010943d3

cleanup

view details

Tommi Reiman

commit sha 8332765d3b568b91ab2cdecbbbf8c24cd2858dd3

dce-friendly way to register

view details

Tommi Reiman

commit sha 0e75f1aac796a5901efbd6b8c3993a64991e695c

the app

view details

Tommi Reiman

commit sha fea3858fd349f9e3ee015f6d7500ddd3ff537164

fix tests

view details

Tommi Reiman

commit sha 93982be01139ce082f3e4fc905da5806ce8b27c9

registry is public, fail on invalid registry

view details

Tommi Reiman

commit sha 00d4726519b657583a7bd7e82b7f5e63a262175e

there is no requiring-resolve in cljs. trying to dynamically include a function to be used as initial registry. * npx shadow-cljs run shadow.cljs.build-report app /tmp/report.html * npx shadow-cljs release app --pseudo-names

view details

Tommi Reiman

commit sha 8051151ea3d3b1d9b14998c03d04856cfdc3116b

wip

view details

Tommi Reiman

commit sha b777410b03c522874cf01e390e2e23ba8b7aabab

make core schema fns public

view details

Tommi Reiman

commit sha 29acffb07de58eb959b336492d51f47db834b1f5

cleanup

view details

Tommi Reiman

commit sha c4a54606e60879bc67a07a5b90805003802c7bb6

tada, it works!

view details

Tommi Reiman

commit sha 2a98d021f6d2559f4b656b65cba3294ead00d571

dead code

view details

Tommi Reiman

commit sha 2b3ddce24614ec418694b2b9a02503d124eaa9e2

fix type hint

view details

Tommi Reiman

commit sha 0fca12252c902a052b3831203985ddd01fdfdcbe

Add support for dynamically bound registries

view details

push time in 16 days

PR merged metosin/malli

Swappable Default Registry
  • welcome malli.registry ns with Registry abstraction. Registry impls include:
    • simple-registry, mutable-registry, dynamic-registry and composite-registry
  • change all m/*-registy defs into m/*-schemas defns to enable DCE for clojurescript
  • introduce two profiles for the registries, defined via CLOSURE_DEFINES and JVM Propertie:
    • cljs: :closure-defines {malli.registry/type "custom"}
    • clj: :jvm-opts ["-Dmalli.registry/type=custom"]
  • bundle sizes for malli.core, just validation:
    • immutable (full, 110+ schemas): 12kb
    • just :map , :maybe and :string 1.2kb
    • just :string:: 700b
  • fixes #177

default (immutable)

malli-immutable

managed (swappable)

malli-managed

composing immutable, mutable & dynamic registries

malli-composite

+332 -98

0 comment

12 changed files

ikitommi

pr closed time in 16 days

issue closedmetosin/malli

Should malli have a default mutable registry as an option?

Per the docs, it's obviously super easy to create your own, though it's it little bit of a pita to pass your custom registry around everywhere, I just created my own wrappers. Just wondering, given that Malli is going to be attractive to both Schema and spec users, might be nice to have 'spec style' out of the box.

closed time in 16 days

eoliphan

push eventmetosin/malli

Tommi Reiman

commit sha 7d17f033e87e09dedecac305c5c6808a51419ccf

managed -> custom, polish stuff

view details

push time in 16 days

push eventmetosin/malli

Tommi Reiman

commit sha 088ed03a0d12893e996b02ffa342240796d999d5

docs, changelog

view details

push time in 17 days

pull request commentmetosin/malli

Fix string generator with only :min option

thsnks

pithyless

comment created time in 17 days

push eventmetosin/malli

Norbert Wójtowicz

commit sha dbc924f1df3c842f51375a0a485493fc7d72a916

Fix string generator with only :min option

view details

Tommi Reiman

commit sha 6bb73df52b4f62e23cf452f5526255f17ddc6643

Merge pull request #208 from pithyless/patch-1 Fix string generator with only :min option

view details

push time in 17 days

PR merged metosin/malli

Fix string generator with only :min option
+1 -1

0 comment

1 changed file

pithyless

pr closed time in 17 days

issue commentmetosin/malli

Should malli have a default mutable registry as an option?

I rethought about it and agree it's a good idea to have in the the core - and it's definitely subject to DCE. Moved the registry composition into a separate mr/composite-registry and added a dynamic-registry as you suggested. So, this is possible after the PR:

(require '[malli.core :as m])
(require '[malli.registry :as mr])

;; bring your own evil
(def registry (atom {}))

(defn register! [type schema]
  (swap! registry assoc type schema))

;; managed registry initialized with
;; - cljs: :closure-defines {malli.registry/type "managed"}
;; -  clj: :jvm-opts ["-Dmalli.registry/type=managed"]
(mr/set-default-registry!
  ;; linear search
  (mr/composite-registry
    ;; immutable registry
    {:map (m/-map-schema)}
    ;; mutable (spec-like) registry
    (mr/mutable-registry registry)
    ;; on the perils of dynamic scope
    (mr/dynamic-registry)))

;; like a boss
(register! :maybe (m/-maybe-schema))

;; ☆.。.:*・°☆.。.:*・°☆.。.:*・°☆.。.:*・°☆
(binding [mr/*registry* {:string (m/-string-schema)}]
  (m/validate
    [:map [:maybe [:maybe :string]]]
    {:maybe "sheep"}))
; => true
eoliphan

comment created time in 17 days

push eventmetosin/malli

Tommi Reiman

commit sha 0fca12252c902a052b3831203985ddd01fdfdcbe

Add support for dynamically bound registries

view details

push time in 17 days

startedbpringe/auth-template

started time in 17 days

push eventmetosin/malli

Tommi Reiman

commit sha 2b3ddce24614ec418694b2b9a02503d124eaa9e2

fix type hint

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha 2a98d021f6d2559f4b656b65cba3294ead00d571

dead code

view details

push time in 18 days

issue commentmetosin/malli

Should malli have a default mutable registry as an option?

and for dynamic scope - has bitten me few times, the suggested architecture would support that, but in the user-space, not in malli.core.

eoliphan

comment created time in 18 days

issue commentmetosin/malli

Should malli have a default mutable registry as an option?

#188 starting to look good IMO. comments welcome.

eoliphan

comment created time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha 8051151ea3d3b1d9b14998c03d04856cfdc3116b

wip

view details

Tommi Reiman

commit sha b777410b03c522874cf01e390e2e23ba8b7aabab

make core schema fns public

view details

Tommi Reiman

commit sha 29acffb07de58eb959b336492d51f47db834b1f5

cleanup

view details

Tommi Reiman

commit sha c4a54606e60879bc67a07a5b90805003802c7bb6

tada, it works!

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha 93982be01139ce082f3e4fc905da5806ce8b27c9

registry is public, fail on invalid registry

view details

Tommi Reiman

commit sha 00d4726519b657583a7bd7e82b7f5e63a262175e

there is no requiring-resolve in cljs. trying to dynamically include a function to be used as initial registry. * npx shadow-cljs run shadow.cljs.build-report app /tmp/report.html * npx shadow-cljs release app --pseudo-names

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha fea3858fd349f9e3ee015f6d7500ddd3ff537164

fix tests

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha 51ff2b0a31138322f30c098785671c87d3bb362a

does not work trying to dynamically include a function to be used as initial registry. * npx shadow-cljs run shadow.cljs.build-report app /tmp/report.html * npx shadow-cljs release app --pseudo-names

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha 0e75f1aac796a5901efbd6b8c3993a64991e695c

the app

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha 8332765d3b568b91ab2cdecbbbf8c24cd2858dd3

dce-friendly way to register

view details

push time in 18 days

push eventmetosin/malli

Tommi Reiman

commit sha eb47f566784c79760a9491146724b3c6010943d3

cleanup

view details

push time in 18 days

more