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

Representing Either in pureconfig

I have a HOCON config like this: [ { name = 1 url = "http://example.com" }, { name = 2 url = "http://example2.com" }, { name = 3 url = { A = "http://example3.com" …
mirelon
  • 4,896
  • 6
  • 40
  • 70
3
votes
3 answers

Convert HOCON string into Java object

One of my webservice return below Java string: [ { id=5d93532e77490b00013d8862, app=null, manufacturer=pearsonEducation, bookUid=bookIsbn, model=2019, firmware=[1.0], bookName=devotional, …
VelNaga
  • 3,593
  • 6
  • 48
  • 82
3
votes
1 answer

Add conf file to classpath in Google Dataproc

We're building a Spark application in Scala with a HOCON configuration, the config is called application.conf. If I add the application.conf to my jar file and start a job on Google Dataproc, it works correctly: gcloud dataproc jobs submit spark \ …
pgruetter
  • 1,184
  • 1
  • 11
  • 29
3
votes
1 answer

Load typesafe configs in HOCON format from custom locations at runtime

I have an application that will get job configurations informed thru files (likely to have dozens of them each describing a particular job to be done by the app, preferably being flexible about where they are located), and for that we chose HOCON…
Welsige
  • 149
  • 1
  • 10
3
votes
3 answers

How can I generate typesafe config (Hocon) file dynamically in scala (generate config file)

I want to generate Hocon config dynamically. Input Map and output file with below content block{ key1 : value key2 : value } Trying to read map var myMap = new util.HashMap[String,AnyRef]() val myConfig =…
user2895589
  • 1,010
  • 4
  • 20
  • 33
3
votes
1 answer

How to read HOCON config to load values into Map?

I have a config as mentioned here map-config{ key1 : [ list1, list2, list3 ], key2 : [ list4, list5 ], key3 : [ list6 ] } Once after loading I except it have a Map with keyset as key1, key2 and key3 whose corresponding…
Puneeth Reddy V
  • 1,538
  • 13
  • 28
3
votes
1 answer

In a play framework config (hocon), how do I use an environment variable or a default?

In application.conf, how do I use a environment variable to set a value, or a default if said environment variable is empty?
Reactormonk
  • 21,472
  • 14
  • 74
  • 123
3
votes
2 answers

Parse hocon file using shell script

I have one hocon configuration created from JSON file. I need to parse the following hocon and extract the values sample hocon file: sample.json nodes=[ { host=myhostname name=myhostname ports { # debug…
Sohan
  • 6,252
  • 5
  • 35
  • 56
3
votes
5 answers

Scala + Play, how to get a duration from the HOCON configuration?

Imagine I have a Duration value defined in my application.conf file. The documentation says it can parse Durations, but I can't see how. timeout = 60 milliseconds Can I parse it directly as a duration value? Ideally I would like to do something…
ticofab
  • 7,551
  • 13
  • 49
  • 90
3
votes
2 answers

PlayFramework Configuration - Long Strings

How can I handle very long strings in Play's application.conf? Suppose I have: my.value.param = "Very very very very long line" and I want to split long line like my.value.param = "Very very very " + "very long line" How can I do…
selfsx
  • 581
  • 7
  • 23
2
votes
0 answers

Conditional statement in HOCON configuration files

I need to write a production.conf file for my play framework and scala application. I have few requirements like if , then username = else username = . I am currently using jinja2…
Nikhil Raj
  • 21
  • 2
2
votes
1 answer

Merge array values in configuration using withFallBack in typesafe config

I have some data available as type safe configuration files in HOCON format. There is a base-file like this : "data":{ "k1":{ "values": ["v1", "v2"] }, "k2":{ "values": ["x1"] }, "k3":{ "values": ["z1"] } } There could be a…
nishantv
  • 643
  • 4
  • 9
  • 27
2
votes
1 answer

HOCON config file dynamic substitution

I'm using HOCON to configure log messages and I'm looking for a way to substitute placeholder values dynamically. I know that ${?PLACEHOLDER} will read an environment variable and returns an empty string when the PLACEHOLDER environment variable…
Johan Vergeer
  • 5,208
  • 10
  • 48
  • 105
2
votes
1 answer

Akka.NET not recognising my custom logger and defaulting to BusLogger

I am learning Akka.NET. I am trying to create a custom logger. I followed a tutorial blog post here. I have been unable to get Akka to wire up my custom logger. Apparently the line var sys = ActorSystem.Create("AkkaCustomLoggingActorSystem"); reads…
08Dc91wk
  • 4,254
  • 8
  • 34
  • 67
2
votes
1 answer

HOCON conditional substitution with surrounding text

I have no way currently to test this syntax myself, thus the question: Will substitution/overriding of a value still happen if it's surrounded by text? For example, I know that: foo.baseUrl = "http://foo:1234/" foo.baseUrl = ${?FOO_BASE_URL} will…
Spanky
  • 5,608
  • 10
  • 39
  • 45