csantanapr commented on a change in pull request #3352: API GW doc update to 
include path parameter example
URL: 
https://github.com/apache/incubator-openwhisk/pull/3352#discussion_r170764745
 
 

 ##########
 File path: docs/apigateway.md
 ##########
 @@ -104,52 +103,61 @@ You have a series of actions to implement your backend 
for the book club:
 | putBooks    | PUT | updates book details |
 | deleteBooks | DELETE | deletes a book |
 
-Let's create an API for the book club, named `Book Club`, with `/club` as its 
HTTP URL base path and `books` as its resource.
+Let's create an API for the book club, named `Book Club`, with `/club` as its 
HTTP URL base path and `books` as its resource and `{isbn}` as a path parameter 
used to identify a specific book by its ISBN.
+
+When using path parameters, the API must be defined with a response type of 
`http`, and the path, including the actual path parameter value(s), will be 
available in the `__ow_path` field of the action's JSON parameter.
 ```
-wsk api create -n "Book Club" /club /books get getBooks --response-type http
-wsk api create /club /books post postBooks              --response-type http
-wsk api create /club /books put putBooks                --response-type http
-wsk api create /club /books delete deleteBooks          --response-type http
+wsk api create -n "Book Club" /club /books/{isbn} get getBooks --response-type 
http
+wsk api create /club /books get getBooks                       --response-type 
http
+wsk api create /club /books post postBooks                     --response-type 
http
 
 Review comment:
   Make `post` use path param so you can use later in create new book 
`/books/{isbn} post postBooks`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to