Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit df52cf5

Browse files
authored
fix: CustomType for SingleTypeOf attribute (#60)
* fix: CustomType for SingleTypeOf attribute * ci(generate): changes by go generate * chore: add changelog --------- Co-authored-by: azrod <azrod@users.noreply.github.com>
1 parent 9b08c28 commit df52cf5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.changelog/60.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
`SingleNestedAttributeOf` - Fix custom type for Single Nested Attribute of
3+
```

supersingle_nested_attribute.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (s SuperSingleNestedAttributeOf[T]) GetResource(ctx context.Context) schema
244244
}
245245
// * If user has not provided a custom type, we will use the default supertypes
246246
if a.CustomType == nil {
247-
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx).ObjectType
247+
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx)
248248
}
249249

250250
deprecationMessage := ""
@@ -299,7 +299,7 @@ func (s SuperSingleNestedAttributeOf[T]) GetDataSource(ctx context.Context) sche
299299
}
300300
// * If user has not provided a custom type, we will use the default supertypes
301301
if a.CustomType == nil {
302-
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx).ObjectType
302+
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx)
303303
}
304304

305305
deprecationMessage := ""

supertype_attribute.go.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func (s Super{{ .TypeName }}AttributeOf[T]) GetResource(ctx context.Context) sch
489489
{{- if or (eq .TypeName "SingleNested") }}
490490
// * If user has not provided a custom type, we will use the default supertypes
491491
if a.CustomType == nil {
492-
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx).ObjectType
492+
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx)
493493
}
494494
{{- end }}
495495

@@ -593,7 +593,7 @@ func (s Super{{ .TypeName }}AttributeOf[T]) GetDataSource(ctx context.Context) s
593593
{{- if or (eq .TypeName "SingleNested") }}
594594
// * If user has not provided a custom type, we will use the default supertypes
595595
if a.CustomType == nil {
596-
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx).ObjectType
596+
a.CustomType = supertypes.NewSingleNestedObjectTypeOf[T](ctx)
597597
}
598598
{{- end }}
599599

0 commit comments

Comments
 (0)