reflectapi-runtime 0.22.0__tar.gz → 0.22.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/PKG-INFO +1 -1
  2. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/pyproject.toml +1 -1
  3. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/__init__.py +1 -1
  4. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/partial.py +7 -6
  5. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_partial.py +18 -0
  6. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/.gitignore +0 -0
  7. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/README.md +0 -0
  8. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/auth.py +0 -0
  9. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/batch.py +0 -0
  10. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/client.py +0 -0
  11. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/duration.py +0 -0
  12. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/exceptions.py +0 -0
  13. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/hypothesis_strategies.py +0 -0
  14. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/middleware.py +0 -0
  15. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/py.typed +0 -0
  16. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/response.py +0 -0
  17. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/serde.py +0 -0
  18. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/sse.py +0 -0
  19. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/streaming.py +0 -0
  20. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/testing.py +0 -0
  21. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/transport.py +0 -0
  22. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/src/reflectapi_runtime/types.py +0 -0
  23. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/__init__.py +0 -0
  24. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_auth.py +0 -0
  25. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_auth_negative_cases.py +0 -0
  26. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_batch.py +0 -0
  27. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_client.py +0 -0
  28. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_codegen_regressions.py +0 -0
  29. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_edge_cases.py +0 -0
  30. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_enhanced_features.py +0 -0
  31. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_enum_forward_compatibility.py +0 -0
  32. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_exceptions.py +0 -0
  33. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_middleware.py +0 -0
  34. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_pydantic_serialization.py +0 -0
  35. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_request_field_presence.py +0 -0
  36. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_response.py +0 -0
  37. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_response_header_presence.py +0 -0
  38. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_sse.py +0 -0
  39. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_streaming.py +0 -0
  40. {reflectapi_runtime-0.22.0 → reflectapi_runtime-0.22.1}/tests/test_testing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: reflectapi-runtime
3
- Version: 0.22.0
3
+ Version: 0.22.1
4
4
  Summary: Runtime library for ReflectAPI Python clients
5
5
  Project-URL: Homepage, https://github.com/thepartly/reflectapi
6
6
  Project-URL: Repository, https://github.com/thepartly/reflectapi
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "reflectapi-runtime"
7
- version = "0.22.0"
7
+ version = "0.22.1"
8
8
  description = "Runtime library for ReflectAPI Python clients"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -55,7 +55,7 @@ from .testing import (
55
55
  )
56
56
  from .types import BatchResult, ReflectapiEmpty, ReflectapiInfallible
57
57
 
58
- __version__ = "0.22.0"
58
+ __version__ = "0.22.1"
59
59
 
60
60
  __all__ = [
61
61
  # Authentication
@@ -70,12 +70,13 @@ class ReflectapiPartialModel(BaseModel):
70
70
  # ``m.snapshot = None`` after construction and have it land on the
71
71
  # wire.
72
72
 
73
- # Pydantic 2.10 can resolve an inherited serializer's postponed return
74
- # annotation in the subclass's module, which need not import ``Any``.
75
- @model_serializer(mode="wrap", return_type=dict[str, Any])
76
- def _serialize_partial(
77
- self, handler: Any, info: Any | None = None
78
- ) -> dict[str, Any]:
73
+ # Deliberately no return annotation and no ``return_type``: a declared
74
+ # ``dict[str, Any]`` replaces the model's serialization-mode JSON schema
75
+ # with a bare object, so consumers' OpenAPI specs lose the type. The
76
+ # missing annotation also keeps Pydantic 2.10 from resolving a postponed
77
+ # annotation in a subclass's module, which need not import ``Any``.
78
+ @model_serializer(mode="wrap")
79
+ def _serialize_partial(self, handler: Any, info: Any | None = None):
79
80
  """Drop fields the caller never explicitly set.
80
81
 
81
82
  Pydantic populates ``model_fields_set`` with the *field names*
@@ -251,3 +251,21 @@ def test_partial_subclass_does_not_require_any_in_callers_module(monkeypatch):
251
251
  assert caller.Request(required=None, optional=None).model_dump_json() == (
252
252
  '{"required":null,"optional":null}'
253
253
  )
254
+
255
+
256
+ class TestJsonSchema:
257
+ """The serializer must not hide the model from serialization-mode schemas."""
258
+
259
+ def test_serialization_schema_keeps_model_properties(self):
260
+ schema = PartialItem.model_json_schema(mode="serialization")
261
+ assert set(schema["properties"]) == {"identity", "snapshot"}
262
+ assert schema["required"] == ["identity"]
263
+
264
+ def test_serialization_schema_keeps_nested_partial_refs(self):
265
+ schema = PartialItem.model_json_schema(mode="serialization")
266
+ refs = json.dumps(schema["properties"]["snapshot"])
267
+ assert "PartialSnapshot" in refs
268
+ assert set(schema["$defs"]["PartialSnapshot"]["properties"]) == {
269
+ "name",
270
+ "description",
271
+ }