Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Models (contact and group) - primary key association issue #47

Open
bcsridhar opened this issue Mar 13, 2018 · 2 comments
Open

Comments

@bcsridhar
Copy link

  1. I've installed sails-swagger and swagger-ui.
  2. When I do sails lift I get an error - Trying to create an association on a model that doesn't have a Primary Key.
  3. This error is due to the default models (contact and group) that are part of sails-swagger package under dist/api/models
  4. 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.
  5. Editing the models in the package is not an option, so i do i get around this issue
@Alino
Copy link

Alino commented Mar 21, 2018

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.

@Alino
Copy link

Alino commented Mar 21, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants