summaryrefslogtreecommitdiffhomepage
path: root/parser
diff options
context:
space:
mode:
Diffstat (limited to 'parser')
-rw-r--r--parser/lowercase_camel_json.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/parser/lowercase_camel_json.go b/parser/lowercase_camel_json.go
index e7aeb2abf..6994d1215 100644
--- a/parser/lowercase_camel_json.go
+++ b/parser/lowercase_camel_json.go
@@ -14,6 +14,7 @@
package parser
import (
+ "bytes"
"encoding/json"
"regexp"
"unicode"
@@ -35,6 +36,12 @@ func (c LowerCaseCamelJSONMarshaller) MarshalJSON() ([]byte, error) {
converted := keyMatchRegex.ReplaceAllFunc(
marshalled,
func(match []byte) []byte {
+
+ // Attributes on the form XML, JSON etc.
+ if bytes.Equal(match, bytes.ToUpper(match)) {
+ return bytes.ToLower(match)
+ }
+
// Empty keys are valid JSON, only lowercase if we do not have an
// empty key.
if len(match) > 2 {