fix: set_url_seo and record imports refuse a locale the record does not have (WR-18)

A locale given with a URL write overrode the matched one unchecked, so
"xx" created an entry nothing ever reads while the answer reported
success. SetURLSEO (API, MCP, batch set_seo, records import) now requires
one of the record's locales and refuses others with api.locale_unknown.
This commit is contained in:
2026-10-27 15:37:31 +01:00
parent 24e6f384ca
commit cff2d29fdd
5 changed files with 23 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ func (v SEOValues) Map() map[string]string {
// SetSEOInput is the body of PUT /_seo/api/v1/seo.
type SetSEOInput struct {
URL string `json:"url" jsonschema:"the page: a path such as /blog/post or an absolute URL of the site"`
Locale string `json:"locale,omitempty" jsonschema:"the locale of a record's SEO; the locale the URL matches when omitted"`
Locale string `json:"locale,omitempty" jsonschema:"the locale of a record's SEO, one of the record's locales (422 locale_unknown otherwise); the locale the URL matches when omitted"`
Values SEOValues `json:"values" jsonschema:"the values to change"`
ForceRule bool `json:"force_rule,omitempty" jsonschema:"write a URL rule even when a record is behind the URL"`
}