Skip to content

Add optional 'safeToEncoding' method on 'SafeJSON' #24

@jkachmar

Description

@jkachmar

I could open a PR for this, but I figured a discussion might be better first.


Right now there's no way to use aeson's faster toEncoding JSON serialization methods (if they're defined) with safe-json.

As far as I can tell, it should be possible to add support for this with a new method on SafeJSON where a -> Contained Encoding. It could be optional (like aeson), with the default implementation calling safeTo encoding the resulting Value.

It gets a bit tricky with something like .=$, though. I imagine we would need to define a SafeKeyValue class so that .=$ could use safeToJSON on Pair and Object types, but safeToEncoding (or whatever it might be called) on Series types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions