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

Implement m/merge #62

Merged
merged 4 commits into from
Sep 8, 2019
Merged

Implement m/merge #62

merged 4 commits into from
Sep 8, 2019

Conversation

ikitommi
Copy link
Member

@ikitommi ikitommi commented Sep 8, 2019

... one of the original reasons for malli was to be able deep-merge map-schemas easily. Not perfect (doesn't understand how to merge things like :and & :or), but a start. Code is kinda bloaty.

Will fix: #45

(m/merge
  [:map 
   [:parameters
    [:map
     [:query-params 
      [:map [:x int?]]]]]]
  [:map 
   [:parameters
    [:map
     [:query-params 
      [:map [:y int?]]]
     [:body-params
      [:map [:z int?]]]]]])
;[:map 
; [:parameters
;  [:map
;   [:query-params 
;    [:map [:x string?] [:y int?]]]
;   [:body-params
;    [:map [:z int?]]]]]]

@ikitommi ikitommi changed the title First cut of m/merge (WIP) First cut of m/merge Sep 8, 2019
@ikitommi ikitommi changed the title First cut of m/merge Implement m/merge Sep 8, 2019
@ikitommi
Copy link
Member Author

ikitommi commented Sep 8, 2019

Will go to the big internal review..

@ikitommi ikitommi merged commit b2f8ceb into master Sep 8, 2019
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 this pull request may close these issues.

Programming with Schemas, part1
1 participant