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

Output JSONPath information for generated architecture #318

Open
willosborne opened this issue Jul 26, 2024 · 1 comment
Open

Output JSONPath information for generated architecture #318

willosborne opened this issue Jul 26, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@willosborne
Copy link
Member

Feature Request

Description of Problem:

Currently when generate is run, it spits out a file with placeholders for missing values:

  • {{ PLACEHOLDER }} for strings
  • -1 for numbers

This is fine for human-editing, but when an automated tool is going to insert values, knowing the exact location of these values in the document requires hand-editing JSONPaths.
If the pattern itself changes, these JSONPaths could also get out of date - leading to failed modifications when filling out the pattern. Generally the burden of maintenance is higher.

It would be great to have JSONPath information alongside generated architectures to facilitate these updates.

Note: previously the team discussed the idea of outputting as a Jinja2 template - this would also work, but the caveat here is that the template wouldn't actually be a valid JSON document. It also locks us onto a specific templating engine; J2 is common for languages like Python, but Kubernetes frameworks such as Kustomize use different engines.

Potential Solutions:

Whenever a placeholder is generated, record the JSONPath on which it was output.
Then output a file containing all these paths in a structured JSON form alongside the generated architecture if a flag is passed - such as --placeholder-paths, for example.

This might require some changes to how we generate placeholders as currently this information is not tracked.

@willosborne willosborne added the enhancement New feature or request label Jul 26, 2024
@grahampacker-ms
Copy link
Member

Alternative solution:

Provide an option to only generate the JSONPaths to each placeholder. Then, provide a new option (--properties?) to provide an input file which maps the JSONPaths to a value with generation which will populate the placeholders.

Thoughts? @willosborne

@rocketstack-matt rocketstack-matt added this to the 1.0 milestone Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants