kgiszczak / shale

Shale is a Ruby object mapper and serializer for JSON, YAML, TOML, CSV and XML. It allows you to parse JSON, YAML, TOML, CSV and XML data and convert it into Ruby data structures, as well as serialize data structures into JSON, YAML, TOML, CSV or XML.
https://shalerb.org/
MIT License
618 stars 19 forks source link

Allow class namespacing #10

Closed jweir closed 1 year ago

jweir commented 1 year ago

Problem

jedschneider commented 1 year ago

curious, why was this closed? I'd like to be able to namespace ruby files using the JSONCompiler template. I was thinking of allowing the template to be defined externally and passed to the compiler, but I probably wasn't holistic in my approach to other schema formats. Anyway, it seems useful to be able to declare the ns, thanks!

jweir commented 1 year ago

I closed it because it is a work in progress that has not been thought through or used enough for me to feel confident it is a good solution.

We have come across two issues with Shale: prepending namespaces (as with this PR) and setting the correct Shale type from real world XSD files (which do not use the ns1 namespacing).

https://github.com/kgiszczak/shale/commit/b7d8d8506945dbe93822bbfae2e1673f968c32ef

We are currently using the patched version of Shale with some production code.

Once we are done with our deadline, I am going to circle back around and clean this up and present a PR.

We are really happy to have Shale, we have been using a JAX parser in JRuby to convert XSD's to Ruby mapper objects – Shale is much nicer.

kgiszczak commented 1 year ago

@jweir I'm really happy you like Shale and even more you use it in production. Waiting for the PR :)