Skip to content

Commit

Permalink
Merge pull request #1577 from apiaryio/267-method-link
Browse files Browse the repository at this point in the history
Adds "LINK" and "UNLINK" HTTP methods
  • Loading branch information
artem-zakharchenko committed Oct 24, 2019
2 parents 1bf15ed + 4046167 commit 3e617bd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/dredd/lib/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export enum HTTPMethod {
HEAD = 'HEAD',
PUT = 'PUT',
PATCH = 'PATCH',
LINK = 'LINK',
UNLINK = 'UNLINK',
DELETE = 'DELETE',
TRACE = 'TRACE',
TRACE = 'TRACE'
}

export enum BodyEncoding {
Expand Down
2 changes: 2 additions & 0 deletions packages/dredd/lib/sortTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const sortedMethods: HTTPMethod[] = [
HTTPMethod.HEAD,
HTTPMethod.PUT,
HTTPMethod.PATCH,
HTTPMethod.LINK,
HTTPMethod.UNLINK,
HTTPMethod.DELETE,
HTTPMethod.TRACE,
];
Expand Down
2 changes: 1 addition & 1 deletion packages/dredd/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"sorted": {
"alias": "s",
"description": "Sorts requests in a sensible way so that objects are not modified before they are created. Order: CONNECT, OPTIONS, POST, GET, HEAD, PUT, PATCH, DELETE, TRACE.",
"description": "Sorts requests in a sensible way so that objects are not modified before they are created. Order: CONNECT, OPTIONS, POST, GET, HEAD, PUT, PATCH, LINK, UNLINK, DELETE, TRACE.",
"default": false
},
"user": {
Expand Down
6 changes: 6 additions & 0 deletions packages/dredd/test/unit/sortTransactions-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ describe('sortTransactions', () => {
transactions.TRACE,
transactions.OPTIONS,
transactions.HEAD,
transactions.LINK,
transactions.DELETE,
transactions.POST,
transactions.PATCH,
transactions.PUT,
transactions.UNLINK,
transactions.CONNECT,
]);

Expand All @@ -51,6 +53,8 @@ describe('sortTransactions', () => {
transactions.HEAD,
transactions.PUT,
transactions.PATCH,
transactions.LINK,
transactions.UNLINK,
transactions.DELETE,
transactions.TRACE,
]);
Expand Down Expand Up @@ -92,6 +96,8 @@ describe('sortTransactions', () => {
transactions.HEAD,
transactions.PUT,
transactions.PATCH,
transactions.LINK,
transactions.UNLINK,
transactions.DELETE,
transactions.TRACE,
];
Expand Down

0 comments on commit 3e617bd

Please sign in to comment.