-
Notifications
You must be signed in to change notification settings - Fork 168
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
Allow JSON schema output indentation to be configurable #439
Comments
…able - Add `inlineJSON` boolean configuration field to the `Format` struct. Include this field in the YAML marshal / unmarshal functions. - Update the uses of `json.New()` to use the value from the configuration. - Update `README` to contain the new configuration field.
@sprak3000 Thank you for your comment! The JSON of
Are there any use cases where this would be helpful? (I don't particularly care about indentation as I believe the |
Conceptually, what is the difference between the two for you? I put together a quick PR around this to output both indented. I cannot see any difference between the two outputs; they result in the same JSON structure.
My use case is checking these files into a repo as documentation and being able to quickly and easily see the differences in a PR. Currently, our pipeline creates the file using
It is, but this tool could do the same meaning one less dependency. Regardless, thank you very much for creating and maintaining this tool! |
fmfm. So what about changing the schema.json of |
I'd be fine with that, but I'm also fine leaving it as is and adding Thank you again! Cheers. |
@sprak3000 Thank you. I'll think about indentation again. |
This is my use case too. Having said that, my workaround was to simply disable the |
Currently, the JSON schema can be generated in two ways but with different indentation of the output. Running
tbls doc
results in the output file containing no indentation, just a single string of JSON. Runningtbls out -t json
results in an output file where the JSON is indented making it easier to read. It would be helpful to have a configuration option allowing both commands to either indent or not based on its value.The
OutputSchema
function controls this behavior via aninline
parameter on theJSON
struct. Theout
command passes infalse
. Thedoc
command passes intrue
. Both appear to have access to the configuration.Seems like a straightforward change with the only question in my mind is if there should be two separate configuration items to allow you to configure both commands separately or just one that both commands use.
The text was updated successfully, but these errors were encountered: