diff --git a/ent/application.go b/ent/application.go index fc613b2..5a77b16 100644 --- a/ent/application.go +++ b/ent/application.go @@ -10,7 +10,7 @@ import ( // See: // https://docs.joinmastodon.org/entities/Application/ type Application struct { - Name opt.Optional[string] `json:"name"` + Name opt.Optional[string] `json:"name,omitempty"` WebSite nul.Nullable[string] `json:"website,omitempty"` // optional — field has JSON null value in JSON if not set VapidKey opt.Optional[string] `json:"vapid_key,omitempty"` // optional — field not included in JSON if not set ClientID opt.Optional[string] `json:"client_id,omitempty"` // optional — field not included in JSON if not set diff --git a/ent/application_marshaljson_test.go b/ent/application_marshaljson_test.go index 12ea057..5b1e897 100644 --- a/ent/application_marshaljson_test.go +++ b/ent/application_marshaljson_test.go @@ -17,6 +17,13 @@ func TestApplication_MarshalJSON(t *testing.T) { Application ent.Application Expected string }{ + { + Application: ent.Application{}, + Expected: "{}", + }, + + + { Application: ent.Application{ Name: opt.Something("acme app"),