File tree 6 files changed +125
-61
lines changed
6 files changed +125
-61
lines changed Original file line number Diff line number Diff line change 60
60
61
61
- name : Upload coverage
62
62
uses : codecov/codecov-action@v1
63
+
64
+ static-checks :
65
+ name : " Static checks"
66
+ runs-on : ubuntu-latest
67
+ steps :
68
+ - name : " Checkout ${{ github.ref }} ( ${{ github.sha }} )"
69
+ uses : actions/checkout@v2
70
+
71
+ - name : " Setup Python"
72
+ uses : actions/setup-python@v2
73
+ with :
74
+ python-version : 3.9
75
+
76
+ - name : Get full Python version
77
+ id : full-python-version
78
+ run : echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
79
+
80
+ - name : Bootstrap poetry
81
+ run : |
82
+ curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y
83
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
84
+
85
+ - name : Configure poetry
86
+ run : poetry config virtualenvs.in-project true
87
+
88
+ - name : Set up cache
89
+ uses : actions/cache@v2
90
+ id : cache
91
+ with :
92
+ path : .venv
93
+ key : venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
94
+
95
+ - name : Ensure cache is healthy
96
+ if : steps.cache.outputs.cache-hit == 'true'
97
+ run : timeout 10s poetry run pip --version || rm -rf .venv
98
+
99
+ - name : Install dependencies
100
+ run : poetry install
101
+
102
+ - name : Run static checks
103
+ run : poetry run pre-commit run -a
Original file line number Diff line number Diff line change 10
10
- id : check-hooks-apply
11
11
12
12
- repo : https://github.com/asottile/pyupgrade
13
- rev : v2.19.0
13
+ rev : v2.38.4
14
14
hooks :
15
15
- id : pyupgrade
16
16
args : ["--py36-plus"]
Original file line number Diff line number Diff line change 2
2
from openapi_schema_validator ._format import oas31_format_checker
3
3
from openapi_schema_validator .shortcuts import validate
4
4
from openapi_schema_validator .validators import OAS30ReadValidator
5
- from openapi_schema_validator .validators import OAS30WriteValidator
6
5
from openapi_schema_validator .validators import OAS30Validator
6
+ from openapi_schema_validator .validators import OAS30WriteValidator
7
7
from openapi_schema_validator .validators import OAS31Validator
8
8
9
9
__author__ = "Artur Maciag"
Original file line number Diff line number Diff line change @@ -187,10 +187,7 @@ def read_required(
187
187
prop_schema = schema .get ("properties" , {}).get (property )
188
188
if prop_schema :
189
189
write_only = prop_schema .get ("writeOnly" , False )
190
- if (
191
- getattr (validator , "read" , True )
192
- and write_only
193
- ):
190
+ if getattr (validator , "read" , True ) and write_only :
194
191
continue
195
192
yield ValidationError (f"{ property !r} is a required property" )
196
193
Original file line number Diff line number Diff line change
1
+ import warnings
1
2
from typing import Any
2
3
from typing import Type
3
- import warnings
4
4
5
5
from jsonschema import _legacy_validators
6
6
from jsonschema import _utils
You can’t perform that action at this time.
0 commit comments