Skip to content

Commit

Permalink
Merge pull request #118 from andreaTP/switch-to-stduritemplate
Browse files Browse the repository at this point in the history
Switch to std-uritemplate
  • Loading branch information
samwelkanda authored Sep 12, 2023
2 parents 64bfef7 + 3b2e249 commit 0e843f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
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

0 comments on commit 0e843f0

Please sign in to comment.