From 04cb2bbcce77dc686046594d7e7567a0a0447719 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Thu, 8 Aug 2024 16:49:58 -0700 Subject: [PATCH] mstdn/ent.Application --- ent/application.go | 2 +- ent/application_marshaljson_test.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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"),