Modifies model example and description if needed. Note that schema extra has to be a function, otherwise it's called to soon before all the relations are expanded. :return: callable that will be run by pydantic to modify the schema :rtype: Callable
()
| 187 | |
| 188 | |
| 189 | def construct_schema_function() -> Callable: |
| 190 | """ |
| 191 | Modifies model example and description if needed. |
| 192 | |
| 193 | Note that schema extra has to be a function, otherwise it's called to soon |
| 194 | before all the relations are expanded. |
| 195 | |
| 196 | :return: callable that will be run by pydantic to modify the schema |
| 197 | :rtype: Callable |
| 198 | """ |
| 199 | |
| 200 | def schema_extra(schema: dict[str, Any], model: type["Model"]) -> None: |
| 201 | overwrite_example_and_description(schema=schema, model=model) |
| 202 | overwrite_binary_format(schema=schema, model=model) |
| 203 | |
| 204 | return staticmethod(schema_extra) # type: ignore |
| 205 | |
| 206 | |
| 207 | def modify_schema_example(model: type["Model"]) -> None: # noqa CCR001 |
no outgoing calls
no test coverage detected