Fork me on GitHub

You have to declare the externs. Use cljsjs if your lib exists there


I want to create an API which has a lot of large domain objects (think 20+ attributes each). I was looking into using defrecord and Plumatic's schema. A lot of these attributes are optional though and I'm not sure how to declare default values. Would you create factory functions? Would those than just take normal maps again? Any other options to make it less painful to use this API?


Merge the incoming data with default data before validating? Possibly have separate schema for the incoming data and the internal data, particularly if you’re leaning on schema coercion for the incoming data.


thanks, I should maybe not use Plumatic's defrecord macro so I can separate the schemas from the records and be able to validate different subsets of the data


it has stuff like: "object A has attributes A1, A2, A3. Exactly one of them has to be available and be an Int"