Skip to content

Commit 7ad7c10

Browse files
committed
Merge branch 'master' into feature/bump_release_version_in_pre-commit_readme_example
2 parents 078b883 + 7c5f03d commit 7ad7c10

File tree

12 files changed

+1273
-1017
lines changed

12 files changed

+1273
-1017
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/build-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313

14-
- name: Set up Python 3.9
14+
- name: Set up Python 3.12
1515
uses: actions/setup-python@v4
1616
with:
17-
python-version: 3.9
17+
python-version: 3.12
1818

1919
- name: Get full Python version
2020
id: full-python-version
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
poetry run python -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs docs/_build/html -n -W
4646
47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
name: Upload docs as artifact
4949
with:
5050
name: docs-html

.github/workflows/python-publish.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@ on:
1212
jobs:
1313
publish:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write
1517
steps:
16-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1719

1820
- name: Set up Python
19-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2022
with:
2123
python-version: '3.x'
2224

2325
- name: Set up poetry
24-
uses: Gr1N/setup-poetry@v8
26+
uses: Gr1N/setup-poetry@v9
2527

2628
- name: Build
2729
run: poetry build
2830

2931
- name: Publish
30-
env:
31-
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
32-
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33-
run: poetry publish
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
with:
34+
packages-dir: dist/

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1818
os: [windows-latest, ubuntu-latest]
1919
fail-fast: false
2020
steps:

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG OPENAPI_SPEC_VALIDATOR_VERSION=0.7.1
1+
ARG OPENAPI_SPEC_VALIDATOR_VERSION=0.7.2
22

3-
FROM python:3.12.6-alpine as builder
3+
FROM python:3.13.4-alpine as builder
44

55
ARG OPENAPI_SPEC_VALIDATOR_VERSION
66

@@ -9,7 +9,7 @@ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
99
RUN apk add --no-cache cargo
1010
RUN python -m pip wheel --wheel-dir /wheels openapi-spec-validator==${OPENAPI_SPEC_VALIDATOR_VERSION}
1111

12-
FROM python:3.12.6-alpine
12+
FROM python:3.13.4-alpine
1313

1414
ARG OPENAPI_SPEC_VALIDATOR_VERSION
1515

openapi_spec_validator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
__author__ = "Artur Maciag"
1616
__email__ = "[email protected]"
17-
__version__ = "0.7.1"
17+
__version__ = "0.7.2"
1818
__url__ = "https://github.com/python-openapi/openapi-spec-validator"
1919
__license__ = "Apache License, Version 2.0"
2020

openapi_spec_validator/readers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
2+
from collections.abc import Hashable
23
from os import path
34
from pathlib import Path
45
from typing import Any
5-
from typing import Hashable
66
from typing import Mapping
77
from typing import Tuple
88

openapi_spec_validator/schemas/utils.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
"""OpenAIP spec validator schemas utils module."""
2-
import sys
2+
from collections.abc import Hashable
3+
from importlib.resources import as_file
4+
from importlib.resources import files
35
from os import path
46
from typing import Any
5-
from typing import Hashable
67
from typing import Mapping
78
from typing import Tuple
89

9-
if sys.version_info >= (3, 9):
10-
from importlib.resources import as_file
11-
from importlib.resources import files
12-
else:
13-
from importlib_resources import as_file
14-
from importlib_resources import files
15-
1610
from jsonschema_path.readers import FilePathReader
1711

1812

openapi_spec_validator/validation/keywords.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@ def __init__(self, registry: "KeywordValidatorRegistry"):
7373
def default_validator(self) -> ValueValidator:
7474
return cast(ValueValidator, self.registry["default"])
7575

76+
def _collect_properties(self, schema: SchemaPath) -> set[str]:
77+
"""Return *all* property names reachable from this schema."""
78+
props: set[str] = set()
79+
80+
if "properties" in schema:
81+
props.update((schema / "properties").keys())
82+
83+
for kw in ("allOf", "anyOf", "oneOf"):
84+
if kw in schema:
85+
for sub in schema / kw:
86+
props.update(self._collect_properties(sub))
87+
88+
if "items" in schema:
89+
props.update(self._collect_properties(schema / "items"))
90+
91+
if "not" in schema:
92+
props.update(self._collect_properties(schema / "not"))
93+
94+
return props
95+
7696
def __call__(
7797
self, schema: SchemaPath, require_properties: bool = True
7898
) -> Iterator[ValidationError]:
@@ -89,15 +109,9 @@ def __call__(
89109
if "allOf" in schema:
90110
all_of = schema / "allOf"
91111
for inner_schema in all_of:
92-
yield from self(
93-
inner_schema,
94-
require_properties=False,
95-
)
96-
if "properties" not in inner_schema:
97-
continue
98-
inner_schema_props = inner_schema / "properties"
99-
inner_schema_props_keys = inner_schema_props.keys()
100-
nested_properties += list(inner_schema_props_keys)
112+
yield from self(inner_schema, require_properties=False)
113+
nested_properties += list(self._collect_properties(inner_schema))
114+
101115

102116
if "anyOf" in schema:
103117
any_of = schema / "anyOf"

openapi_spec_validator/validation/proxies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""OpenAPI spec validator validation proxies module."""
22
import warnings
3+
from collections.abc import Hashable
34
from typing import Any
4-
from typing import Hashable
55
from typing import Iterator
66
from typing import Mapping
77
from typing import Optional

0 commit comments

Comments
 (0)