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.

[BUG] decoded path parameter not resolved

See original GitHub issue

Describe the bug The encoded parameter in path parameter will not passed to the route action

To Reproduce Steps to reproduce the behavior:

  1. create route with path parameter
@router.get("/test/{value}")
def testRoute( value:str ):
   ....
  1. try to rich this route GET http://127.0.0.1:3000/api/test/AA %2F A%2B

  2. you will get this error

404:
{
  "detail": "Not Found"
}

Expected behavior It should decode the value parameter and pass into value argument

Environment:

  • OS: Linux, Ubuntu, Container
  • FastAPI Version : 0.41.0
  • Python : 3.7.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tiangolocommented, Apr 10, 2020

Thanks for the help here @euri10 ! 👏 🙇

Thanks for reporting back and closing the issue @ivanparvaresh 👍

0reactions
ivanparvareshcommented, Nov 13, 2019

Thanks, :path fixed my problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error validating path parameter for. %2F decoding
I'm using swagger validator against a schema which uses an encrypted and encoded path parameter field (like below). However %2F in request url ......
Read more >
Encoded slash (%2F) with Spring RequestMapping path ...
Given the restful method below, Spring 3.1 gives a 400 error with "The request sent by the client was syntactically incorrect ()." when...
Read more >
URLs with '+' or '%2b' in the path, or query are incorrectly ...
I've found some incorrect behavior during development using Liberty Profile 8.5.5.x. Clients never encode a SPACE character as '+' anywhere in a URL....
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & ...
The value for these path parameters MUST NOT contain any unescaped ... Unless specified otherwise, relative references are resolved using ...
Read more >
Uri
Gets the encoded fragment part of this URI, everything after the '#'. ... Returns. String, the decoded value or null if no parameter...
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