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

User can validate objects against individual schema objects #38

Closed
rwalle61 opened this issue Dec 21, 2019 · 1 comment · Fixed by #43
Closed

User can validate objects against individual schema objects #38

rwalle61 opened this issue Dec 21, 2019 · 1 comment · Fixed by #43
Assignees
Labels
enhancement New feature or request

Comments

@rwalle61
Copy link
Collaborator

rwalle61 commented Dec 21, 2019

OpenAPI version
all

Is your feature request related to a problem? Please describe.
Validating the whole response is great in my API tests. But in my unit tests I'd like to be able to validate objects against individual schema objects

Describe the solution you'd like
given an API spec including:

...
components:
  schemas:
    ExampleSchemaObject:
      type: string
...

Be able to do

expect('foo').to.satisfySchemaObject('ExampleSchemaObject') // passes
expect(['foo']).to.satisfySchemaObject('ExampleSchemaObject') // throws useful error 

And to be able to do this with more complex schema objects too

Describe alternatives you've considered
I've not found any other open source packages with this functionality

@rwalle61
Copy link
Collaborator Author

#42 should support this entirely.

Fyi:

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

Successfully merging a pull request may close this issue.

1 participant