RAML Snippet for Fetching Store Details by Department – MuleSoft Developer I Exam Preparation

While preparing for the Salesforce MuleSoft Developer I Exam. I am working with a shopping API. I need to define an endpoint that allows web clients to retrieve store details based on a specific department. I encountered a similar Salesforce MuleSoft Developer I Exam question at Pass4Future in MuleSoft Developer I Exam practice tests. I wanted to ensure my RAML definition correctly supports these requests. The request requires:

A URI parameter: stored (to identify the store)

A query parameter: Department (to specify the department)

Could someone provide a valid RAML snippet that defines this endpoint in an API specification? I want to ensure it aligns with best practices for handling StoreId as a URI parameter and department as a query parameter.

why don’t you share an example of what you think is right instead?

2 Likes
title: Shopping API
version: v1
baseUri: **********************
/stores/{storeId}:
  get:
    description: Retrieve store details based on a specific department.
    queryParameters:
      department:
        description: The department to filter store details by.
        type: string
        required: true
    responses:
      200:
        body:
          application/json:
            example:
              {
                "storeId": "123",
                "department": "electronics",
                "storeName": "Tech Haven",
                "location": "Downtown"
              }