Questions tagged [hocon]

HOCON (Human-Optimized Config Object Notation) keep the semantics (tree structure; set of types; encoding/escaping) from JSON, but make it more convenient as a human-editable config file format.

HOCON (Human-Optimized Config Object Notation) keeps the semantics (tree structure; set of types; encoding/escaping) from JSON, but makes it more convenient as a human-editable config file format.

https://github.com/typesafehub/config/blob/master/HOCON.md

90 questions
42
votes
2 answers

Scala: Write value to typesafe config object

I'm using Typesafe config & have a config file in my resources directory which looks like this: something { another { someconfig=abc anotherconfig=123 } } How would I change the value of anotherconfig using scala?
goo
  • 2,230
  • 4
  • 32
  • 53
22
votes
4 answers

Spring Environment backed by Typesafe Config

I want to use typesafe config (HOCON config files) in my project, which facilitate easy and organized application configuration. Currently I am using normal Java properties file(application.properties) and which is difficult to handle on big…
Ysak
  • 2,601
  • 6
  • 29
  • 53
11
votes
6 answers

Case Class Instantiation From Typesafe Config

Suppose I have a scala case class with the ability to serialize into json (using json4s or some other library): case class Weather(zip : String, temp : Double, isRaining : Boolean) If I'm using a HOCON config file: allWeather { BeverlyHills { …
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
10
votes
4 answers

Human editable JSON-like or YAML-like program configuration in Java

Is there a Java library similar to libconfig for C++, where the config file is stored in a JSON-like format that can be edited by humans, and later read from the program? I don't want to use Spring or any of the larger frameworks. What I'm looking…
Anand
  • 7,654
  • 9
  • 46
  • 60
10
votes
1 answer

HOCON Substitution default value

In HOCON and Typesafe Config, How do I set the default value in case of substitution. Does it supports something like this ?? ${server.host: 'localhost'} -> If server.host set(Either in the same configu files or through environement setting) it…
Ysak
  • 2,601
  • 6
  • 29
  • 53
10
votes
1 answer

Something like Typesafe Config for NodeJS

I have a nodejs application that will take a JSON configuration file. The JSON file will have some ${} and #{} tags that will be used to build up a dynamic context by loading a template configuration and populating the tags. HOCON may also end up…
Ruairi O'Brien
  • 1,209
  • 5
  • 18
  • 33
9
votes
1 answer

HOCON: multiple reference.conf resolution issue

I have multi-module project under SBT. Project A (library) has reference.conf file with A's configuration parameters. Project A depends on akka-actor library, which ships with its own reference.conf file. Project A redefines some akka's parameters…
Dmitry Bespalov
  • 5,179
  • 3
  • 26
  • 33
9
votes
2 answers

Convert HOCON (.conf) to JSON with scala/play?

I want to convert a .conf-file directly to json so I can pass it to frontend. Is there a way to do that in scala/play? It seems to be incredibly cumbersome with the path I'm taking now: val conf: Configuration =…
kornfridge
  • 5,102
  • 6
  • 28
  • 40
8
votes
2 answers

How to indent/autoformat HOCON in EMACS?

Haven't found a way to indent/autoformat HOCON config files. What is you way here?
Andrew Gaydenko
  • 267
  • 2
  • 11
7
votes
2 answers

HOCON array substitution from envs

I am using the HOCON config format and parsing lib is from typesafe.Config. HOCON supports env vars injections and overrides. like: my.config = "asd" my.config = ${?MY_ENV_VAR} this will substitute the default value "asd" if there is a env var…
linehrr
  • 1,668
  • 19
  • 24
5
votes
1 answer

Is there a way to move a node up the root in HOCON?

I'm using typesafe config and I'm looking for an easy way to allow optional overrides of properties in config files that are shared between applications. So lets say I have 2 apps, A & B. They both make use of a module Z. They both load a shared…
Programming Guy
  • 7,259
  • 11
  • 50
  • 59
5
votes
2 answers

Reading and Processing HOCON in Kotlin

I would like to read the following configuration from a HOCON (Typesafe Config) file into Kotlin. tablename: { columns: [ { item: { type: integer, key: true, null: false } } { desc: { type: varchar, length: 64 } } { quantity: { type:…
Geordee Naliyath
  • 1,799
  • 17
  • 28
4
votes
2 answers

How can I generate Hocon conf file dynamically using pyhocon in Python 3?

I would like to use automation to create the hocon configuration with python 3 scripting. I read that lightbend (https://github.com/lightbend/config) recommends pyhocon (https://github.com/chimpler/pyhocon). I am having problems figuring out how to…
pitchblack408
  • 2,913
  • 4
  • 36
  • 54
3
votes
0 answers

HOCON Key Substitution

Is there anyway we can substitute key in HOCON config files? Below is what I have right now: config1 { "foo" : "bar" } And I'm trying to achieve : config1 { ${keyVariable} : ${valueVariable} } Value substitution is supported but I couldn't find…
Jim
  • 151
  • 1
  • 3
  • 13
3
votes
0 answers

When mapping Typesafe configuration to a bean class (ConfigBeanFactory) is there a way to flag mis-spelled attributes?

Our application is using a reference.conf to provide defaults for one of our POJO's that carries configuration information. Say the Pojo is: class Person { String first; String last; // corresponding setters / getters not shown } The…
Chris Bedford
  • 2,560
  • 3
  • 28
  • 60
1
2 3 4 5 6