Is there a way to create a TypedDict from django ninja Schema or vice versa?

71 views Asked by At

For this piece of code

from typing import TypedDict
from ninja import Schema

class MyDict(TypedDict):
  a: str

class MySchema(Schema):
  a: str

is there a way no to repeat the keys (a in the example)?

I tried

class MyDict(TypedDict):
  a: str

class MySchema(Schema, MyDict):
  pass

but it doen't generate the proper ninja schema

0

There are 0 answers