Query parameters in raml


Hi, I am new to this RAML. i am trying to create raml using query parameters. when i am hitting the url with the query parameter value which is provided in the body of the example, i am getting the response. when i am trying to hit the url with the value which is not provided in the body, then also i am getting same response instead of error. please help me in this.

#%RAML 1.0
title: firstApi
version: 1.0
baseUri: https://mocksvc.mulesoft.com/mocks/555a499c-89d1-4469-9030-da7410048946/employee # baseUri: http://firstapi.com/employee
  description: describes the employee details
        description: place of the employee
        type: string
        required: true
            example: |
              "id": 601,
            example: |
                "message":"Employee id is not recognized"


I would first say you probably need a 400 response type added… to handle the case of a Bad Request, which in the case of you requiring a query parameter and it not being part of the URL, would be the proper error response. I am however not sure if the mock service will “ignore” required fields IF you do not provide the correct response in the definition. Try adding a 400 and see if that solves it. If not, then maybe there is a setting in the mock service to ignore required properties that needs to be changed.


so you’re hitting /employee without ?place and it still returns 200? if so, then yes that’s probably a bug with whatever tools you are using.