Skip to content

Commit

Permalink
fix: Add support for PATCH method, remove CONNECT.
Browse files Browse the repository at this point in the history
Add support for the PATCH method.  OpenApi 3.x doesn't support CONNECT, so it has been removed.

33
  • Loading branch information
jwalton committed Jul 30, 2018
1 parent 11d5bb0 commit e35aed3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/oas3/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { EXEGESIS_CONTROLLER, EXEGESIS_OPERATION_ID } from './extensions';
import Responses from './Responses';
import SecuritySchemes from './SecuritySchemes';

const METHODS_WITH_BODY = ['post', 'put'];
const METHODS_WITH_BODY = ['post', 'put', 'patch'];

function isAuthenticationFailure(result : any) : result is AuthenticationFailure {
return !!(result.type === 'invalid' || result.type === 'missing');
Expand Down
3 changes: 2 additions & 1 deletion src/oas3/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as oas3 from 'openapi3-ts';
import Parameter from './Parameter';
import { EXEGESIS_CONTROLLER } from './extensions';

const HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE'];
// CONNECT not included, as it is not valid for OpenAPI 3.0.1.
const HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'PATCH'];

interface OperationsMap {
[key: string]: Operation;
Expand Down

0 comments on commit e35aed3

Please sign in to comment.