django-ninja
django-ninja copied to clipboard
Missing editor hints when creating new instance
Hello
I would like to ask if it is possible to "turn on" (somehow) the ability to see editor hints when creating new instances of Schemas.
For example, see this code:
import pydantic
import ninja
class PydanticModel(pydantic.BaseModel):
a: int = 0
b: str
class NinjaSchema(ninja.Schema):
a: int = 0
b: str
PydanticModel()
NinjaSchema()
When i write this code in VS Code i can see this for PydanticModel()
(when hover over + red line under it, signaling something is wrong!)
But for NinjaSchema()
i see only this:
My question is: Is there some way to turn on the same behavior for NinjaSchemas like it is for PydanticModel? Namely:
- when hover over - to be able to see which params need to be defined (not just
**data: Any
) - red line under when something is wrong
Thank you very much!
Hi @torx-cz
yeah indeed - I did not notice that before - and it is interesting to find out what's the trick (as Schema is just inherited from the BaseModel... maybe metaclass helps here)