File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* eslint-disable max-classes-per-file */
22import { Construct } from 'constructs' ;
3- import { OpenAPIV3 } from 'openapi-types' ;
43
5- export const { HttpMethods } = OpenAPIV3 ;
4+ export { HttpMethods } from './http-methods.js' ;
65
76// export the version of Constructs we are using to ensure we're
87// everyone is using the same version
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
22import type { OpenAPIV3_1 } from 'openapi-types' ;
3+ import type { HttpMethods } from './http-methods.js' ;
34import type { Parameter } from './parameter.js' ;
45import { RequestBody , type RequestBodyOptions } from './request-body.js' ;
56import type { Response } from './response.js' ;
@@ -24,7 +25,7 @@ export interface OperationOptions<TPath extends string = '/'> {
2425export class Operation < TPath extends string = '/' > extends Construct {
2526 private readonly options : OperationOptions < TPath > ;
2627
27- public readonly method : OpenAPIV3_1 . HttpMethods ;
28+ public readonly method : HttpMethods ;
2829
2930 private requestBody ?: RequestBody ;
3031
@@ -34,7 +35,7 @@ export class Operation<TPath extends string = '/'> extends Construct {
3435
3536 constructor (
3637 scope : Construct ,
37- method : OpenAPIV3_1 . HttpMethods ,
38+ method : HttpMethods ,
3839 options : OperationOptions < TPath > ,
3940 ) {
4041 super ( scope , method ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { strict } from 'node:assert';
22import { Construct } from 'constructs' ;
33import type { OpenAPIV3_1 } from 'openapi-types' ;
44import type { Api } from './api.js' ;
5+ import { HttpMethods } from './http-methods.js' ;
56import { Operation , type OperationOptions } from './operation.js' ;
67import type { Parameter } from './parameter.js' ;
78import type { Server } from './server.js' ;
@@ -25,7 +26,7 @@ export class Path<TPath extends string = '/'> extends Construct {
2526 }
2627
2728 public addOperation (
28- method : OpenAPIV3_1 . HttpMethods ,
29+ method : HttpMethods ,
2930 options : OperationOptions < TPath > ,
3031 ) : this {
3132 // make sure we are not duplicating tags
@@ -43,7 +44,7 @@ export class Path<TPath extends string = '/'> extends Construct {
4344 return this . options . path ;
4445 }
4546
46- public synth ( ) : OpenAPIV3_1 . PathItemObject {
47+ public synth ( ) {
4748 return {
4849 ...Object . fromEntries (
4950 this . node
You can’t perform that action at this time.
0 commit comments