You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bookings(bookings=...).json() generates the desired output {"bookings": [{"project": "...", "date": "...", ' '"amount": {"value": "...", "unit": "..."}}]}, so I think the schema definition is correct.
The output of the current from_pydantic implementation is the following:
Call:
The output is better, but I need the string "bookings" (with an "s"), and couldn't find a way to accomplish this.
How I think it may be solved
Add parameter id to from_pydantic method.
Currently the from_pydantic method allows for the definition of a description, examples and the many flag.
In my opinion the id parameter is missing. Since it is possible to define it in a kor-Object, it should also be possible to provide it to this method. This way it will be possible to set the name of the root object, in my case to "bookings".
The text was updated successfully, but these errors were encountered:
What do I want to achive
I want kor to generate a Typescript description like the following:
What did I try
Define the following pydantic schema:
Bookings(bookings=...).json()
generates the desired output{"bookings": [{"project": "...", "date": "...", ' '"amount": {"value": "...", "unit": "..."}}]}
, so I think the schema definition is correct.The output of the current
from_pydantic
implementation is the following:Call:
Output:
To overcome this, I tried:
Call:
Output:
The output is better, but I need the string "bookings" (with an "s"), and couldn't find a way to accomplish this.
How I think it may be solved
Add parameter
id
tofrom_pydantic
method.Currently the
from_pydantic
method allows for the definition of adescription
,examples
and themany
flag.In my opinion the id parameter is missing. Since it is possible to define it in a kor-Object, it should also be possible to provide it to this method. This way it will be possible to set the name of the root object, in my case to "bookings".
The text was updated successfully, but these errors were encountered: