Skip to content

Commit 102a55c

Browse files
authored
🔀 merge branch master
2 parents 0b62d40 + 9967f20 commit 102a55c

12,016 files changed

Lines changed: 1625062 additions & 363000 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/setup-python/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
runs:
1515
using: "composite"
1616
steps:
17-
- uses: astral-sh/setup-uv@v6
17+
- uses: astral-sh/setup-uv@v7
1818
with:
1919
python-version: ${{ inputs.python-version }}
2020
cache-suffix: ${{ inputs.env-group }}

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
PYDANTIC_VERSION: ${{ matrix.env }}
3333

3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v6
3636

3737
- name: Setup Python environment
3838
uses: ./.github/actions/setup-python
@@ -56,7 +56,7 @@ jobs:
5656
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5757

5858
- name: Upload coverage report
59-
uses: codecov/codecov-action@v5
59+
uses: codecov/codecov-action@v6
6060
with:
6161
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
6262
files: ./coverage.xml

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
contents: read
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Setup Python environment
1919
uses: ./.github/actions/setup-python
2020

21-
- uses: actions/cache@v4
21+
- uses: actions/cache@v5
2222
with:
2323
key: mkdocs-material-${{ hashfiles('.cache/**') }}
2424
path: .cache
@@ -36,7 +36,7 @@ jobs:
3636
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
3737

3838
- name: Upload to GitHub Pages
39-
uses: actions/upload-pages-artifact@v3
39+
uses: actions/upload-pages-artifact@v5
4040
with:
4141
path: site
4242

@@ -54,4 +54,4 @@ jobs:
5454
steps:
5555
- name: Deploy to GitHub Pages
5656
id: deployment
57-
uses: actions/deploy-pages@v4
57+
uses: actions/deploy-pages@v5

.github/workflows/pyright.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828

2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v6
3131

3232
- name: Setup Python environment
3333
uses: ./.github/actions/setup-python
@@ -42,7 +42,7 @@ jobs:
4242
shell: bash
4343
4444
- name: Run Pyright
45-
uses: jakebailey/pyright-action@v2
45+
uses: jakebailey/pyright-action@v3
4646
with:
4747
pylance-version: latest-release
4848
extra-args: githubkit
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353

5454
steps:
55-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v6
5656

5757
- name: Setup Python environment
5858
uses: ./.github/actions/setup-python
@@ -62,7 +62,7 @@ jobs:
6262
shell: bash
6363
6464
- name: Run Pyright
65-
uses: jakebailey/pyright-action@v2
65+
uses: jakebailey/pyright-action@v3
6666
with:
6767
working-directory: ./codegen
6868
pylance-version: latest-release

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
id-token: write
1414
contents: write
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717

1818
- name: Setup Python
1919
uses: ./.github/actions/setup-python

.github/workflows/ruff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Ruff Lint
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515

1616
- name: Run Ruff Lint
1717
uses: astral-sh/ruff-action@v3

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ci:
77
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.12.7
10+
rev: v0.15.11
1111
hooks:
1212
- id: ruff-check
1313
args: [--fix, --exit-non-zero-on-fix]

codegen/parser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def parse_openapi_spec(source: "Source", override: "Override") -> OpenAPIData:
5656
for path, new_schema in override.schema_overrides.items():
5757
ref = str(httpx.URL(fragment=path))
5858
logger.info(f"Applying schema override for {ref!r}")
59-
merge_inplace(source.resolve_ref(ref).data, new_schema)
59+
merge_inplace(source.resolve_ref(ref), new_schema)
6060

6161
_ot = _override_config.set(override)
6262
_st = _schemas.set({})

codegen/parser/data.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from collections import defaultdict
22
from dataclasses import dataclass, field
3+
from functools import cached_property
4+
import re
35
from typing import Literal
46

57
from .schemas import ModelSchema, Property, SchemaData, UnionSchema
@@ -84,7 +86,7 @@ def get_raw_definition(self) -> str:
8486
required=self.required,
8587
schema_data=self.body_schema,
8688
)
87-
return prop.get_param_defination()
89+
return prop.get_param_definition()
8890

8991
def get_endpoint_definition(self) -> str:
9092
prop = Property(
@@ -93,7 +95,7 @@ def get_endpoint_definition(self) -> str:
9395
required=not bool(self.allowed_models),
9496
schema_data=self.body_schema,
9597
)
96-
return prop.get_param_defination()
98+
return prop.get_param_definition()
9799

98100

99101
@dataclass(kw_only=True)
@@ -139,6 +141,17 @@ def name(self) -> str:
139141
self.method, self.path.replace("{", "").replace("}", "").replace("/", "_")
140142
)
141143

144+
@cached_property
145+
def eval_path(self) -> str:
146+
"""Actual string used to construct the path with param names"""
147+
params_in_path = re.findall(r"\{([^\}]+)\}", self.path)
148+
param_name_map = {param.name: param.prop_name for param in self.path_params}
149+
path = self.path
150+
for param in params_in_path:
151+
if param in param_name_map:
152+
path = path.replace(f"{{{param}}}", f"{{{param_name_map[param]}}}")
153+
return path
154+
142155
@property
143156
def path_params(self) -> list[Parameter]:
144157
return [param for param in self.parameters if param.param_in == "path"]

0 commit comments

Comments
 (0)