WriteJsonString allocates
The function WriteJsonString converts a string to a []byte each time it's called leading to unnecessary allocations, as the WriteJson function could also work with strings.
This could be fixed by either duplicationg the logic from WriteJson to WriteJsonString or by creating a temporary []byte from the string given to WriteJsonString using the unsafe package, which would avoid allocating, but doesn't work on e.g. App Engine, needing build tags.
The first solution leads to code duplication of a big function, but the second one uses unsafe and is not safe by definition (although there is a little change this will ever break, but it means the byte slice passed to WriteJson can't be modified)
It might be easier to focus on removing/converting the invocations of WriteJsonString to WriteJson in the generated code, a couple places i looked, we were actually converting a []byte into a string anyways, and in the others we could have a []byte instead of a string with a little work.