Skip to content

Releases: openapi-library/OpenAPIValidators

0.9.1 / 28 April 2020

28 Apr 12:42
8b48933
Compare
Choose a tag to compare

Chai OpenAPI Response Validator:

docs:

  • update README and package.json links #71

jest-openapi

docs:

  • update README and package.json links #71

0.9.0 / 28 April 2020

28 Apr 12:30
1a1133f
Compare
Choose a tag to compare

Introducing a new Jest plugin - jest-openapi!

I wanted to make a Jest plugin because there are twice the number of Jest npm downloads (=users?) as chai npm downloads - thus helping more developers verify their servers against their OpenAPI specs.

jest-openapi mirrors chai-openapi-response-validator for Jest. Jest users can use jest-openapi as they would jest-extended. See the README and #69 for more information.

chai-openapi-response-validator remains the same, with major refactoring because this repo has been converted into a monorepo to help maintain the Jest and chai plugins together #69

0.8.0 / 13 April 2020

13 Apr 11:35
8922604
Compare
Choose a tag to compare

Features:

  • Added a TypeScript Declaration File so you can use this plugin in TypeScript projects without import type errors #61. See usage guide

  • Changed some negated assertions to pass instead of fail #67
    expect(res).to.not.satisfyApiSpec used to mean "expect res to match but not satisfy a response defined in your API spec".
    now expect(res).to.not.satisfyApiSpec means "expect res to neither match nor satisfy a response defined in your API spec".
    So if res matches no responses in your API spec, then expect(res).to.not.satisfyApiSpec passes.

  • Much more useful and consistent assertion failure messages #67, see diff:

    • expect(response).to.satisfyApiSpec:
      image

    • expect(object).to.satisfySchemaInApiSpec:
      image

0.7.2 / 6 April 2020

06 Apr 14:34
9ad7636
Compare
Choose a tag to compare

Fixes:

  • Correctly validate null response bodies returned by request-promise #58
  • Correctly validate responses without bodies #59

0.7.1 / 21 Feb 2019

21 Feb 18:23
4afe9d2
Compare
Choose a tag to compare

Fixes:

  • Correctly validate falsy response bodies #49 (AlexDobeck)

0.7.0 / 27 Dec 2019

27 Dec 15:40
f69436f
Compare
Choose a tag to compare

Features:

  • Users can now validate objects against individual schema objects #38, e.g.:

Given an API spec including:

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

Assert in unit tests:

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

For a fuller guide, see docs from master or the original PR

0.6.0 / 22 Dec 2019

22 Dec 16:24
9ca21c5
Compare
Choose a tag to compare

Features:

  • User can define api spec directly as object #39, e.g.
before(async() => {
    const apiSpec = (await axios.get('url/to/openapi/spec')).data;
    chai.use(chaiResponseValidator(apiSpec)); // no need to write apiSpec out to a file
}

0.5.1 / 19 Dec 2019

19 Dec 13:54
5699bfb
Compare
Choose a tag to compare

Fixes:

  • User of superagent-based request packages (e.g. supertest, chai-http) can validate responses with text/html headers #35

0.5.0 / 19 Dec 2019

19 Dec 11:48
2cd52a0
Compare
Choose a tag to compare
  • User can define complex relative and absolute servers #33
  • Contributor can run tests for this project on Windows #32

0.4.0 / 1 Dec 2019

01 Dec 11:15
a27e1a6
Compare
Choose a tag to compare
  • Now support responses defined in your OpenAPI 2 and 3 specs that reference Response Definition Objects (e.g. $ref: '#/components/responses/ExampleResponseDefinitionObject') #26