An open API service indexing awesome lists of open source software.

https://github.com/gabbhack/deser_json

JSON-Binding for deser.
https://github.com/gabbhack/deser_json

deser deserialization deserializer json marshalling nim-lang serialization serializer

Last synced: 5 months ago
JSON representation

JSON-Binding for deser.

Awesome Lists containing this project

README

          

# deser_json [![nim-version-img]][nim-version]

[nim-version]: https://nim-lang.org/blog/2021/10/19/version-160-released.html
[nim-version-img]: https://img.shields.io/badge/Nim_-v1.6.0%2B-blue

**JSON-Binding for deser**

`nimble install deser_json`

[Deser documentation](https://deser.nim.town)

---

## Usage
First, install [deser](https://github.com/gabbhack/deser) via `nimble install deser`

deser_json provides three procedures:
1. `toJson` for serialization
1. `toPrettyJson` for pretty serialization
1. `fromJson` for deserialization

```nim
import
deser,
deser_json

var some = [1, 2, 3]

echo some.toJson()

some = fromJson(typeof(some), "[1, 2, 3]")
```

See the [deser documentation](https://deser.nim.town/deser.html) for a complete example.

## License
Licensed under MIT license.

deser_json uses third-party libraries or other resources that may be
distributed under licenses different than the deser_json.

THIRD-PARTY-NOTICES.TXT

## Acknowledgements
- [serde_json](https://github.com/serde-rs/json), for all the ideas I stole
- [jsony](https://github.com/treeform/jsony), for json parser