sails-swagger
sails-swagger copied to clipboard
Default Models (contact and group) - primary key association issue
- I've installed sails-swagger and swagger-ui.
- When I do sails lift I get an error - Trying to create an association on a model that doesn't have a Primary Key.
- This error is due to the default models (contact and group) that are part of sails-swagger package under dist/api/models
- These 2 models do not have a primary key specified and hence the above error. If I edit the above models and include a primary key it works with out any issue and i am able to view the documentation.
- Editing the models in the package is not an option, so i do i get around this issue
the reason for the 2 included models (contact and group) to exist, is just for testing purpose. You don't need them.
I have forked this project, and made a few updates to it and released an npm package. https://github.com/Alino/sails-swagger https://www.npmjs.com/package/sails-swagger-alino
My fork is using the two test models only while you run the tests with npm test
otherwise they will not be compiled in the dist folder.
You should not install and use sails-swagger from the npm because it's outdated and not maintained. Rather use your own forked sails-swagger project, or use someones else, with the updates matching your project needs.