nerdexam
MuleSoft

MCD-LEVEL-1 · Question #196

A shopping API contains a method to look up store details by department. To get the information for a particular store, web clients will submit requests with a query parameter named department and…

The correct answer is D. 1. /{storeId}: 2. get: 3. queryParameter: 4. department. Lets revise few concepts RAML which can help us to find the answer of this question. Lets have a look at below example. Here, the braces { } around property names define URI parameters. They represent placeholders in each URI and do not reference root-level RAML file properties…

API Design

Question

A shopping API contains a method to look up store details by department. To get the information for a particular store, web clients will submit requests with a query parameter named department and uri parameter named storeId What is valid RAML snippet that supports requests from a web client to get a data for a specific storeId and department name? A. 1. /department: 2. get: 3. uriParameter: 4. storeId: B. 1. get: 2. uriParameter: 3. {storeId}: 4. queryParameter: 5. department: C. 1. get: 2. queryParameter: 3. department: 4. uriParameter: 5. {storeId}: D. 1. /{storeId}: 2. get: 3. queryParameter: 4. department:

Options

  • A
    1. /department: 2. get: 3. uriParameter: 4. storeId:
  • B
    1. get: 2. uriParameter: 3. {storeId}: 4. queryParameter: 5. department:
  • C
    1. get: 2. queryParameter: 3. department: 4. uriParameter: 5. {storeId}:
  • D
    1. /{storeId}: 2. get: 3. queryParameter: 4. department:

How the community answered

(46 responses)
  • A
    11% (5)
  • B
    2% (1)
  • C
    4% (2)
  • D
    83% (38)

Explanation

Lets revise few concepts RAML which can help us to find the answer of this question. Lets have a look at below example. Here, the braces { } around property names define URI parameters. They represent placeholders in each URI and do not reference root-level RAML file properties as we saw above in the baseUri declaration. The added lines represent the resources /foos/{id} and /foos/name/{name}. Query Parameters Now we'll define a way to query the foos collection using query parameters. Note that query parameters are defined using the same syntax that we used above for data types: description: List all Foos matching query criteria, if provided; otherwise list all Foos queryParameters: ownerName?: string Based on the above information , below is the only option which defines storeid as uri parameter and department as query parameter.

Topics

#RAML#URI parameters#query parameters#resource definition

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice