api-elements.js icon indicating copy to clipboard operation
api-elements.js copied to clipboard

Integrate OpenAPI 3 into Dredd

Open kylef opened this issue 6 years ago • 3 comments
trafficstars

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:

  • Validation of response body is done from an example value(s) in content. Includes schemas are not used for 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 avatar Dec 11 '18 00:12 kylef

Can I suggest a checklist in the description so we can follow along how far we've got and how long we still have to go?

kurko avatar May 20 '20 14:05 kurko

A checklist would be helpful to understand better the work done, the work remaining, and the status of the OpenAPI3 support.

gap777 avatar Dec 09 '20 16:12 gap777

in what state openapiv3 is today? i arrived here from https://blog.apiary.io/OAS-3 , status page does not work https://github.com/apiaryio/api-elements.js/blob/master/packages/fury-adapter-oas3-parser/STATUS.md?rgh-link-date=2018-12-11T00%3A32%3A00Z

dkocich avatar Mar 15 '24 13:03 dkocich