Skip to content

Define #as_json for selective serialisation #154

@tassja

Description

@tassja

Implement #as_json or expand Clear JSON Deserialise model to accept annotation as macro arg in

examples

defining to_json(json : JSON::Builder) would be the best way to go instead of to_h/as_json

It might be helpful to get some ideas from how active-model does it.
https://github.com/spider-gazelle/active-model/blob/master/src/active-model/model.cr#L62-L84

Originally posted by @caspiano in #80 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions