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

Integrate OpenAPI 3 into Dredd #71

Open
kylef opened this Issue Dec 11, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@kylef
Copy link
Member

kylef commented Dec 11, 2018

This issue is tracking integrating OpenAPI 3 support into Dredd.

Caveats

The current support is not finished but we want to get OpenAPI 3 to you as quick as we can. We're doing this in the open which allows you to follow the progress, give us early feedback and allows you to contribute desired functionality.

There are some caveats with Dredd support in the current release, most should be addressed next week:

  • Parameter default and example values are not yet supported thus setting a value must be done via dredd hooks.
  • Validation of response body is done from an example value in content. Therefore you should include an example to get response body validation.

See below for a working example of current functionality.

Important Missing Functionality

See our status page for furher information on supported functionality.

Examples

Success
openapi: '3.0.0'
info:
  title: HTTPBin
  version: 0.1.0
paths:
  /get:
    get:
      responses:
        '200':
          content:
            application/json:
              example:
                args: {}
                headers:
                  Connection: close
                  Host: httpbin.org
                  User-Agent: Dredd/0.0.0-semantically-released (Darwin 18.2.0; x64)
                origin: '::1'
                url: https://httpbin.org/get
$ dredd httpbin.yaml https://httpbin.org/
info: Beginning Dredd testing...
info: Found Hookfiles:
pass: GET (200) /get duration: 526ms
complete: 1 passing, 0 failing, 0 errors, 0 skipped, 1 total
complete: Tests took 529ms
Failure
openapi: '3.0.0'
info:
  title: HTTPBin
  version: 0.1.0
paths:
  /get:
    get:
      responses:
        '200':
          content:
            application/json:
              example:
                something: that is not found in response
$ dredd httpbin-failure.yaml  https://httpbin.org/
info: Beginning Dredd testing...
info: Found Hookfiles:
fail: GET (200) /get duration: 605ms
info: Displaying failed tests...
fail: GET (200) /get duration: 605ms
fail: body: At '/something' Missing required property: something

request:
method: GET
uri: /get
body:



expected:
headers:
    Content-Type: application/json

body:
{
  "something": "else"
}
statusCode: 200


actual:
statusCode: 200

bodyEncoding: utf-8
body:
{
  "args": {},
  "headers": {
    "Connection": "close",
    "Host": "httpbin.org",
    "User-Agent": "Dredd/0.0.0-semantically-released (Darwin 18.2.0; x64)"
  },
  "origin": "81.109.249.166",
  "url": "https://httpbin.org/get"
}



complete: 0 passing, 1 failing, 0 errors, 0 skipped, 1 total
complete: Tests took 609ms

@kylef kylef transferred this issue from another repository Jan 18, 2019

@kylef kylef added the openapi3 label Jan 18, 2019

@kylef kylef added this to the OpenAPI 3 Parser 1.0.0 milestone Jan 18, 2019

honzajavorek added a commit to apiaryio/dredd that referenced this issue Jan 18, 2019

feat: add experimental OpenAPI 3 support
Please see https://github.com/apiaryio/api-elements.js/blob/master/packages/fury-adapter-oas3-parser/STATUS.md for the list of supported features. The support of OpenAPI 3 in Dredd is experimental, beta, early, you name it. It is everything but finished. However, it already works - see apiaryio/api-elements.js#71 The OAS3 adapter is now developed publicly at https://github.com/apiaryio/api-elements.js/tree/master/packages/fury-adapter-oas3-parser and accepts contributions.

Close #894

@kylef kylef pinned this issue Jan 20, 2019

@kylef kylef added the enhancement label Jan 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment