Skip to content

Improve failure output to make debugging /failure fixing in tests simpler #144

@de-jcup

Description

@de-jcup

Origin situation

I accidently defined a wrong type in my test (I used String.class instead of JsonFieldType.STRING) which led to a resources.json containing:

, {
      "attributes" : { },
      "description" : "my text...",
      "ignored" : false,
      "path" : "content[].metaData.xyz",
      "type" : "java.lang.String",
      "optional" : true
    }, {

which leads to gradle failure with:

 Task openapi3 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 'openapi3'.
> unknown field type java.lang.string

That was all output.

Of course this is my fault, but to find the problem wasn't easy - at the beginning I did not recognize that the resource.json output inside build/generated-snippets/myTargetFolder is full used to generate openapi parts and there you can find the location of the problem etc. etc.

Wanted

It would be nice to have

  • the location of the problematic resource.json or
  • the problematic test case, or
  • the path/attributes or
  • anything else that makes it simpler to locate the problematic part
    inside the gradle output in failure case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions