Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Integrate OpenAPI 3 into Dredd #71

Open
@kylef

Description

@kylef

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions