feathers-swagger
feathers-swagger copied to clipboard
Create documentation for Feathers Custom API
Hi,
Thank you so much for the wonderful module.
I have managed to get mongoose API running.
However, can you advise how can we setup a custom endpoint (meaning one that is not connected to any table or collection)?
Thank you in advance
Steven Tan
Hi Steven,
there is nothing different when creating/using a custom service. To create a custom service you can use the generator or just create a class that does not extend a adapter class, see https://docs.feathersjs.com/api/services.html#service-methods
The documentation for a service can always be customized with the same possibilities. Checkout the documentation for that https://github.com/feathersjs-ecosystem/feathers-swagger#servicedocs
- You can define anything of the spec for any method, here is an example how to make changes to the find method of a service: https://github.com/feathersjs-ecosystem/feathers-swagger/blob/master/example/openapi-v3/customMethods.js#L107
- You can completely define the methods spec, if nothing of the defaults should be reused.
- If only request or response schema have to be defined, you can define that and refer to it in the refs section of the service docs.