Closed dennisoverbeeke closed 8 years ago
Some more information after trial and error...
After deleting the s-models.json I also get the error (without referencing to models anywhere).
If a use an empty s-models.json file I get the error
Could not parse JSON in file: /Users/dennisoverbeeke/Documents/Development/BCOS-Serverless/s-models.json
(sounds logic)
If s-models.json exists and has content (whatever the content is, used your example as well), it gives the error as in the OP. Even if I am not using it at all
Hope this gives extra information
The problem with the missing "Empty" model is, that the function create boilerplate of Serverless creates an reference to "Empty" for each endpoint it creates. As soon as you now use the models plugin, it is missing as it is not defined by default. You have to remove the "Empty" model reference then from the endpoint definition and define it to be just empty for that endpoint:
"repsonseModels": {}
Few things: 1) I feel stupid 2) Of course this works like a charm 3) It is now documented for others 4) Thank you for your quick reply
As stated, works as a charm when deleting the boilerplate code
Thanks for bringing that up :-)
Hyprbrain,
wanted to use your plugin for added model support but when testing I am getting an error: "POST - registrations: Model not defined: Empty" where I have a sls function named 'registration'.
I defined a model 'registrationModel' in s-models.json (in my project root folder) and referenced to it in my s-function.json like this:
sls models list outputs me the model:
and the sls models show registrationModel gives:
sls dash deploy --debug gives:
Would love to use the plugin but it it not working for me... Did I do something wrong? Or is something not working correctly?