Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-openapi-schema-validator for openSUSE:Factory checked in at 2022-11-10 16:40:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-openapi-schema-validator (Old) and /work/SRC/openSUSE:Factory/.python-openapi-schema-validator.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-openapi-schema-validator" Thu Nov 10 16:40:30 2022 rev:4 rq:1035043 version:0.3.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-openapi-schema-validator/python-openapi-schema-validator.changes 2022-09-05 21:21:47.445099455 +0200 +++ /work/SRC/openSUSE:Factory/.python-openapi-schema-validator.new.1597/python-openapi-schema-validator.changes 2022-11-10 16:40:31.439287390 +0100 @@ -1,0 +2,6 @@ +Wed Nov 9 16:16:04 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to v0.3.4 + * OASValidator 3.0 read write pass with evolve #52 + +------------------------------------------------------------------- Old: ---- 0.3.3.tar.gz New: ---- 0.3.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-openapi-schema-validator.spec ++++++ --- /var/tmp/diff_new_pack.sDSzXi/_old 2022-11-10 16:40:32.051290819 +0100 +++ /var/tmp/diff_new_pack.sDSzXi/_new 2022-11-10 16:40:32.059290864 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-openapi-schema-validator -Version: 0.3.3 +Version: 0.3.4 Release: 0 Summary: OpenAPI schema validator for Python License: BSD-3-Clause ++++++ 0.3.3.tar.gz -> 0.3.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openapi-schema-validator-0.3.3/.bumpversion.cfg new/openapi-schema-validator-0.3.4/.bumpversion.cfg --- old/openapi-schema-validator-0.3.3/.bumpversion.cfg 2022-09-01 14:52:55.000000000 +0200 +++ new/openapi-schema-validator-0.3.4/.bumpversion.cfg 2022-09-12 13:33:14.000000000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.3 +current_version = 0.3.4 tag = True tag_name = {new_version} commit = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openapi-schema-validator-0.3.3/openapi_schema_validator/__init__.py new/openapi-schema-validator-0.3.4/openapi_schema_validator/__init__.py --- old/openapi-schema-validator-0.3.3/openapi_schema_validator/__init__.py 2022-09-01 14:52:55.000000000 +0200 +++ new/openapi-schema-validator-0.3.4/openapi_schema_validator/__init__.py 2022-09-12 13:33:14.000000000 +0200 @@ -6,7 +6,7 @@ __author__ = "Artur Maciag" __email__ = "maciag.ar...@gmail.com" -__version__ = "0.3.3" +__version__ = "0.3.4" __url__ = "https://github.com/p1c2u/openapi-schema-validator" __license__ = "3-clause BSD License" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openapi-schema-validator-0.3.3/openapi_schema_validator/validators.py new/openapi-schema-validator-0.3.4/openapi_schema_validator/validators.py --- old/openapi-schema-validator-0.3.3/openapi_schema_validator/validators.py 2022-09-01 14:52:55.000000000 +0200 +++ new/openapi-schema-validator-0.3.4/openapi_schema_validator/validators.py 2022-09-12 13:33:14.000000000 +0200 @@ -87,13 +87,21 @@ # be part of their public API and will raise error # See https://github.com/p1c2u/openapi-schema-validator/issues/48 original_init = cls.__init__ + original_evolve = cls.evolve def __init__(self: Validator, *args: Any, **kwargs: Any) -> None: self.read = kwargs.pop("read", None) self.write = kwargs.pop("write", None) original_init(self, *args, **kwargs) + def evolve(self: Validator, **changes: Any) -> Validator: + validator = original_evolve(self, **changes) + validator.read = self.read + validator.write = self.write + return validator + cls.__init__ = __init__ + cls.evolve = evolve _patch_validator_with_read_write_context(OAS30Validator) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openapi-schema-validator-0.3.3/pyproject.toml new/openapi-schema-validator-0.3.4/pyproject.toml --- old/openapi-schema-validator-0.3.3/pyproject.toml 2022-09-01 14:52:55.000000000 +0200 +++ new/openapi-schema-validator-0.3.4/pyproject.toml 2022-09-12 13:33:14.000000000 +0200 @@ -31,7 +31,7 @@ [tool.poetry] name = "openapi-schema-validator" -version = "0.3.3" +version = "0.3.4" description = "OpenAPI schema validation for Python" authors = ["Artur Maciag <maciag.ar...@gmail.com>"] license = "BSD-3-Clause" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openapi-schema-validator-0.3.3/tests/integration/test_validators.py new/openapi-schema-validator-0.3.4/tests/integration/test_validators.py --- old/openapi-schema-validator-0.3.3/tests/integration/test_validators.py 2022-09-01 14:52:55.000000000 +0200 +++ new/openapi-schema-validator-0.3.4/tests/integration/test_validators.py 2022-09-12 13:33:14.000000000 +0200 @@ -225,6 +225,42 @@ validator.validate({"another_prop": "bla"}) assert validator.validate({"some_prop": "hello"}) is None + def test_read_only(self): + schema = { + "type": "object", + "properties": {"some_prop": {"type": "string", "readOnly": True}}, + } + + validator = OAS30Validator( + schema, format_checker=oas30_format_checker, write=True + ) + with pytest.raises( + ValidationError, match="Tried to write read-only property with hello" + ): + validator.validate({"some_prop": "hello"}) + validator = OAS30Validator( + schema, format_checker=oas30_format_checker, read=True + ) + assert validator.validate({"some_prop": "hello"}) is None + + def test_write_only(self): + schema = { + "type": "object", + "properties": {"some_prop": {"type": "string", "writeOnly": True}}, + } + + validator = OAS30Validator( + schema, format_checker=oas30_format_checker, read=True + ) + with pytest.raises( + ValidationError, match="Tried to read write-only property with hello" + ): + validator.validate({"some_prop": "hello"}) + validator = OAS30Validator( + schema, format_checker=oas30_format_checker, write=True + ) + assert validator.validate({"some_prop": "hello"}) is None + def test_required_read_only(self): schema = { "type": "object",