Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to std-uritemplate #118

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions kiota_abstractions/request_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from uuid import UUID

from opentelemetry import trace
from uritemplate import URITemplate
from stduritemplate import StdUriTemplate

from ._version import VERSION
from .method import Method
Expand Down Expand Up @@ -74,14 +74,13 @@ def url(self) -> Url:
if not self.url_template:
raise Exception("Url Template cannot be null")

template = URITemplate(self.url_template)
data: Dict[str, Any] = {}
for key, val in self.query_parameters.items():
data[key] = val
for key, val in self.path_parameters.items():
data[key] = val

result = template.expand(data)
result = StdUriTemplate.expand(self.url_template, data)
return result

@url.setter
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
name = "microsoft-kiota-abstractions"
authors = [{name = "Microsoft", email = "[email protected]"}]
dependencies = [
"uritemplate >=4.1.1",
"std-uritemplate >=0.0.38",
"opentelemetry-api >=1.19.0",
"opentelemetry-sdk >=1.19.0",
]
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ wrapt==1.15.0 ; python_version < '3.11'

yapf==0.40.1

uritemplate==4.1.1
std-uritemplate==0.0.38

opentelemetry-api==1.20.0

opentelemetry-sdk==1.20.0
opentelemetry-sdk==1.20.0