Open
Description
Currently if you have a generic model and later substitute it we re-generate the entire schema by walking all of the types. This makes schema generation very expensive.
I propose that instead we wrap types as follows:
generic_model = {
"type": "definitions",
"schema": {
"type": "model",
"fields": {
"foo": {
"type": "definitions-ref",
"ref": "T::some-ref",
}
}
},
"definitions": [
{
"type": "any",
"ref": "T::some-ref",
}
]
}
concrete_model = {
"type": "definitions",
"schema": generic_model,
"definitions": [
{
"type": "int",
"ref": "T::some-ref",
}
]
}
This has the potential to greatly improve generics schema generation performance.