MCPcopy
hub / github.com/ormar-orm/ormar / modify_schema_example

Function modify_schema_example

ormar/models/helpers/validation.py:207–215  ·  view source on GitHub ↗

Modifies the schema example in openapi schema. :param model: newly constructed Model :type model: Model class

(model: type["Model"])

Source from the content-addressed store, hash-verified

205
206
207def modify_schema_example(model: type["Model"]) -> None: # noqa CCR001
208 """
209 Modifies the schema example in openapi schema.
210
211 :param model: newly constructed Model
212 :type model: Model class
213 """
214 if not config_field_not_set(model=model, field_name="model_fields"):
215 model.model_config["json_schema_extra"] = construct_schema_function()

Callers 1

__new__Method · 0.90

Calls 2

config_field_not_setFunction · 0.90

Tested by

no test coverage detected