typesafehub / sbt-lagom-bundle

Other
0 stars 5 forks source link

Service endpoints without path parameter #11

Closed markusjura closed 8 years ago

markusjura commented 8 years ago

When collecting and converting the Lagom endpoints to ConductR endpoints we so far extract the the Lagom endpoint path as:

\Q/api/users\E => /api/users
\Q/api/users/\E([^/]+) => /api/users/
\Q/api/users/\E([^/]+)\Q/friends\E => /api/users/\E([^/]+)\Q/friends

The last one /api/users/\E([^/]+)\Q/friends\E will the following error during bundle:dist:

[info] java.net.URISyntaxException: Illegal character in path at index 17: http://:9000/api/users/\E([^/]+)\Q/friends?preservePath

In other words we've got an error for all uri path that contain a path parameter (:id) but do not end with the path parameter.

The regex extractor has been changed to that the extracted path now always ends before the first path parameter. The above example results into:

\Q/api/users\E => /api/users
\Q/api/users/\E([^/]+) => /api/users/
\Q/api/users/\E([^/]+)\Q/friends\E => /api/users/
markusjura commented 8 years ago

The tests have been enhanced to check the above cases.

huntc commented 8 years ago

Lgtm

huntc commented 8 years ago

Superceded by https://github.com/typesafehub/sbt-lagom-bundle/pull/12