11import { Construct , type IConstruct } from 'constructs' ;
2- import type { JSONSchema4 , JSONSchema7 } from 'json-schema' ;
2+ import type { JSONSchema7 } from 'json-schema' ;
33import type { OpenAPIV3_1 } from 'openapi-types' ;
44import { Parameter } from './parameter.js' ;
55import { Path } from './path.js' ;
@@ -9,7 +9,7 @@ import { SecurityRequirement } from './security-requirement.js';
99import { SecurityScheme } from './security-scheme.js' ;
1010
1111export enum OpenApiVersion {
12- V2 = '2.0' ,
12+ // V2 = '2.0',
1313 V3 = '3.0' ,
1414 V3_1 = '3.1.0' ,
1515}
@@ -40,7 +40,7 @@ export class Api extends Construct {
4040 return Api . of ( scope ) ;
4141 }
4242
43- public synth ( ) : OpenAPIV3_1 . Document {
43+ public synth ( ) {
4444 return {
4545 openapi : this . options . openapi ,
4646 info : this . options . info ,
@@ -78,17 +78,17 @@ export class Api extends Construct {
7878 child instanceof SecurityRequirement ,
7979 )
8080 . map ( ( child ) => child . synth ( ) ) ,
81- } ;
81+ } satisfies OpenAPIV3_1 . Document ;
8282 }
8383
84- public synthJsonSchema ( ) : JSONSchema4 | JSONSchema7 {
84+ public synthJsonSchema ( ) {
8585 return {
8686 $schema : 'http://json-schema.org/draft-07/schema#' ,
8787 definitions : Object . fromEntries (
8888 this . node . children
8989 . filter ( ( child ) : child is Schema => child instanceof Schema )
9090 . map ( ( child ) => [ child . schemaKey , child . synth ( ) ] ) ,
9191 ) ,
92- } ;
92+ } satisfies JSONSchema7 ;
9393 }
9494}
0 commit comments