Skip to content
forked from emqx/hocon

HOCON configuration Parser for Erlang/OTP

License

Notifications You must be signed in to change notification settings

muskanmahajan486/hocon

 
 

Repository files navigation

Hocon

HOCON data parser for Erlang/OTP.

Spec

HOCON spec for reference: https://lightbend.github.io/config/

Divergence from Spec and Caveats

  • The forbidden character @ is allowed in unquoted strings.
  • Value concatenation is not allowed in keys e.g. a b c : 42 is invalid.
  • Newlines do not prevent concatenation.
    • String (All below are parsed to the same result, which is #{key => <<"value1value2">>})
      • "key=value1 value2"
      • "key=value1value2"
      • "key=\"value1\" \"value2\""
      • "key=value1\nvalue2"
    • Array (#{key => [1,2,3,4]})
      • key=[1, 2] [3, 4]
      • key=[1, 2]\n[3, 4]
      • key=[1,2,3,4]
    • Object (#{key => #{a => 1,b => 2}}):
      • key={a: 1} {b: 2}
      • key={a: 1}\n{b: 2}
      • key={a=1, b=2}
  • url()/file()/classpath() includes are not supported

Schema

HOCON schema (hocon_schema) is a type-safe data validation framework. which is compatible to basho cuttlefish

See more information in SCHEMA.md

Test Data

Files in sample-configs are collected from https://github.com/lightbend/config/tree/v1.4.1

TODO

  • Upload to hex.pm

Reference

License

Apache License 2.0, see LICENSE.

Authors

EMQX team

About

HOCON configuration Parser for Erlang/OTP

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Erlang 99.0%
  • Other 1.0%