aws-apigateway-importer icon indicating copy to clipboard operation
aws-apigateway-importer copied to clipboard

Use external model references instead of inlining

Open arabold opened this issue 10 years ago • 5 comments

This pull request addresses issue #43. Instead of inlining all model definitions, we use external references now. This way we are reusing models which reduces the amount of classes and code generated in SDKs.

My main concern about this pull request: This code effectively removes inlining. Is there any case in which inlining would be preferred over external references?

arabold avatar Nov 11 '15 16:11 arabold

Is there any news on this? For us it works, but is there any shortcoming as @arabold mentioned?

HyperBrain avatar Nov 25 '15 08:11 HyperBrain

This solution isn't working for me. The code works perfectly but API Gateway does not like "https://apigateway.amazonaws.com/restapis/APP_ID/models/User" even though there is a 'User' model on "APP_ID". Is this still working for you guys?

KraigM avatar Dec 19 '15 23:12 KraigM

It was still working perfectly fine last week. We're making heavy use of models and external references. When is it giving an error and what's the specific message?

arabold avatar Dec 20 '15 16:12 arabold

Is there anything I can help to have this merged into the main repository?

arabold avatar Jan 18 '16 22:01 arabold

Since API Gateway validates the existence of references in your model schemas, the models must be imported in the correct order from the "leaf" nodes upwards. The import will fail if the importer attempts to create a model before its dependent reference model is imported.

This is most likely why this is failing for @KraigM.

I will merge this if you can update so that the models are guaranteed to be imported in the correct order, and resolve conflicts.

rpgreen avatar Apr 04 '16 17:04 rpgreen