mstdn/ent.Application

master
Charles Iliya Krempeaux 2024-08-08 16:49:58 -07:00
parent efc6351ccb
commit 04cb2bbcce
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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"),