A monkey patch to globally change JSON field key formats
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec
src
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
shard.yml

README.md

crystal-json-key-mapper

A hack to make JSON.mapping by default map crystal underscore names to JSON camelcase names.

Not recommended!

Limitation

All field names in crystal classes should not have uppercase letters. (Only lowercase letters and underscores.)

Installation

Add this to your application's shard.yml:

dependencies:
  crystal-json-key-mapper:
    github: liuyang1204/crystal-json-key-mapper
    branch: master

Usage

require this at the very beginning of the application.

require "json"
require "crystal-json-key-mapper"

Contributors