feathersjs-ecosystem / feathers-swagger

Add documentation to your FeatherJS services and feed them to Swagger UI.
MIT License
226 stars 63 forks source link

Example of Nested paths #230

Open Shpadoinkle opened 2 years ago

Shpadoinkle commented 2 years ago

It would be great to get an example of how to create a nested path.

ie- /users/:userId/posts

with posts having its own post/patch functionality

I have been attempting the example in customMethods but i'm not sure if this achieves what i need it to. I can't get anything to appear in the docs and requests result in a 404.

And if i try to follow the example at https://docs.feathersjs.com/help/faq.html#how-do-i-do-nested-or-custom-routes I receive the error Invalid reference token: :userid if i follow the example

Mairu commented 2 years ago

Hi, I added a nested path example to my test repository.

https://github.com/Mairu/feathersjs-swagger-tests/blob/feathers-v4/src/services/users/posts/posts.service.js

I did not test it too much, but the creation and reading of posts of a user were working.