@@ -13,7 +13,7 @@ import { JsonSchemaEx } from './json-schema-ex';
1313 */
1414export interface IRestApiWithSpec extends apigateway . IRestApi {
1515 /** Root resource ('/') with the features to build the OpenAPI definition. */
16- root : IBaseResourceWithSpec ;
16+ readonly root : IResourceWithSpec ;
1717
1818 /** Adds a new model. */
1919 addModel ( id : string , props : ModelOptionsWithSpec ) : apigateway . Model ;
@@ -25,46 +25,10 @@ export interface IRestApiWithSpec extends apigateway.IRestApi {
2525 *
2626 * @remarks
2727 *
28- * This interface duplicates {@link IResourceWithSpec} but is necessary because
29- * {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html#root | aws_apigateway.RestApi.root}
30- * might not satisfy
31- * {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.Resource.html | aws_apigateway.Resource}.
32- *
33- * It might not be obvious but this interface is a super-interface of
34- * {@link IResourceWithSpec}.
35- *
36- * @beta
37- */
38- export interface IBaseResourceWithSpec extends apigateway . IResource {
39- /** Default method options with the OpenAPI definition. */
40- defaultMethodOptions ?: MethodOptionsWithSpec ;
41-
42- /**
43- * Parent resource.
44- *
45- * @remarks
46- *
47- * `undefined` if this resource represents the root.
48- */
49- parentResource ?: IBaseResourceWithSpec ;
50-
51- /** Adds a new child resource with the OpenAPI definition. */
52- addResource (
53- pathPart : string ,
54- options ?: ResourceOptionsWithSpec ,
55- ) : IResourceWithSpec ;
56-
57- /** Adds a method with the OpenAPI definition. */
58- addMethod (
59- httpMethod : string ,
60- target ?: apigateway . Integration ,
61- options ?: MethodOptionsWithSpec ,
62- ) : apigateway . Method ;
63- }
64-
65- /**
66- * {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.Resource.html | aws_apigateway.Resource }
67- * augmented with the features to build the OpenAPI definition.
28+ * Although this interface actually inherits
29+ * {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.Resource.html | aws_apigateway.Resource},
30+ * you should rely on only properties defined in
31+ * {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IResource.html | aws_apigateway.IResource}.
6832 *
6933 * @beta
7034 */
@@ -79,7 +43,7 @@ export interface IResourceWithSpec extends apigateway.Resource {
7943 *
8044 * `undefined` if this resource is the root.
8145 */
82- parentResource ?: IBaseResourceWithSpec ;
46+ parentResource ?: IResourceWithSpec ;
8347
8448 /** Adds a new child resource with the OpenAPI definition. */
8549 addResource (
@@ -196,6 +160,10 @@ export interface MethodOptionsWithSpec extends apigateway.MethodOptions {
196160 * {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodOptions.html#requestparameters | requestParameters}
197161 * and `requestParameterSchemas` are specified, `requestParameterSchemas`
198162 * precedes.
163+ *
164+ * Please refer to
165+ * {@link https://github.com/metadevpro/openapi3-ts | OpenApi3-TS}
166+ * for more details about `BaseParameterObject`.
199167 */
200168 requestParameterSchemas ?: { [ key : string ] : BaseParameterObject } ;
201169 /**
0 commit comments