HOCON introduction

hocon is abbreviated as Human-Optimized Configuration Object Notation

It is new format which is super set of JSON file type.

It is used to store configuration file like toml or ini. This course series posts help you to get basics of hocon with examples for learning.

Important points

  • It is case sensitive
  • file extension is .conf
  • Tabs are not allowed,
  • Some editors allows spaces

Advantages of hocon

  • Lightweight
  • It is very easy and simple for represent complex mapping
  • Human friendly readable and writable
  • Simple to modify with any text editor
  • Suitable for configuration settings
  • Merging
  • substitution

Disadvantages of Hocon

  • It is new format introduced recently, learning curve exists.
  • Not much popular other than xml and json

hocon file extension

hocon files created with extension .conf or .hocon You can use any IDE or text editor to open and create this file.

All the popular IDE supports the hocon file extension and also provides plugins to validate the hocon file content.

MIME format type - application/hocon

There is no office MIME type for hocon document content as per IANA, but it can be represented using application/hocon

When hocon data is transferred between client and server,Implementation vendors add MIME type settings specified in request and response across internet. Content-Type and accept headers in a request object are specified with this format following is the mime type for this documents

application/hocon

and request contains the below value for hocon data sending over the internet

Content-type : application/hocon