-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Milestone
Description
I have request that returning in response type Event defined like:
event:
oneOf:
- $ref: '#/components/schemas/eventTypeOnetimeEditableField'
- $ref: '#/components/schemas/eventTypeRepeatableEditableField'
Generated types are:
type Event struct {
union json.RawMessage
}
func (t Event) MarshalJSON() ([]byte, error) {
b, err := t.union.MarshalJSON()
return b, err
}
type PostDescribeEventById200JSONResponse Event
The problem is PostDescribeEventById200JSONResponse on json marshalling returning empty json "{}". This happens because PostDescribeEventById200JSONResponse is not using MarshalJSON() of underlying struct Event.
Using type alias instead of underlying type solving my problem:
type PostDescribeEventById200JSONResponse = Event
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels