This is a valid OpenApi schema setup, where a schema is essentially just an alias to a primitive type:
"schemas": {
"MyAlias": {
"type": "string"
},
"MyObject": {
"type": "object",
"properties": {
"myField": {
"$ref": "#/components/schemas/MyAlias"
}
}
}
}
Currently the schema.deference method is unable to dereference MyAlias to the underlying schema type (string). Instead it returns the original object schema.