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

Create documentation for Feathers Custom API #224

Open
steventanwc opened this issue Jun 23, 2021 · 1 comment
Open

Create documentation for Feathers Custom API #224

steventanwc opened this issue Jun 23, 2021 · 1 comment
Labels

Comments

@steventanwc
Copy link

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

@Mairu
Copy link
Collaborator

Mairu commented Jun 24, 2021

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

  1. 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
  2. You can completely define the methods spec, if nothing of the defaults should be reused.
  3. 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.

@Mairu Mairu added the question label Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants