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.

MIT License

Downloads
116.4K
Stars
627
Committers
7

Bot releases are hidden (Show)

shale - v1.1.0 Latest Release

Published by kgiszczak 8 months ago

Added

  • [bkjohnson] Add support for JSON Schema validation keywords (#29)
  • Add support for Ruby 3.3

Changed

  • Drop support for Ruby 2.6 and Ruby 2.7

Fixed

  • Fix Ox adapter incorrectly handling documents with XML declaration
shale - v1.0.0

Published by kgiszczak over 1 year ago

Added

  • Support for Ruby 3.2
  • Support for delegating fields to nested attributes
  • JSON and XML schema namespace mapping support
  • Allow to set render_nil defaults

Changed

  • Use ShaleError as a base class for exceptions
  • Use model instead of mapper names for schema types

Fixed

  • Fix compilation error for bundled JSON schemas
  • Fix type inference for XML schema when default namespace is used
  • Fix XML schema handling with a period in the element name
shale - v0.9.0

Published by kgiszczak almost 2 years ago

Added

  • Support for CSV
  • Allow to specify version and add encoding to XML declaration
  • Support for mapping/generating collections
shale - v0.8.0

Published by kgiszczak about 2 years ago

Added

  • Allow to group mappings using group block
  • Bring back Ruby 2.6 support

Changed

  • Use anonymous module for attributes definition.
    It allows to override accessors and super works as expected.
shale - v0.7.1

Published by kgiszczak about 2 years ago

Fixed

  • Fix broken handling of Date and Time types
shale - v0.7.0

Published by kgiszczak about 2 years ago

Added

  • only: [] and except: [] options that allow to controll what attributes are rendered/parsed
  • render_nil: true option that allows to render nil values
  • Allow to pass a context object to extractor/generator methods

Changed

  • Pass whole document to methods for JSON/YAML/TOML so its behavior is consistent with XML mapping
  • Convert splat arguments to keyword arguments
  • RSpec: enable random spec execution and warnings
shale - v0.6.0

Published by kgiszczak over 2 years ago

Added

  • Support for TOML
  • Support for CDATA nodes in XML documents
  • Support for using custom models

Fixed

  • Allow to map XML content using methods
  • Prevent adding default mapping after mapping block was declared
shale - v0.5.0

Published by kgiszczak over 2 years ago

Added

  • Allow to generate Shale model from XML Schema

Changed

  • Shale doesn't defaults to REXML anymore - XML adapter needs to be set explicitly
  • Rename "JSONSchemaError" to "SchemaError"
  • Rename "Composite" type to "Complex"
  • Drop support for Ruby 2.6
shale - v0.4.0

Published by kgiszczak over 2 years ago

Added

  • Allow to add title to JSON Schema
  • Map Shale::Type::Value to "anyType" XML Schema type
  • Map Shale::Type::Value to "any" JSON Schema type
  • Allow to generate Shale model from JSON Schema

Changed

  • Performance improvements
  • Reformat README a little bit and fix typos

Fixed

  • Fix stack overflow caused by circular dependency when generating JSON and XML schemas
shale - v0.3.1

Published by kgiszczak over 2 years ago

Changed

  • Rename id -> $id and add info about supported JSON Schema dialect
shale - v0.3.0

Published by kgiszczak over 2 years ago

Added

  • Support for XML namespaces
  • Add option to pretty print JSON and XML and to include XML declaration
  • Add support for generating JSON and XML Schema

Changed

  • Various fixes to documentation
  • Rename hash -> hsh (hash is used internally by Ruby)
  • Rename Shale::Type::Base -> Shale::Type::Value
  • Use ISO 8601 format for date and time in JSON, YAML and XML
shale - v0.2.1

Published by kgiszczak over 2 years ago

Fixed

  • Fix attribute declaration causing problems in some runtimes (e.g Opal)
shale - v0.2.0

Published by kgiszczak over 2 years ago

Added

  • Support for using methods to extract/generate data from/to document

Changed

  • Deduplicate code
  • Rename Shale::Type::Complex -> Shale::Type::Composite
shale - v0.1.0

Published by kgiszczak almost 3 years ago

First public release