mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-13 23:35:19 +00:00
fix: 🐛 Fixed array to slice array resolution on reflection GetRelationType
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -35m20s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Failing after -35m20s
Build , Vet Test, and Lint / Lint Code (push) Failing after -35m20s
Build , Vet Test, and Lint / Build (push) Failing after -35m20s
Tests / Unit Tests (push) Failing after -35m21s
Tests / Integration Tests (push) Failing after -35m21s
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -35m20s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Failing after -35m20s
Build , Vet Test, and Lint / Lint Code (push) Failing after -35m20s
Build , Vet Test, and Lint / Build (push) Failing after -35m20s
Tests / Unit Tests (push) Failing after -35m21s
Tests / Integration Tests (push) Failing after -35m21s
This commit is contained in:
@@ -76,9 +76,14 @@ func GetJSONNameForField(modelType reflect.Type, fieldName string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Handle pointer types
|
||||
if modelType.Kind() == reflect.Ptr {
|
||||
modelType = modelType.Elem()
|
||||
// Unwrap pointer and slice indirections to reach the struct type
|
||||
for {
|
||||
switch modelType.Kind() {
|
||||
case reflect.Ptr, reflect.Slice:
|
||||
modelType = modelType.Elem()
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
if modelType.Kind() != reflect.Struct {
|
||||
|
||||
Reference in New Issue
Block a user