Fork me on GitHub

hi, is there some tooling to generate spec code from XSD schema files ? I would like to validate with clojurescript (if possible) some OFX XML I generate


I tried both of the XSD parsers I found using Google search (which looks like they came from the same root). Neither of them seemed to work. clj-xml will parse an XSD, but moving on from the parsed XML to a spec seems to still be a work-in-progress.

👍 3

I have a case where I generate specs, and sometimes I have fwd declarations in spec alises: (s/def ::foo ::bar) where ::bar is not declared/speced yet, so it blows up of course. A dirty way to do that is to do (s/and ::bar) as spec for instance but I am sure there's a better way (short of building a dep graph and specing in order)?

Alex Miller (Clojure team)16:09:07

Forward references are actually intended to be ok in specs - the spec alias case (s/def ::foo ::bar) is one known exception to that (there is a ticket for this)

Alex Miller (Clojure team)16:09:32

not sure if you've tried (s/spec ::bar) - that might also work

Alex Miller (Clojure team)16:09:46

would be slightly less dirty if so


I tried s/spec, doesn't work

Alex Miller (Clojure team)16:09:44

well, can't say I have a better alternative for you then


"unable to resolve spec ::bar "


alright, thanks for the info. If it's a bug I'll take the s/and trick as acceptable for now


I cannot find the jira for it, but I am not a good at jira'ing