Kong / docs.konghq.com

🦍 Source code for docs.konghq.com website.
https://docs.konghq.com
MIT License
199 stars 598 forks source link

Route regular expression is still in the old format #8140

Open imurata opened 3 hours ago

imurata commented 3 hours ago

Where is the problem?

https://docs.konghq.com/hub/kong-inc/oas-validation/#tutorial

What happened?

The path for Route is /. *.

 curl -X POST http://localhost:8001/services/Petstore-Service/routes \
     --data name='Petstore-Route' \
     --data paths='/.*'

But now, in order to write a regular expression, the ~ is required at the beginning. Therefore, it does not work well when we run this plugin according to this tutorial.

What did you expect to happen?

 curl -X POST http://localhost:8001/services/Petstore-Service/routes \
     --data name='Petstore-Route' \
     --data paths='~/.*'

Code of Conduct and Community Expectations

imurata commented 2 hours ago

In addition to the above, since this tutorial specifies strip_path in Route, all paths are removed in the regular expression and passed to the API Endpoint, so a 404 is always returned even if the request is in the correct format.

$ curl -X GET "http://localhost:8000/pet/findByStatus?status=available"   -H "accept: application/json"
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>