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

format: uuid not being validated in tests #277

Open
charlottebrady opened this issue Apr 6, 2022 · 1 comment
Open

format: uuid not being validated in tests #277

charlottebrady opened this issue Apr 6, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@charlottebrady
Copy link

Are you using jest or chai?
Jest

Are you using OpenAPI 2, 3.0.X, or 3.1.0?
OpenAPI 3.0.0

Describe the bug clearly
Documentation describing schemas with properties that have
type: string
format: uuid
Are not validating if the returned response is a valid uuid (rather just accepting any string).

Steps to reproduce the bug:

  1. Define schema for an API response to contain a property with type: string and format: uuid
  2. Update the API response so the value of this property is returned as a test string of 'hello'
  3. Set up an API test checking .toSatifsyAPISpec() - this should pass
  4. Set up an API test checking the property value of the API response is a valid uuid - this should fail (as we are getting a response of 'hello')

What did you expect to happen instead?
You would expect tests defined in repro steps 3 and 4 to both fail as a uuid value is not being returned as defined in the schema.
Test in step 4 should not be required as this should be handled through the assertions of test in step 3.

Are you going to resolve the issue?
Hoping for some guidance on if this is a supported feature / plans to make this a supported feature.

Thank you 😊 🙏

@charlottebrady charlottebrady added the bug Something isn't working label Apr 6, 2022
@rwalle61
Copy link
Collaborator

Thanks @charlottebrady! Sounds like a missing feature on our part. Do you have a link to a reproduction?

I don't have much time to implement this now unfortunately but may be able to point you / someone in the right direction, if you like 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants