[BUG] decoded path parameter not resolved
See original GitHub issueDescribe the bug
The encoded parameter in path parameter
will not passed to the route action
To Reproduce Steps to reproduce the behavior:
- create route with
path
parameter
@router.get("/test/{value}")
def testRoute( value:str ):
....
-
try to rich this route GET http://127.0.0.1:3000/api/test/AA %2F A%2B
-
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:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the help here @euri10 ! 👏 🙇
Thanks for reporting back and closing the issue @ivanparvaresh 👍
Thanks,
:path
fixed my problem