-
Notifications
You must be signed in to change notification settings - Fork 136
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 numeric configuration values to be passed as strings #122
Comments
Sounds good to me. |
Just out of curiosity, what language/library is this? JSON serialization without support for numeric types is surprising (most of the stdlibs I've worked with have it). |
I'm using go. It has support for numbers - the problem is i need to generate a document that is not valid JSON - so I can't deserialize it using the normal method: {
"key": {{ .ENV_PORT }}
} With this change I would be able to deserialize this instead: {
"key": "{{ .ENV_PORT }}"
} |
@justenwalker I see your use case, and now I'm curious about what's behind it ;-) As @tgross said, this sounds good. |
Was covered in #138 |
Accept a string in place of a number for things like
port
andttl
- The change should be backwards compatible - it would accept both numbers and strings which contain a number.Use Case
I have a process that I'm working on that generates a containerbuddy config file. It would be much more useful and maintainable to use the build-in serialization for JSON objects - I can put template definitions into strings, but it's impossible to do the same for numbers. A work around would be to concatenate strings together to form a JSON document instead of using a serializer - which is not ideal.
The text was updated successfully, but these errors were encountered: