Share via

Default tag in query parameter

Shilpa P 0 Reputation points
2023-09-01T12:48:14.6066667+00:00

Hello Team,

Am trying to set a default value in query .

For eg :

"query": {
        "filter": {
          "type": "string",
          "defaultValue": "sss"
        }

But this default is not getting set when we call it through postman using end points value is not getting defaulted to "sss".

Thank you.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Most helpful
  1. Bryan Trach 17,842 Reputation points Microsoft Employee Moderator
    2023-09-04T02:25:06.3833333+00:00

    @Shilpa P It looks like you are trying to set a default value for a query parameter in your API. The syntax you provided is correct, but there are a few things you need to check to make sure that the default value is being set correctly:

    1. Make sure that the query parameter is defined correctly in your API: Check that the query parameter is defined correctly in your API and that it has the same name as the one you are using in your Postman request.

    Check that the default value is set correctly: Make sure that the default value is set correctly in your API. You can verify this by checking the API's code or documentation.

    1. Verify that the query parameter is being passed correctly: Make sure that the query parameter is being passed correctly in your Postman request. You can verify this by checking the request's URL and query parameters.

    Check that the API is returning the correct response: Make sure that the API is returning the correct response. You can verify this by checking the response's body and status code.

    If you have checked all of these things and the default value is still not being set correctly, please provide more information about your API and Postman request. This will help me provide more specific guidance.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.