nerdexam
MuleSoft

MCD-LEVEL-1 · Question #211

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

The correct answer is C. Option C. 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 with RAML

Question

A shopping API contains a method to look up store details by department To get information for a particular store, web clients will submit requests with a query parameter named department and a URI parameter named storeld. What is a valid RAML snippet that supports requests from web clients to get data for a specific storeld and department name? A) B) C) D)

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D

How the community answered

(42 responses)
  • A
    5% (2)
  • B
    17% (7)
  • C
    71% (30)
  • D
    7% (3)

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 parameter#query parameter#API specification

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice