mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
A schema_org strategy could be tested but not saved. meta-extraction requires
`value` to be null for schema_org and non-empty for every other type, while the
write endpoints required it unconditionally (create) or whenever a type was
present (update). The extension's Tune tab defaults all three fields to
schema_org and omits `value`, so "Test all" succeeded and "Save to store" 422'd
on the identical strategy. No single payload satisfied both, so any store whose
fields are detected via schema.org could not be saved at all.
Extracts the meta-extraction closure into App\Rules\ScrapeStrategyValue and
points all three requests at it. The rule locates the sibling `type` relative to
the attribute under validation, so it works at any path without a configured
prefix, and is implicit so it still runs when `value` is absent - which is both
how a schema_org strategy is legitimately sent and how a selector with no
expression is caught. Which types need a value stays owned by
ScraperStrategyType::needsValue().
A saved schema_org strategy round-trips as `{"type": "schema_org"}` with no
value key at all - StandardStrategyDto drops null values rather than persisting
them - and that shape is valid input to all three endpoints. Covered by a test
that creates a store, reads it back and posts it to meta-extraction.
Also adds the stores_filter_domain capability to /api/client-config, so clients
stop inferring filter[domain] support from products_filter_url.