apexdevkit 1.16.4__tar.gz → 1.17.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.
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/PKG-INFO +1 -1
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/router.py +1 -1
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/schema.py +11 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/in_memory.py +1 -5
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/pyproject.toml +1 -1
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/LICENSE +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/README.md +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/error.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/name.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/request.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/decorator.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/mongo.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/mssql.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/server.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/synchronization.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/testing/rest.py +0 -0
- {apexdevkit-1.16.4 → apexdevkit-1.17.1}/apexdevkit/value.py +0 -0
|
@@ -147,7 +147,7 @@ class RestfulRouter:
|
|
|
147
147
|
self.resource.read_many(
|
|
148
148
|
Service=dependency.as_dependable(),
|
|
149
149
|
QueryParams=Annotated[
|
|
150
|
-
Schema(self.name).
|
|
150
|
+
Schema(self.name).optional_schema_for("ReadMany", query), Query()
|
|
151
151
|
],
|
|
152
152
|
),
|
|
153
153
|
methods=["GET"],
|
|
@@ -142,3 +142,14 @@ class Schema:
|
|
|
142
142
|
for field_name, field_type in fields.items()
|
|
143
143
|
},
|
|
144
144
|
)
|
|
145
|
+
|
|
146
|
+
def optional_schema_for(
|
|
147
|
+
self, action: str, fields: dict[str, Any]
|
|
148
|
+
) -> type[BaseModel]:
|
|
149
|
+
return create_model(
|
|
150
|
+
self.name.singular.capitalize() + action,
|
|
151
|
+
**{
|
|
152
|
+
field_name: (field_type | None, None)
|
|
153
|
+
for field_name, field_type in fields.items()
|
|
154
|
+
},
|
|
155
|
+
)
|
|
@@ -199,13 +199,9 @@ class _ManyKeyRepository(RepositoryBase[ItemT]):
|
|
|
199
199
|
|
|
200
200
|
def _ensure_does_not_exist(self, new: ItemT) -> None:
|
|
201
201
|
for existing in self:
|
|
202
|
-
error = ExistsError(existing)
|
|
203
|
-
|
|
204
202
|
for key in self.keys:
|
|
205
203
|
if key(new) == key(existing):
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
error.fire()
|
|
204
|
+
ExistsError(existing).with_duplicate(key).fire()
|
|
209
205
|
|
|
210
206
|
def _pk(self, item: ItemT) -> str:
|
|
211
207
|
return self.keys[0](item)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|