Skip to content

Commit

Permalink
fix ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed May 16, 2024
1 parent bb9a9f8 commit f5c8aed
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/controller/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ func validateValue(fieldType schema.Type, path path, value any, sch *schema.Sche
}
typeMatches = true
}
case *schema.TypeAlias:
return validateValue(d.Type, path, value, sch)
case *schema.Enum:
var inputName any
inputName = value
Expand Down
25 changes: 24 additions & 1 deletion backend/controller/ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,30 @@ func TestValidation(t *testing.T) {
unit Unit
}
}`,
request: obj{}},
request: obj{},
},
{name: "StringAlias",
schema: `module test {
typealias StringAlias String
data Test { stringValue test.StringAlias }
}`,
request: obj{"stringValue": "test"},
},
{name: "IntAlias",
schema: `module test {
typealias IntAlias Int
data Test { intValue test.IntAlias }
}`,
request: obj{"intValue": 10.0},
},
{name: "DataAlias",
schema: `module test {
typealias IntAlias test.Inner
data Inner { string String }
data Test { obj test.IntAlias }
}`,
request: obj{"obj": obj{"string": "test"}},
},
{name: "RequiredFields",
schema: `module test { data Test { int Int } }`,
request: obj{},
Expand Down

0 comments on commit f5c8aed

Please sign in to comment.