forked from tangled.org/core
Monorepo for Tangled

lexicon: fix trailing comma in sh.tangled.actor.profile

Changed files
+30 -61
api
appview
lexicons
actor
+1 -1
api/tangled/actorprofile.go
··· 19 type ActorProfile struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.actor.profile" cborgen:"$type,const=sh.tangled.actor.profile"` 21 // bluesky: Include link to this account on Bluesky. 22 - Bluesky *bool `json:"bluesky,omitempty" cborgen:"bluesky,omitempty"` 23 // description: Free-form profile description text. 24 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 25 Links []string `json:"links,omitempty" cborgen:"links,omitempty"`
··· 19 type ActorProfile struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.actor.profile" cborgen:"$type,const=sh.tangled.actor.profile"` 21 // bluesky: Include link to this account on Bluesky. 22 + Bluesky bool `json:"bluesky" cborgen:"bluesky"` 23 // description: Free-form profile description text. 24 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 25 Links []string `json:"links,omitempty" cborgen:"links,omitempty"`
+25 -53
api/tangled/cbor_gen.go
··· 3398 cw := cbg.NewCborWriter(w) 3399 fieldCount := 7 3400 3401 - if t.Bluesky == nil { 3402 - fieldCount-- 3403 - } 3404 - 3405 if t.Description == nil { 3406 fieldCount-- 3407 } ··· 3518 } 3519 3520 // t.Bluesky (bool) (bool) 3521 - if t.Bluesky != nil { 3522 3523 - if len("bluesky") > 1000000 { 3524 - return xerrors.Errorf("Value in field \"bluesky\" was too long") 3525 - } 3526 3527 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("bluesky"))); err != nil { 3528 - return err 3529 - } 3530 - if _, err := cw.WriteString(string("bluesky")); err != nil { 3531 - return err 3532 - } 3533 - 3534 - if t.Bluesky == nil { 3535 - if _, err := cw.Write(cbg.CborNull); err != nil { 3536 - return err 3537 - } 3538 - } else { 3539 - if err := cbg.WriteBool(w, *t.Bluesky); err != nil { 3540 - return err 3541 - } 3542 - } 3543 } 3544 3545 // t.Location (string) (string) ··· 3779 // t.Bluesky (bool) (bool) 3780 case "bluesky": 3781 3782 - { 3783 - b, err := cr.ReadByte() 3784 - if err != nil { 3785 - return err 3786 - } 3787 - if b != cbg.CborNull[0] { 3788 - if err := cr.UnreadByte(); err != nil { 3789 - return err 3790 - } 3791 - 3792 - maj, extra, err = cr.ReadHeader() 3793 - if err != nil { 3794 - return err 3795 - } 3796 - if maj != cbg.MajOther { 3797 - return fmt.Errorf("booleans must be major type 7") 3798 - } 3799 - 3800 - var val bool 3801 - switch extra { 3802 - case 20: 3803 - val = false 3804 - case 21: 3805 - val = true 3806 - default: 3807 - return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) 3808 - } 3809 - t.Bluesky = &val 3810 - } 3811 } 3812 // t.Location (string) (string) 3813 case "location":
··· 3398 cw := cbg.NewCborWriter(w) 3399 fieldCount := 7 3400 3401 if t.Description == nil { 3402 fieldCount-- 3403 } ··· 3514 } 3515 3516 // t.Bluesky (bool) (bool) 3517 + if len("bluesky") > 1000000 { 3518 + return xerrors.Errorf("Value in field \"bluesky\" was too long") 3519 + } 3520 3521 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("bluesky"))); err != nil { 3522 + return err 3523 + } 3524 + if _, err := cw.WriteString(string("bluesky")); err != nil { 3525 + return err 3526 + } 3527 3528 + if err := cbg.WriteBool(w, t.Bluesky); err != nil { 3529 + return err 3530 } 3531 3532 // t.Location (string) (string) ··· 3766 // t.Bluesky (bool) (bool) 3767 case "bluesky": 3768 3769 + maj, extra, err = cr.ReadHeader() 3770 + if err != nil { 3771 + return err 3772 + } 3773 + if maj != cbg.MajOther { 3774 + return fmt.Errorf("booleans must be major type 7") 3775 + } 3776 + switch extra { 3777 + case 20: 3778 + t.Bluesky = false 3779 + case 21: 3780 + t.Bluesky = true 3781 + default: 3782 + return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) 3783 } 3784 // t.Location (string) (string) 3785 case "location":
+1 -4
appview/ingester.go
··· 210 description = *record.Description 211 } 212 213 - includeBluesky := false 214 - if record.Bluesky != nil { 215 - includeBluesky = *record.Bluesky 216 - } 217 218 location := "" 219 if record.Location != nil {
··· 210 description = *record.Description 211 } 212 213 + includeBluesky := record.Bluesky 214 215 location := "" 216 if record.Location != nil {
+1 -1
appview/state/profile.go
··· 320 Rkey: "self", 321 Record: &lexutil.LexiconTypeDecoder{ 322 Val: &tangled.ActorProfile{ 323 - Bluesky: &profile.IncludeBluesky, 324 Description: &profile.Description, 325 Links: profile.Links[:], 326 Location: &profile.Location,
··· 320 Rkey: "self", 321 Record: &lexutil.LexiconTypeDecoder{ 322 Val: &tangled.ActorProfile{ 323 + Bluesky: profile.IncludeBluesky, 324 Description: &profile.Description, 325 Links: profile.Links[:], 326 Location: &profile.Location,
+2 -2
lexicons/actor/profile.json
··· 8 "key": "literal:self", 9 "record": { 10 "type": "object", 11 - "properties": { 12 "required": [ 13 - "bluesky", 14 ], 15 "description": { 16 "type": "string", 17 "description": "Free-form profile description text.",
··· 8 "key": "literal:self", 9 "record": { 10 "type": "object", 11 "required": [ 12 + "bluesky" 13 ], 14 + "properties": { 15 "description": { 16 "type": "string", 17 "description": "Free-form profile description text.",