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
2
votes
2 answers

Splitting up a line in a HOCON file

I have file in HOCON format where a very long string is assigned to a key. The string contains single quotes (and other "illegal" characters), and hence I need to enclose the value in double quotes. Something like this: key="extremely long string…
plade
  • 541
  • 4
  • 15
2
votes
1 answer

Typesafe config - Setting placeholder values from a program

Is there any way for dynamically changing the fields of a Typesafe config file, using source code to populate placeholders? For example, assume the following simple configuration statement { values { string1: ${name1} string2: ${name2} …
PNS
  • 19,295
  • 32
  • 96
  • 143
1
vote
0 answers

Memory efficient alternative of Hashmap for storing data (HOCON config) conforming to json-schema

I am using the lightbend/config library to parse and store the HOCON data. The library uses HashMap to capture the hierarchy of data and has memory overhead (than json, partly because of the extra information for debugging and substitutions). I am…
1
vote
1 answer

Using pureconfig to read tuples encoded as a list or array

I'd like to use the PureConfig library to read a list of tuples. That is, I'd like to read { foo: [ [1, 1.0, "Good job!"] [2, 2.0, "Excellent job!"] [3, 0.0, "Please play again."] ] } as a case class Wrapper(foo:Vector[(Int,…
bwbecker
  • 1,031
  • 9
  • 21
1
vote
0 answers

Substituting key with environment variable in HOCON

I am using pureconfig to read config for my Scala application. The application.conf file is in HOCON format. My config file looks something like this weathers { ${?HUMID_WEATHER_ID} { temperature = 10 temperature =…
Ashwin
  • 12,691
  • 31
  • 118
  • 190
1
vote
1 answer

How to define an object as environment variable with hocon config

What I want to do Defining a base set of objects which can be enhanced by an environment variable. In the following you see a little example of my hocon config file so far. foo.bar-base= [ {a: "hello", b: "world"}, {a: "hello", b:…
Yannic Bürgmann
  • 6,301
  • 5
  • 43
  • 77
1
vote
1 answer

Parsing an empty property into an empty Map with PureConfig

I have a case class like the following: case class MyConfig(arg1:String, extraArgs:Map[String,String]) and I would like the following to be parsable from the HOCON config { arg1 = 'hello world' } However this fail because extraArgs is not…
Edmondo
  • 19,559
  • 13
  • 62
  • 115
1
vote
1 answer

HOCON does not override value in case substitution is used

I am using a HOCON configuration file which also has substitution variables. But in the case of substitution variables, the key is not overridden by another value into the same file. For example, consider the following HOCON config: { …
Mukul Garg
  • 102
  • 10
1
vote
0 answers

HOCON escape double quotes

HOCON playground: https://hocon-playground.herokuapp.com/ Here's what I am trying to achieve: I need end result to be: { "HOCON" : "{host =~ "hi*"}", "lbid" : "hi*" } What I am getting is: Input: lbid="hi*" HOCON = "{host =~…
Akshay M
  • 39
  • 1
  • 8
1
vote
1 answer

Config Profiles Akka Cluster

I am working with akka clustering and trying to setup two different configs for different environments. one for my local setup where I would be using seed nodes to start up my application two for my production Kubernetes setup. I tried the…
iam.Carrot
  • 4,976
  • 2
  • 24
  • 71
1
vote
1 answer

What is the easiest way to use python to read pureconfig config files created in scala?

I have a scala config file created with the library pureconfig. I would like to write a wrapper in python to read and write this configfile (to give a better access to non scala users). Is the easiest way to parse the whole schema ? My config file…
Mat Dout
  • 11
  • 1
1
vote
2 answers

ConfigFactory ParseFile resolve with Variable Substitution with a Java system property

I am having issues trying to use the variable substitution with the typesafehub ConfigFactory fileParser my code is Configuration(ConfigFactory.parseFile(new File("/Users/TDong/files/app.conf")).resolve()) and my app.conf file contains path =…
Teddy Dong
  • 362
  • 1
  • 6
  • 20
1
vote
1 answer

How to specify HashMapping when using Hocon

Given the HOCON below for a consitent-hashing-poolrouter, how do I specify the hashMapping. akka { actor { serializers { wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire" } …
ritcoder
  • 3,274
  • 10
  • 42
  • 62
1
vote
2 answers

Dynamic keys in hocon

Let's say I have config like this: root { value1: 1 value2: 2 values { dynamic1 { static1: 10 static2: "test" } dynamic2 { static1: 10 static2: "test" } } } Is it possible and how to get…
Matej Kormuth
  • 2,139
  • 3
  • 35
  • 52
1
vote
1 answer

How to make Array of objects

I have this file (campanhas.conf) working well: campanhas = [ { codigo = CT1 nome = Campanha 1 descricao = Campanha de Teste modoAtendimento = power grupoDAC = grupo1 } { codigo = CT2 nome = Campanha 2 descricao =…
Camilla
  • 489
  • 5
  • 14