-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of ogen are you using?
$ go list -m github.com/ogen-go/ogen
github.com/ogen-go/ogen v1.14.0
Can this issue be reproduced with the latest version?
Yes
What did you do?
When specification openapi3.0 has nested field with recursive ref into allOf:
"Error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"nullable": true
},
"cause": {
"allOf": [
{
"$ref": "#/components/schemas/Error"
}
],
"nullable": true
}
}
}
then ogen generate structure like this:
type Error struct {
Code OptNilString `json:"code"`
Cause *OptError `json:"cause"`
}
But ogen doesn't generate OptError struct, so we have compilation error
If we delete allOf from specification:
"Error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"nullable": true
},
"cause": {
"$ref": "#/components/schemas/Error",
"nullable": true
}
}
}
Then ogen generates structure like this:
type Error struct {
Code OptNilString `json:"code"`
Cause *Error `json:"cause"`
}
and additional generate OptError structure and it's methods
What did you expect to see?
Expected: generation OptError structure is independent of allOf
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working