Skip to content

Conversation

@tcriess
Copy link

@tcriess tcriess commented May 22, 2021

Allows for custom type and custom format in the "goas" struct tag. This is f.e. for custom "Null"-types that are supposed to behave like nullable variants of standard types.

type Model struct {
    Active NullBool `json:"active" goas:"type=boolean"`
    Created NullTime `json:"created" goas:"type=string,format=date-time"`
}

with

type NullBool struct {
    Valid bool
    Bool bool
}

(NullBool and NullTime have their respective json marshaler to behave like bool and time.Time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant