0

From another question:

/**
 * @SWG\Post(
 *   path="/user/login",
 *   @SWG\Response(response=200, description="OK")
 * )
 * @SWG\Path(path="/user/", ref="#/user/login");
 */
function login() {
  ...
}

The above code not working - no definition coming in swagger integrated page. Do I need two definitions for same method for different URLs?

Matt S
  • 14,976
  • 6
  • 57
  • 76
Dipak
  • 21
  • 4

1 Answers1

0

Try changing the reference to

@SWG\Path(path="/user/", ref="#/paths/~1user~1login");

OpenAPI/Swagger path references use the syntax #/paths/path_name, where path_name is the string /user/login with the special character / escaped as ~1. (This answer has more escaping examples.)

Helen
  • 87,344
  • 17
  • 243
  • 314