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

Pact HTML view does not render pact response bodies with top-level arrays #265

Closed
richard-reece opened this issue Apr 3, 2019 · 2 comments

Comments

@richard-reece
Copy link
Contributor

richard-reece commented Apr 3, 2019

Given a pact with a response body like:

        "body": [
          {
            "description": "product here",
            "section": "product here",
            "productNumber": 0,
            "category": "product here"
          }
        ],

The pact broker will render a HTML version of the pact with an empty array, misleading users about what the pact contains. The API browser displays the correct pact contents.

@bethesque
Copy link
Member

It's because of the min: 0.

It's illegal for that value to be zero. Could you update that in the pactman implementation please?

See https://docs.pact.io/faq#why-is-there-no-support-for-specifying-optional-attributes

The same goes for specifying an array with length 0 or more. If all your provider verification data returned 0 length arrays, all your verification tests would pass without you ever having validated the contents of the array. This is why you can only specify an array with minimum length 1 OR a zero length array.

@richard-reece
Copy link
Contributor Author

pactman already enforces a that min must be greater than 0. I'm trying to figure out how that pact was generated now.

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

No branches or pull requests

2 participants