Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

Generated handler sets a 501 status code and generated tests check for 200 status code #66

Closed
subeeshcbabu-zz opened this issue Feb 1, 2016 · 1 comment
Milestone

Comments

@subeeshcbabu-zz
Copy link
Member

The default status code set by the generated handler is 501 - Not Implemented.
https://github.com/krakenjs/generator-swaggerize/blob/master/app/templates/_handler_express.js#L14
This status code makes sense because, it is up to the actual API implementor to provide the functionality here.
However the tests generated by the generator checks for 200 status code and this makes the npm test on the generated application to fail by default.
I think it would be useful if we could change the 501 status code to 200 (and Add a comment on complete the implementation details) so that the tests will not fail by default.

@subeeshcbabu-zz subeeshcbabu-zz added this to the v3.0.0 milestone Jun 21, 2016
@subeeshcbabu-zz
Copy link
Member Author

[email protected] generates handlers that uses Mock data generator by default. Mock data generator using swagmock generates responses based on the swagger spec.

Unit tests generates parameters and requests based on the swagger spec using swagmock module, so that the generated unit tests will be able to make sure that the API works end to end.

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

No branches or pull requests

1 participant