@@ -83,7 +83,9 @@ def included_schemas_list(self) -> List[Type[JSONAPIObjectSchema]]:
8383@dataclass (frozen = True )
8484class BuiltSchemasDTO :
8585 schema_in_post : Type [BaseJSONAPIDataInSchema ]
86+ schema_in_post_data : Type [BaseJSONAPIItemInSchema ]
8687 schema_in_patch : Type [BaseJSONAPIDataInSchema ]
88+ schema_in_patch_data : Type [BaseJSONAPIItemInSchema ]
8789 detail_response_schema : Type [JSONAPIResultDetailSchema ]
8890 list_response_schema : Type [JSONAPIResultListSchema ]
8991
@@ -150,21 +152,23 @@ def create_schemas(
150152 if any (schema_in_patch is cmp_schema for cmp_schema in [schema , schema_in_post ]):
151153 schema_name_in_patch_suffix = "InPatch"
152154
153- schemas_in_post = self .build_schema_in (
155+ schema_in_post , schema_in_post_data = self .build_schema_in (
154156 schema_in = schema_in_post ,
155157 schema_name_suffix = schema_name_in_post_suffix ,
156158 non_optional_relationships = True ,
157159 )
158160
159- schemas_in_patch = self .build_schema_in (
161+ schema_in_patch , schema_in_patch_data = self .build_schema_in (
160162 schema_in = schema_in_patch ,
161163 schema_name_suffix = schema_name_in_patch_suffix ,
162164 id_field_required = True ,
163165 )
164166
165167 return BuiltSchemasDTO (
166- schema_in_post = schemas_in_post ,
167- schema_in_patch = schemas_in_patch ,
168+ schema_in_post = schema_in_post ,
169+ schema_in_post_data = schema_in_post_data ,
170+ schema_in_patch = schema_in_patch ,
171+ schema_in_patch_data = schema_in_patch_data ,
168172 list_response_schema = self ._create_schemas_objects_list (schema ),
169173 detail_response_schema = self ._create_schemas_object_detail (schema ),
170174 )
@@ -175,7 +179,7 @@ def build_schema_in(
175179 schema_name_suffix : str = "" ,
176180 non_optional_relationships : bool = False ,
177181 id_field_required : bool = False ,
178- ) -> Type [BaseJSONAPIDataInSchema ]:
182+ ) -> Tuple [ Type [BaseJSONAPIDataInSchema ], Type [ BaseJSONAPIItemInSchema ] ]:
179183 base_schema_name = schema_in .__name__ .removesuffix ("Schema" ) + schema_name_suffix
180184
181185 dto = self ._get_info_from_schema_for_building (
@@ -202,7 +206,7 @@ def build_schema_in(
202206 __base__ = BaseJSONAPIDataInSchema ,
203207 )
204208
205- return wrapped_object_jsonapi_schema
209+ return wrapped_object_jsonapi_schema , object_jsonapi_schema
206210
207211 def _build_schema (
208212 self ,
0 commit comments