loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

loopback/openapi-v3 multiples paths

Open godartm opened this issue 7 years ago • 2 comments

Hi , How can i add multiples paths to a method.

For example the method foo can be decorated by /foo How can i add /bar on the foo method.

An example of use case :

/user/{id}/orders/{id} ---> I retrieve an order by id /order/{id} ---> i retrieve an order by ID too

should i duplicate the foo method ?

godartm avatar Aug 05 '19 07:08 godartm

@godartm you have to create a new method for each new route. You want to these two routes to your controller:

  • /user/{id}/orders/{id}
  • /order/{id}

Then create their corresponding handler methods.

hacksparrow avatar Aug 05 '19 11:08 hacksparrow

ok , thanks for reply.

godartm avatar Aug 05 '19 11:08 godartm