@@ -36,13 +36,14 @@ func normalizeDateTimeValue(s string) string {
3636 if dotIdx == - 1 {
3737 // No fractional part — insert .0000000 before timezone suffix.
3838 // Search from index 19+ to avoid matching the '-' in the date portion (YYYY-MM-DD).
39- if len (s ) > 19 {
39+ if len (s ) >= 19 {
4040 if idx := strings .IndexAny (s [19 :], "Z+-" ); idx >= 0 {
4141 pos := 19 + idx
4242 return s [:pos ] + ".0000000" + s [pos :]
4343 }
4444 }
45- return s
45+ // No timezone suffix — append fractional part at end
46+ return s + ".0000000"
4647 }
4748 // Find where fractional digits end (at Z, +, - or end of string)
4849 fracEnd := len (s )
@@ -113,7 +114,7 @@ var reservedExposedNames = map[string]bool{
113114}
114115
115116// resolveExposedName returns the custom name if mapped, otherwise capitalizes the JSON key.
116- // Reserved names (Id, Type, Name ) are prefixed with underscore to match Studio Pro behavior.
117+ // Reserved names (Id, Type) are prefixed with underscore to match Studio Pro behavior.
117118func (b * snippetBuilder ) resolveExposedName (jsonKey string ) string {
118119 if b .customNameMap != nil {
119120 if custom , ok := b .customNameMap [jsonKey ]; ok {
@@ -230,7 +231,7 @@ func (b *snippetBuilder) buildElementFromRawValue(exposedName, path, jsonKey str
230231 return buildValueElement (exposedName , path , primitiveType , fmt .Sprintf ("%q" , v ))
231232 case float64 :
232233 // Check the raw JSON text for a decimal point — Go's %v drops ".0" from 41850.0
233- if v == math .Trunc (v ) && ! strings .Contains (trimmed , "." ) {
234+ if v == math .Trunc (v ) && ! strings .Contains (trimmed , "." ) && v >= - ( 1 << 53 ) && v <= ( 1 << 53 ) {
234235 return buildValueElement (exposedName , path , "Integer" , fmt .Sprintf ("%v" , int64 (v )))
235236 }
236237 return buildValueElement (exposedName , path , "Decimal" , fmt .Sprintf ("%v" , v ))
@@ -348,8 +349,9 @@ func (b *snippetBuilder) buildElementFromRawArray(exposedName, path, jsonKey, ra
348349 return arrayElem
349350}
350351
351- // singularize returns a simple singular form by stripping trailing "s".
352- // Handles common cases: Tags→Tag, Items→Item, Addresses→Addresse.
352+ // singularize returns a naive singular form by stripping trailing "s".
353+ // Handles common cases: Tags→Tag, Items→Item. Known-incorrect for some words
354+ // (e.g. Addresses→Addresse) — this matches Studio Pro's behavior.
353355func singularize (s string ) string {
354356 if len (s ) > 1 && strings .HasSuffix (s , "s" ) {
355357 return s [:len (s )- 1 ]
0 commit comments