Open willosborne opened 3 months ago
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
Suggestion is to remove from 1.0 milestone.
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 numbersThis 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.