From cbd870c0a2695587fdf22f13625a5bf5c5306f1b Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Tue, 16 Apr 2024 08:47:41 +0530 Subject: [PATCH 1/2] Fix the explanation on dot resource path --- .../http_service_and_resource_paths.bal | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal b/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal index ebfe40a71f..dac466d6be 100644 --- a/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal +++ b/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal @@ -15,8 +15,12 @@ table key(title) albums = table [ // It can be represented by both identifiers and string literals. E.g., `/music\-info`, `"/music-info"`. service /info on new http:Listener(9090) { - // The `resource path` is `albums` and the `resource accessor` is `get`. - // The `.` represents the current resource that is `/info`. + // The `resource path` represents the relative path to the resource and the `resource accessor` + // represents the HTTP method that is used to access the resource. + // Here, the resource path is `/albums` and the resource accessor is `get` which means that the + // resource is invoked when an HTTP GET request is made to `/info/albums`. + // The `resource path` can be set as `.` to represent a resource with the `service path` + // that is `/info`. resource function get albums() returns Album[] { return albums.toArray(); } From 67eb38c85d4024595677740ca711751c15496746 Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Wed, 15 May 2024 10:49:37 +0530 Subject: [PATCH 2/2] Apply suggestions from code review --- .../http_service_and_resource_paths.bal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal b/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal index dac466d6be..01966a9c31 100644 --- a/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal +++ b/examples/http-service-and-resource-paths/http_service_and_resource_paths.bal @@ -15,10 +15,10 @@ table key(title) albums = table [ // It can be represented by both identifiers and string literals. E.g., `/music\-info`, `"/music-info"`. service /info on new http:Listener(9090) { - // The `resource path` represents the relative path to the resource and the `resource accessor` - // represents the HTTP method that is used to access the resource. - // Here, the resource path is `/albums` and the resource accessor is `get` which means that the - // resource is invoked when an HTTP GET request is made to `/info/albums`. + // The `resource path` represents the relative path to the resource, and the `resource accessor` + // represents the HTTP method used to access the resource. + // Here, the resource path is `/albums`, and the resource accessor is `get`. + // This means the resource is invoked when an HTTP GET request is made to `/info/albums`. // The `resource path` can be set as `.` to represent a resource with the `service path` // that is `/info`. resource function get albums() returns Album[] {