Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: CycloneDX/cyclonedx-python-lib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: CycloneDX/cyclonedx-python-lib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feat/validator_error_iterator
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 6 files changed
  • 2 contributors

Commits on Jun 18, 2025

  1. fix: typo _validata_data

    Signed-off-by: Krisztian Fekete <1246751+e3krisztian@users.noreply.github.com>
    e3krisztian committed Jun 18, 2025
    Configuration menu
    Copy the full SHA
    e23446b View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2025

  1. feat: add new properties to ValidationError

    ValidationError had a single untyped property: .data, which hold
    different objects in the XML and JSON cases, while they do have some
    common properties.
    
    The new properties introduced in this commit are
    - .message: the error message text
    - .path: pointer to the location of the error in the input
    
    Signed-off-by: Krisztian Fekete <1246751+e3krisztian@users.noreply.github.com>
    e3krisztian committed Jun 25, 2025
    Configuration menu
    Copy the full SHA
    c7351a6 View commit details
    Browse the repository at this point in the history
  2. feat: safe ValidationError message access via .get_squeezed_message()

    ValidationError.data and .message is provided by third party libraries,
    and they can give a message of any length. E.g. jsonschema inserts its
    input in all of its messages, which could be arbitrary big.
    
    To be able to show these errors to the user, some pre-processing is
    needed. The new method allows for squeezing these messages in a way,
    that is least disruptive, and has special knowledge how to shorten
    jsonschema messages.
    
    It is definitely still a workaround, and ideally the libraries should
    not yield unlimited messages.
    
    Signed-off-by: Krisztian Fekete <1246751+e3krisztian@users.noreply.github.com>
    e3krisztian committed Jun 25, 2025
    Configuration menu
    Copy the full SHA
    d9da93d View commit details
    Browse the repository at this point in the history
  3. feat: iterate over validation errors

    There was only one validation method, that returned a single error (and
    it was the first error (JSON) or the last one (XML)).
    
    The new function `SchemabasedValidator.iterate_errors()` allows to
    enumerate over all the validation errors.
    
    Signed-off-by: Krisztian Fekete <1246751+e3krisztian@users.noreply.github.com>
    e3krisztian committed Jun 25, 2025
    Configuration menu
    Copy the full SHA
    9890561 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2025

  1. feat: SchemabasedValidator.validate_str can return an iterator over a…

    …ll errors
    
    Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
    jkowalleck committed Jun 26, 2025
    Configuration menu
    Copy the full SHA
    98bc301 View commit details
    Browse the repository at this point in the history
  2. tests

    Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
    jkowalleck committed Jun 26, 2025
    Configuration menu
    Copy the full SHA
    3002888 View commit details
    Browse the repository at this point in the history
Loading