-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnyOf throws error when used with $refs #43
Comments
Thanks for the report, what do you think should happen here? Since the return "interface{}", fmt.Errorf("failed to get a primitive type for schemaType '%s' and subtype '%s'",
schemaType, subType) Instead of // Code generated by schema-generate. DO NOT EDIT.
package main
// Address Address
type Address struct {
County string `json:"county,omitempty"`
District string `json:"district,omitempty"`
FlatNumber string `json:"flatNumber,omitempty"`
HouseName string `json:"houseName,omitempty"`
HouseNumber string `json:"houseNumber,omitempty"`
Postcode string `json:"postcode,omitempty"`
Street string `json:"street,omitempty"`
Town string `json:"town,omitempty"`
}
// Example example
type Example struct {
Name interface{} `json:"name,omitempty"`
}
// Status
type Status struct {
Favouritecat string `json:"favouritecat,omitempty"`
} |
Using interface{} would work. Another possible solution would be to declare a third structure such as, following the example above: type StatusAddress struct {
*Status
*Address
} and then type Example struct {
Name *StatusAddress `json:"name,omitempty"`
} I am not sure which one is better. The simplicity of using interface{} is appealing. |
The attached Schema produces the error
mytest.txt
The text was updated successfully, but these errors were encountered: