fix redundant skills registry names in saved config
This commit is contained in:
parent
59c8c76588
commit
954ea3be14
2 changed files with 2 additions and 6 deletions
|
|
@ -445,9 +445,6 @@ func (c SkillRegistryConfig) MarshalJSON() ([]byte, error) {
|
|||
"enabled": c.Enabled,
|
||||
"base_url": c.BaseURL,
|
||||
}
|
||||
if c.Name != "" {
|
||||
m["name"] = c.Name
|
||||
}
|
||||
if c.AuthToken.String() != "" {
|
||||
m["auth_token"] = c.AuthToken
|
||||
}
|
||||
|
|
@ -514,9 +511,6 @@ func (c SkillRegistryConfig) MarshalYAML() (any, error) {
|
|||
"enabled": c.Enabled,
|
||||
"base_url": c.BaseURL,
|
||||
}
|
||||
if c.Name != "" {
|
||||
m["name"] = c.Name
|
||||
}
|
||||
if c.AuthToken.String() != "" {
|
||||
m["auth_token"] = c.AuthToken
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,8 @@ func TestSkillsRegistriesConfigMarshalJSONPreservesObjectShape(t *testing.T) {
|
|||
assert.Contains(t, string(data), `"github":{`)
|
||||
assert.Contains(t, string(data), `"clawhub":{`)
|
||||
assert.NotContains(t, string(data), `[{`)
|
||||
assert.NotContains(t, string(data), `"name":"github"`)
|
||||
assert.NotContains(t, string(data), `"name":"clawhub"`)
|
||||
|
||||
var decoded map[string]json.RawMessage
|
||||
err = json.Unmarshal(data, &decoded)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue