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

Generate config json from ServiceConfig struct #636

Closed
qshanahan-springhealth opened this issue Jan 30, 2023 · 2 comments
Closed

Generate config json from ServiceConfig struct #636

qshanahan-springhealth opened this issue Jan 30, 2023 · 2 comments

Comments

@qshanahan-springhealth
Copy link

I would like to be able to write a go program to code generate a krakend config json. The simplest way I could think to do this would be to create a ServiceConfig struct and marshal this to json. However, there are not adequate struct tags to do this. Also, the mapstructure library doesn't adequately support this either, it only supports decoding. here's what I tried:

	cfg := config.ServiceConfig{
		// config goes here
	}

	cfgMap := map[string]interface{}{}

	err = mapstructure.Decode(cfg, &cfgMap)
	if err != nil {
		panic(err)
	}

	marshal, err := json.Marshal(cfgMap)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(marshal))
@github-actions
Copy link

Hi, thank you for bringing this issue to our attention.

Many factors influence our product roadmaps and determine the features, fixes, and suggestions we implement.
When deciding what to prioritize and work on, we combine your feedback and suggestions with insights from our development team, product analytics, research findings, and more.

This information, combined with our product vision, determines what we implement and its priority order. Unfortunately, we don't foresee this issue progressing any further in the short-medium term, and we are closing it.

While this issue is now closed, we continue monitoring requests for our future roadmap, including this one.

If you have additional information you would like to provide, please share.


This is an automated comment. Responding to the bot or mentioning it won't have any effect

Copy link

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants