File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Construct , type IConstruct } from 'constructs' ;
21import type { JSONSchema7 } from 'json-schema' ;
3- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
43import { ApiLowLevel } from './ApiLowLevel.js' ;
54import { Parameter } from './parameter.js' ;
65import { Path } from './path.js' ;
@@ -17,7 +16,7 @@ export enum OpenApiVersion {
1716
1817export interface ApiOptions {
1918 openapi : OpenApiVersion ; // | `${OpenApiVersion}`;
20- info : OpenAPIV3_1 . InfoObject ;
19+ info : oas31 . InfoObject ;
2120}
2221
2322export class Api extends ApiLowLevel {
@@ -68,7 +67,7 @@ export class Api extends ApiLowLevel {
6867 child instanceof SecurityRequirement ,
6968 )
7069 . map ( ( child ) => child . synth ( ) ) ,
71- } satisfies OpenAPIV3_1 . Document ;
70+ } satisfies oas31 . OpenAPIObject ;
7271 }
7372
7473 public synthJsonSchema ( ) {
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import { Reference } from './reference.js' ;
44import type { Schema } from './schema.js' ;
55
@@ -24,7 +24,7 @@ export class MediaType extends Construct {
2424 this . options = options ;
2525 }
2626
27- public synth ( ) : OpenAPIV3_1 . MediaTypeObject {
27+ public synth ( ) : oas31 . MediaTypeObject {
2828 return {
2929 schema :
3030 this . options . schema instanceof Reference
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import type { HttpMethods } from './http-methods.js' ;
44import type { Parameter } from './parameter.js' ;
55import { RequestBody , type RequestBodyOptions } from './request-body.js' ;
@@ -92,6 +92,6 @@ export class Operation<TPath extends string = '/'> extends Construct {
9292 ] ) ,
9393 ) ,
9494 } ) ,
95- } satisfies OpenAPIV3_1 . OperationObject ;
95+ } satisfies oas31 . OperationObject ;
9696 }
9797}
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import type { Api } from './api.js' ;
44import type { Schema } from './schema.js' ;
55
@@ -34,7 +34,7 @@ export class Parameter<
3434 this . options = options ;
3535 }
3636
37- public referenceObject ( ) : OpenAPIV3_1 . ReferenceObject {
37+ public referenceObject ( ) : oas31 . ReferenceObject {
3838 return {
3939 $ref : this . jsonPointer ( ) ,
4040 } ;
@@ -66,6 +66,6 @@ export class Parameter<
6666 ...( this . options . schema && {
6767 schema : this . options . schema . referenceObject ( ) ,
6868 } ) ,
69- } satisfies OpenAPIV3_1 . ParameterObject | OpenAPIV3_1 . ReferenceObject ;
69+ } satisfies oas31 . ParameterObject | oas31 . ReferenceObject ;
7070 }
7171}
Original file line number Diff line number Diff line change 11import { strict } from 'node:assert' ;
22import { Construct } from 'constructs' ;
3- import type { OpenAPIV3_1 } from 'openapi-types ' ;
3+ import type { oas31 } from 'openapi3-ts ' ;
44import type { Api } from './api.js' ;
55import { HttpMethods } from './http-methods.js' ;
66import { Operation , type OperationOptions } from './operation.js' ;
@@ -63,6 +63,6 @@ export class Path<TPath extends string = '/'> extends Construct {
6363 ) ,
6464 } ) ,
6565 ...( this . options . summary && { summary : this . options . summary } ) ,
66- } satisfies OpenAPIV3_1 . PathItemObject ;
66+ } satisfies oas31 . PathItemObject ;
6767 }
6868}
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import { ApiLowLevel } from './ApiLowLevel.js' ;
44import { Schema } from './schema.js' ;
55
@@ -22,7 +22,7 @@ export class Reference<T extends Target> extends Construct {
2222 return this . schema . schemaKey ;
2323 }
2424
25- public synth ( ) : OpenAPIV3_1 . ReferenceObject {
25+ public synth ( ) : oas31 . ReferenceObject {
2626 return this . schema . referenceObject ( ) ;
2727 }
2828}
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import { MediaType , type MediaTypeOptions } from './media-type.js' ;
44
55export interface RequestBodyOptions {
@@ -23,7 +23,7 @@ export class RequestBody extends Construct {
2323 : new MediaType ( this , id , options . content ) ;
2424 }
2525
26- public synth ( ) : OpenAPIV3_1 . RequestBodyObject {
26+ public synth ( ) : oas31 . RequestBodyObject {
2727 return {
2828 description : this . options . description || '' ,
2929 content : {
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import type { Header } from './header.js' ;
44import { MediaType , type MediaTypeOptions } from './media-type.js' ;
55
@@ -34,6 +34,6 @@ export class Response extends Construct {
3434 [ this . content . contentType ] : this . content . synth ( ) ,
3535 } ) ,
3636 } ,
37- } satisfies OpenAPIV3_1 . ResponseObject ;
37+ } satisfies oas31 . ResponseObject ;
3838 }
3939}
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33
4- interface SchemaOptions < T extends OpenAPIV3_1 . SchemaObject > {
4+ interface SchemaOptions < T extends oas31 . SchemaObject > {
55 schema : T ;
66}
77
88export class Schema <
9- T extends OpenAPIV3_1 . SchemaObject = OpenAPIV3_1 . SchemaObject ,
9+ T extends oas31 . SchemaObject = oas31 . SchemaObject ,
1010> extends Construct {
1111 private options : SchemaOptions < T > ;
1212
@@ -28,10 +28,10 @@ export class Schema<
2828 return `#/components/schemas/${ this . schemaKey } ` ;
2929 }
3030
31- public referenceObject ( ) {
31+ public referenceObject ( ) : oas31 . ReferenceObject {
3232 return {
3333 $ref : this . jsonPointer ( ) ,
34- } satisfies OpenAPIV3_1 . ReferenceObject ;
34+ } ;
3535 }
3636
3737 // eslint-disable-next-line class-methods-use-this
Original file line number Diff line number Diff line change 11import { Construct } from 'constructs' ;
2- import type { OpenAPIV3_1 } from 'openapi-types ' ;
2+ import type { oas31 } from 'openapi3-ts ' ;
33import type { Api } from './api.js' ;
44import type { SecurityScheme } from './security-scheme.js' ;
55
@@ -20,7 +20,7 @@ export class SecurityRequirement extends Construct {
2020 this . options = options ;
2121 }
2222
23- public synth ( ) : OpenAPIV3_1 . SecurityRequirementObject {
23+ public synth ( ) : oas31 . SecurityRequirementObject {
2424 return this . options . securityScheme
2525 ? {
2626 [ this . options . securityScheme . node . id ] : this . options . scopes || [ ] ,
You can’t perform that action at this time.
0 commit comments