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

Postman Schema tests for response body properties that are arrays with min and max items dont match #494

Open
savage-alex opened this issue Jun 7, 2023 · 1 comment

Comments

@savage-alex
Copy link

Given the following property schema in a response body:

grantTypes:
          description: |
            List of grant types supported for this client.
            As per RFC6749, the clientCredentials grant can only be used by confidential clients.
            Clients SHOULD always only allow Authorization Code with PKCE.
          type: array
          minItems: 1
          maxItems: 2
          uniqueItems: true
          items:
            type: string
            enum:
              - authorizationCodePKCE
              - clientCredentials
            minLength: 0
            maxLength: 100
          example: [authorizationCodePKCE, clientCredentials]

This results in a postman schema test where the min and max items are 1

"grantTypes":{"description":"List of grant types supported for this client.\nAs per RFC6749, the clientCredentials grant can only be used by confidential clients.\nClients SHOULD always only allow Authorization Code with PKCE.\n","type":"array","minItems":1,"maxItems":1,"uniqueItems":true,"items":{"type":"string","enum":["authorizationCodePKCE","clientCredentials"],"minLength":0,"maxLength":100},"example":["authorizationCodePKCE","clientCredentials"]}

We also noted from trying random numbers setting min items to 0 and maxItems to 2
The generated postman schema check dropped maxItems all together.

Happy to provide a full OpenAPI example for testing on request

Thanks

@chyde80
Copy link

chyde80 commented Aug 8, 2023

I am also seeing strange behavior on maxItems. My OAS does not have any maxItems specified in it but portman injected one in one of the schemas for my endpoints. ("maxItems":1)

For now I will probably do a global overwrite (maybe rawReplacement) of it, but would be better if this were fixed.

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