Skip to content

Commit 4cbf9a9

Browse files
committed
add uuid reference case
1 parent c6c101a commit 4cbf9a9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.generator/src/generator/formatter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,13 @@ def reference_to_value(schema, value, print_nullable=True, **kwargs):
249249
return formatter.format(prefix=prefix, function_name=function_name, value=value)
250250

251251
if type_name == "string":
252+
if type_format == "uuid":
253+
return f"&{value}"
254+
252255
function_name = {
253256
"date": "Time",
254257
"date-time": "Time",
255258
"email": "String",
256-
"uuid": "Uuid",
257259
None: "String",
258260
}[type_format]
259261
return formatter.format(prefix=prefix, function_name=function_name, value=value)

api/datadog/utils.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import (
1212
"strings"
1313
"time"
1414
"unicode/utf8"
15-
16-
"github.com/google/uuid"
1715
)
1816

1917
// PtrBool is a helper routine that returns a pointer to given boolean value.
@@ -37,12 +35,9 @@ func PtrFloat64(v float64) *float64 { return &v }
3735
// PtrString is a helper routine that returns a pointer to given string value.
3836
func PtrString(v string) *string { return &v }
3937

40-
// PtrTime is a helper routine that returns a pointer to given Time value.
38+
// PtrTime is helper routine that returns a pointer to given Time value.
4139
func PtrTime(v time.Time) *time.Time { return &v }
4240

43-
// PtrUuid is a helper routine that returns a pointer to given Uuid value.
44-
func PtrUuid(v uuid.UUID) *uuid.UUID { return &v }
45-
4641
// PaginationResult pagination item helper struct
4742
type PaginationResult[T any] struct {
4843
Item T

0 commit comments

Comments
 (0)