Adding new model to an existing api gateway #24033
-
I have an API gateway defined in a cdk project and I have exported the RestApi. In a different project, I'm trying to add a few Models to this API gateway but I get an error.
Then I changed my import line to this :
Does anybody know what's wrong? and how can I fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Add a model with the Model constructor. The restApi prop accepts the IRestApi type:
The addModel method isn't exposed on the IRestApi interface type returned by the fromRestApiId method. This is an implementation choice, not an underlying constraint. Under the hood, addModel just calls the Model constructor as we do above. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Add a model with the Model constructor. The restApi prop accepts the IRestApi type:
The addModel method isn't exposed on the IRestApi interface type returned by the fromRestApiId method. This is an implementation choice, not an underlying constraint. Under the hood, addModel just calls the Model constructor as we do above.