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

API Smoke test - seems no tool available to test response matches the response format as described in OpenAPI spec 3.0 generated by Loopback 4. #4870

Closed
vishalvisd opened this issue Mar 12, 2020 · 8 comments

Comments

@vishalvisd
Copy link

vishalvisd commented Mar 12, 2020

As in documentation and here , dredd is the tool for doing API smoke testing but dredd doesn't support openapi 3.0 and loopback 4 doesnot generates swagger spec. In such a scenario how can we do the testing?

We are doing bottom up approach i.e., APIs have been implemented, Loopback creates the spec json/xml. Now, we want to test the APIs implementation against the spec

@vishalvisd vishalvisd changed the title API Smoke test - seems not tool available with loopback 4 which just generates Openapi 3.0 spec API Smoke test - seems no tool available with loopback 4 which just generates Openapi 3.0 spec Mar 12, 2020
@emonddr
Copy link
Contributor

emonddr commented Mar 13, 2020

@raymondfeng ^

@raymondfeng
Copy link
Contributor

A simple script can fetch the openapi spec, for example:

cd <project-root>
npm start
curl http://localhost:3000/openapi.json (or yaml)

We can possibly add a lb4 generate-openapi-spec command.

@emonddr
Copy link
Contributor

emonddr commented Mar 18, 2020

@emonddr
Copy link
Contributor

emonddr commented Mar 20, 2020

@vishalvisd , have you tried our recommendations?

@vishalvisd vishalvisd changed the title API Smoke test - seems no tool available with loopback 4 which just generates Openapi 3.0 spec API Smoke test - seems no tool available to test response matches the response format as described in OpenAPI spec 3.0 generated by Loopback 4. Mar 21, 2020
@vishalvisd
Copy link
Author

vishalvisd commented Mar 21, 2020

I have edited the question title since the replies gave me a sense that the my query was not clear. It is no big deal to get the spec json, but the question is how can we write a test case that would validate the API response's format is matching the format described in the spec. I had tried Dredd, but it's not working with OAS 3, and Loopback 4 doesn't generate OAS 2(swagger)

@dougal83
Copy link
Contributor

Dredd has experimental support for openapi v3. Why not wait for it to mature or get involved in that project? Also can mocha testing cover the scenarios?

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Dec 25, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants