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

Switch to using json string capabilities #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kddejong
Copy link
Contributor

Issue #, if available:

Description of changes:

  • Switch to using json package capabilities to string types that aren't strings

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -12,7 +12,7 @@ package resource
// {{model_name}} is autogenerated from the json schema
type {{model_name}} struct {
{% for name, type in properties.items() %}
{{ name|uppercase_first_letter }} {{ type|translate_type }} `json:",omitempty"`
{{ name|uppercase_first_letter }} {{ type|translate_type }} `json:",omitempty{% if type|translate_type in ["*bool", "*int", "*float64"] %},string{% endif %}"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started != "*string" but that will add string to nested structs. Switched to this instead. I think this list is extensive.

We cannot include this with strings or you will end up with nested quotes. "\"string\""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant