-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hi there, is there a way to expose the ordering fields as openapi types instead of a string as of currently?
Would help with the integration with a typescript frontend.
What we ended up doing, if it helps anyone:
from typing import Literal, get_args
from ninja import Schema
from ninja_extra.ordering import Ordering, ordering
class MyOrdering(Schema):
id: Literal["id"]
@ordering(Ordering, ordering_fields=[
get_args(annotation)[0]
for annotation in MyOrdering.__annotations__.values()
])
def list_objects(...):
...
silviu-at and csoare7
Metadata
Metadata
Assignees
Labels
No labels