question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validate query parameters

See original GitHub issue

Is there a way to test validation of query parameters. I have something like this:

    def get(self, id):
        """
        A simple test API
        ---
        tags:
          - test 
        parameters:
          - in: query
            name: id
            type: integer
            required: true
        responses:
          200:
              ....
        """
         #CODE HERE

The Id parameter is required here. How do I validate ID and throw a proper error if it isn’t provided?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mireclcommented, May 3, 2020

Hi, I am create new PR #396 for easy usage Marshmallow and add support validate query args.

1reaction
niczky12commented, Nov 27, 2019

I can see that the PR has been merged, so I’m assuming we can do this now but how? The docs say that only PUT/POST/PATCH requests can be validated. Is that still the case?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query String Validation
Query string values can be checked using regular expressions. You can select regular expressions from the global White list or enter them manually....
Read more >
Query Parameters and String Validations - FastAPI
FastAPI allows you to declare additional information and validation for your parameters. Let's take this application as example: Python 3.6 and above Python ......
Read more >
Validating Query Params in REST API - java - Stack Overflow
The query parameters are valid if and only if at a time only one query parameter is passed and it is among the...
Read more >
Validate Query Parameters and Headers Using APIkit
This process assumes that you have generated flows using APIkit in Studio. You can configure APIkit Router to validate headers and query parameters...
Read more >
Building APIs with Go - Validating Query Parameters Part 1
In this lesson, we learn how to validate the query string parameters provided by our clients.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found