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

how to load the config with substitution details #794

Open
srikanth-exabeam opened this issue Aug 1, 2023 · 3 comments
Open

how to load the config with substitution details #794

srikanth-exabeam opened this issue Aug 1, 2023 · 3 comments

Comments

@srikanth-exabeam
Copy link

we have the config below format

LocationDataTemplate = {
	sample-data-template = {
		City = Mumbai
		Country = India
	}
}

HotelDetails = [
{
	Name = "The Taj Mahal Palace"
	Address = "Colaba"
},

	${LocationDataTemplate.sample-data-template}{
		Name = "Four Seasons Hotel"
		Address = "Worli"
	}
]

In HotelDetails we are using substitution as ${LocationDataTemplate.sample-data-template}.
While loading this config data of 'HotelDetails' we want to load with substitution details intact as we want to maintain reference of substitution.

We tried multiple scenarios but did not got the way to load details with substitutions.
Please share sample code for this scenario.

@srikanth-exabeam srikanth-exabeam changed the title how to load the config with substitution also how to load the config with substitution details Aug 1, 2023
@ekrich
Copy link
Contributor

ekrich commented Aug 1, 2023

The documentation is pretty good but it doesn't seem you can do what you are asking - https://github.com/lightbend/config#uses-of-substitutions

@srikanth-exabeam
Copy link
Author

The documentation is pretty good but it doesn't seem you can do what you are asking - https://github.com/lightbend/config#uses-of-substitutions

@ekrich the link you shared is for uses of substitutions, but we need raw details of substitutions.
ConfigConcatenation.java has the 'pieces' property to share substitution and config details separately but we can't use 'ConfigConcatenation' class since it has default scoped.

@havocp
Copy link
Collaborator

havocp commented Aug 2, 2023

maybe ConfigResolver can help?

Otherwise the unfinished ConfigDocument api would be the needed thing to use the library as a parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants