Skip to content

Incorrect parsing of a message-property in the sarif analysis result #3197

@julees7

Description

@julees7

For a personal project, I use the created sarif from the analysis to automatically parse an Pojo (https://github.com/Contrast-Security-OSS/java-sarif) so i can work on the java object after that. When i run the spotbugs analysis on the spotbugs source code i get the following exception:

Failed to map supported failure 'org.opentest4j.AssertionFailedError: Unexpected exception thrown: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type java.lang.String from Object value (token JsonToken.START_OBJECT)
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 25579] (through reference chain: com.contrastsecurity.sarif.SarifSchema210["runs"]->java.util.ArrayList[0]->com.contrastsecurity.sarif.Run["invocations"]->java.util.ArrayList[0]->com.contrastsecurity.sarif.Invocation["toolExecutionNotifications"]->java.util.ArrayList[0]->com.contrastsecurity.sarif.Notification["exception"]->com.contrastsecurity.sarif.Exception["message"])' with mapper 'org.gradle.api.internal.tasks.testing.failure.mappers.OpenTestAssertionFailedMapper@38f41468': Cannot invoke "Object.getClass()" because "obj" is null

image_2024-11-14_151822271
-> this is the official sarif documentation on the left and the from spotbugs created sarif on the left

My understanding is that, thats an error from spotbugs which uses the message property instead of a simple string (which is what sarif specifies)

Feel free to ask for a more precise explanation of the problem!
Thanks for any fixes or corrections!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions