Skip to content

move model.bom.Bom.validate() to validation.models #455

Description

@jkowalleck

now that a package validation was established via #432,
t should be possible to move the data model validation there, too.\

data model validation is getting more and more complex #453
and should be encapsulated and could be devided.

Activity

  1. added this to the 5.0.0 milestone on Sep 25, 2023
  2. linked a pull request that will close this issue[IDEA] refactor: model validator #456on Sep 26, 2023
  3. removed this from the 5.0.0 milestone on Oct 11, 2023
  4. changed the title [-][IDEA] move `model.bom.Bom.validate()` to `validation.models`[/-] [+]move `model.bom.Bom.validate()` to `validation.models`[/+] on Sep 16, 2024
  5. added this to the 8.0.0 milestone on Sep 16, 2024
  6. removed this from the 8.0.0 milestone on Sep 17, 2024
  7. saquibsaifee commented on Jan 30, 2026

    @saquibsaifee
    Contributor

    This is just moving Bom.validate() to validation.model as-is and update the references, or do you want it refactored into smaller functions?

  8. jkowalleck commented on Feb 6, 2026

    @jkowalleck
    MemberAuthor

    This is just moving Bom.validate() to validation.model as-is and update the references, or do you want it refactored into smaller functions?

    existing public API shall be deprecated and something more advanced shall be provided.
    details may be discussed

  9. saquibsaifee commented on Feb 15, 2026

    @saquibsaifee
    Contributor

    Opened a draft to get something going on.

    I've implemented a ModelValidator that returns an iterable of errors (so you can collect multiple issues instead of failing on the first one). It's side-effect free - just validates, doesn't mutate anything.

    @jkowalleck I noticed Bom.validate() was marked "deprecated without replacement," but it does two things - normalization (
    register_dependency calls) AND validation. For backward compatibility, I kept both in the deprecated method. The new ModelValidator only validates. How do you want to handle this going forward?

    1. Keep the current approach (normalization stays in deprecated Bom.validate())
    2. Remove it completely (breaking change) and make validation optional with a parameter
  10. saquibsaifee commented on Feb 15, 2026

    @saquibsaifee
    Contributor

    Do you already have some ideas about advance impelementation?

    1. Schema-based
    2. Multi-mode (strict, unstrict)
    3. Severity level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions