Introducing the Dynamic Codec (DCodec)

Are you a JSON user? If yes, read on...

In response to demand for data standardization and validation in emerging areas such as IoT, OSS Nokalva created the Dynamic Codec (DCodec), a JSON/DER serialization library.

The DCodec is primarily meant for JSON users who want to take advantage of a schema without losing the flexibility that a regular JSON parser offers them. The DCodec is a beta stage library, available at no charge.

The DCodec is not a typical OSS ASN.1 compiler or runtime and it doesn't replace the existing ASN.1/C# Tools. The DCodec is based on a subset of ASN.1 that is used as a schema for JSON. It is not intended to be used with protocols such as the ones defined in the 3GPP, ETSI, IEEE, SAE, etc. standards which require a complete set of ASN.1 features. It targets users who are working with JSON-based protocols and are dealing with variations of messages processed at different endpoints, who want to bring more structure to their communication by validating their messages.

OSS' DCodec can do three things dynamically:

  • Dynamic loading of a schema at runtime
  • Dynamic encoding and decoding of data that partially matches the schema or the bindings
  • Dynamic bindings, i.e. the data objects that are created at runtime and support C# dynamic type

The DCodec supports user-friendly schema versioning and evolution, allowing you to start with schema-less JSON, and then transition into schema-based JSON or binary as your data becomes more stable, all while deploying intermediate results. You can even create schemas directly from your JSON messages using our JSON2ASN web app.

In a few words, the DCodec can work without a schema, can load a schema at runtime and use C# dynamic bindings, allows partial matching of message and schema or bindings fields, and lets the application decide what to do in case of a mismatch. These features facilitate support for scenarios such as the following:

  • Partial decoding
  • Logging unknown fields
  • Mining for patterns in unknown data (say, a phone number in the NNN-NNN-NNNN format), and more

The DCodec is curently available as a .NET Standard 2.0 library.

See for yourself. It's easy to download and get started with the DCodec.