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

Server: Swagger documentation does not match REST-API #1314

Closed
timhuebener opened this issue Apr 12, 2021 · 3 comments · Fixed by #1348
Closed

Server: Swagger documentation does not match REST-API #1314

timhuebener opened this issue Apr 12, 2021 · 3 comments · Fixed by #1348

Comments

@timhuebener
Copy link

Describe the bug
A project's swagger documentation page (http://localhost:3000/api/) requires an ID for the GET/ endpoint (e.g. /api/users).

The same goes for sub-entities. For example, /api/users//comments requires an ID for the user and the comment. Thus you can't get all comments of a user.

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://localhost:3000/api/
  2. Click on GET /api/users
  3. See error

Expected behavior
The swagger documentation should not require an ID for GET many requests.

@yuval-hazaz
Copy link
Member

Thanks @timhuebener we are looking into the fix. It seems like an issue with the swagger decorators and the way they handle child properties of the query objects. I will keep you updated

@yuval-hazaz
Copy link
Member

It seems like an issue with nest-swagger
I created a bug report and waiting for a response.
https://github.com/nestjs/nest/issues/6885

@yuval-hazaz
Copy link
Member

I found a way to make it work, I added the details on the issue on nest repo
nestjs/swagger#1299

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

Successfully merging a pull request may close this issue.

2 participants