Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error reporting when JSON response does not match expectations in tests #10128

Open
individual-it opened this issue Sep 23, 2024 · 0 comments
Labels

Comments

@individual-it
Copy link
Member

If the JSON response does not match the expectations in the step And the JSON data of the response should match
we get cryptic reports like this:

Const failed at #->properties:value->items[0]:0->properties:template->properties:message (Swaggest\JsonSchema\Exception\ConstException)
      No valid results for oneOf {
       0: Const failed at #->properties:value->items[2]:2->oneOf[0]->properties:template->properties:variables->properties:resource->properties:name
       1: Const failed at #->properties:value->items[2]:2->oneOf[1]->properties:template->properties:message
       2: "48739722-626b-46f7-997e-38d9f276b023$125b5f26-cb4d-42ed-b3c3-a02509ba546e!125b5f26-cb4d-42ed-b3c3-a02509ba546e" does not match to ^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}![0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$ at #->properties:value->items[2]:2->oneOf[2]->properties:template->properties:variables->properties:space->properties:id
       3: Const failed at #->properties:value->items[2]:2->oneOf[3]->properties:template->properties:message
       4: Const failed at #->properties:value->items[2]:2->oneOf[4]->properties:template->properties:message
      } at #->properties:value->items[2]:2 (Swaggest\JsonSchema\Exception\LogicException)

at the very lease we should report what the response was and maybe give the developers a better hint about what went wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant