You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is when the first character of the pattern is a '#'. When passed into openapi_core.templating.paths.finders.PathFinder, the path_pattern will be set to none instead of "^#[0-9a-zA-Z][0-9a-zA-Z_.]+$". I created a pull request to see the bug. This works in version 0.14, but not 0.15, or 0.16
I have a test copied below that fiales with dealing with URL "fragments", or encoded characters in a URL. However in https://github.com/p1c2u/openapi-core/blob/c24f046957fb1dc822cdb6dac0ca7fa3439723e1/openapi_core/contrib/requests/requests.py#L54
The library itself yields only the path, and not the path AND the resulting fragment from the urlparse result in
https://github.com/p1c2u/openapi-core/blob/c24f046957fb1dc822cdb6dac0ca7fa3439723e1/openapi_core/contrib/requests/requests.py#L32
.yml file
EncodedPathVal:
in: path
name: encoded_path_val
required: true
schema:
type: string
pattern: "^#[0-9a-zA-Z][0-9a-zA-Z_.]+$"
Test case
import urllib.parse
import pytest
TEST_EVENT_ENCODED = {
**TEST_EVENT,
"path": urllib.parse.quote("/encoded/#test_encoded"),
}
The text was updated successfully, but these errors were encountered: