Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TOML and JSON support for quarkus configuration #14330

Closed
hrstoyanov opened this issue Jan 15, 2021 · 12 comments
Closed

Add TOML and JSON support for quarkus configuration #14330

hrstoyanov opened this issue Jan 15, 2021 · 12 comments
Labels
area/config kind/enhancement New feature or request

Comments

@hrstoyanov
Copy link

hrstoyanov commented Jan 15, 2021

Description
Quarkus supports java properties, JSON and YAML formats for configuration. Each of these, unfortunately suffers from either verbosity, obscurity or weak syntax validation for configuration purposes, as JSON and YAML are primarily data formats.

TOML emerges as the best format for configuration and it would be a wonderful addition to Quarkus. You can read about TOML here and why it is superior as configuration format.

I wish TOML can go all the way to MicroProfile Config as the preferred standard format.

Implementation ideas
There are several candidate implementations if you gogole "Java toml", for example toml.

@geoand

@hrstoyanov hrstoyanov added the kind/enhancement New feature or request label Jan 15, 2021
@ghost ghost added the triage/needs-triage label Jan 15, 2021
@geoand
Copy link
Contributor

geoand commented Jan 15, 2021

cc @radcortez

@glefloch
Copy link
Member

I would definitely be interested into working on this. As for yml this could be part of an extension. Maybe in quarkiverse?

@geoand
Copy link
Contributor

geoand commented Jan 15, 2021

I am fairly certain that @radcortez will want the core support to be in Smallrye Config.

But let's see what he says

@radcortez
Copy link
Member

I think it would be better if this works happens in SR Config.

On the support itself, there are some limitations due to the MP Config API, namely treating every configuration as a single property key and value as String. This works fine for things like properties files, env, system properties, etc, but it is hard for json or yaml structures.

I do have some ideas on how to improve this, but I think we should work on some prototype before proposing something to the spec.

@radcortez
Copy link
Member

I am fairly certain that @radcortez will want the core support to be in Smallrye Config.

But let's see what he says

:)

@geoand
Copy link
Contributor

geoand commented Jan 15, 2021

A first step however could be to provide s ConfigSource similar to what you have with YAML, right?

Then ConfigProperties could use the same trick it does with for YAML to parse the value of the property for complex structures

@radcortez
Copy link
Member

Yes.

@hrstoyanov
Copy link
Author

I would gladly test prototypes ! I have some real-world complex configurations as the one I sent to @geoand before for yaml.

@radcortez
Copy link
Member

Here is a prototype: smallrye/smallrye-config#497

@hrstoyanov
Copy link
Author

will test shortly!

@hrstoyanov hrstoyanov changed the title Add TOML support for quarkus configuration Add TOML and JSON support for quarkus configuration Apr 9, 2021
@radcortez
Copy link
Member

All additional configuration formats will be supported by https://github.com/quarkiverse/quarkus-config-extensions. I've created quarkiverse/quarkus-config-extensions#6 to track this and we will follow from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants