Skip to content

textile plugin never validates productIdentifier #324

Description

@LKSNDRTMLKV

Found auditing plugin validate_input against schema required for every
product group (#322).

The gap

Textile v1.3.0 requires productIdentifier. TextilePlugin::validate_input
(the textile branch) checks fibreComposition, countryOfOrigin,
careInstructions and chemicalComplianceStandard. It never checks the
identifier.

Textile is the one plugin #322 did not fix by substitution, because it is the
one plugin that never called require_gtin in the first place. It was clean
through the identifier migration by accident, not by design — and that same
accident means it is now the only plugin not validating the identifier.

Note on the dual-product-group plugin

This crate serves both textile and unsold-goods, dispatched on the
in-payload productGroup discriminant. Only the textile branch should gain
this check.
unsold-goods correctly has no productIdentifier — an Art. 24–25
discard disclosure covers a financial year across many products and identifies
no single one, which is why ProductGroupData::product_identifier() answers
None for it and why a registration built from one is refused.

Adding the check to the shared path would refuse every unsold-goods report.

Fix

In the else (textile) branch only:

.require_product_identifier("productIdentifier")

plus a test that an unsold-goods payload is still accepted without one — that is
the assertion that keeps the two branches honest.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    surface/rulesMoves a threshold or cross-field ruletype/defectSomething published or encoded here is wrong or unbackable nowurgency/backlogOwed, unscheduled

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions