Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Add negation syntax for headers #6

Open
decoomanj opened this issue Apr 6, 2016 · 3 comments
Open

Add negation syntax for headers #6

decoomanj opened this issue Apr 6, 2016 · 3 comments
Assignees
Milestone

Comments

@decoomanj
Copy link
Collaborator

Sometimes you want to explicitly test if certain headers are missing.

A possible syntax could be;

headers:
  - !Content-Type
@j-musca j-musca added this to the 1.4 milestone Apr 7, 2016
@j-musca j-musca self-assigned this Apr 7, 2016
@j-musca
Copy link
Collaborator

j-musca commented Apr 7, 2016

@decoomanj The exclamation mark is a reserved keyword in yaml. It would be much easier to introduce a new field "forbiddenHeaders", "illegalHeaders", etc.

@j-musca
Copy link
Collaborator

j-musca commented Apr 7, 2016

Current format

  response:
    headers:
      Content-Type: 'application/json; charset=utf-8'
    status: 201

Option "new field"

  response:
    headers:
      Content-Type: 'application/json; charset=utf-8'
    forbiddenHeaders:
      - X-Custom-Header-0
      - X-Custom-Header-1
    status: 201

Option "using headers field"

  response:
    headers:
      Content-Type: 'application/json; charset=utf-8'
      "!X-Custom-Header-0":
      "!X-Custom-Header-1":
    status: 201

@decoomanj
Copy link
Collaborator Author

It would be cool to improve the testing of headers with regex. It gives the power to test normal, static strings, but does also the negation, patterns, etc. The only problem is the syntax in YML.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants