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
Something still missing in all OpenAPI-first implementations I've seen for Python including openapi-core is type-safety w.r.t. the validated request body, URL parameters, and headers. openapi-core validates this data, but there currently is no way to statically type it except for manually implementing the type hints and manually typing the request handlers. This is brittle and doesn't scale well.
@p1c2u Since you've been quite active again recently, I've been wondering about your opinion on this topic. 🙂 I've noticed your 👍 reaction to this vague idea. Would you (and of course also others) be interested in pursuing this idea more concretely, and would you have the capacity to discuss a concrete proposal?
Hi @sisp
definitely interested. Feel free to propose your ideas. I added x-model extension support with possibility to use predefined models. See x-model extension.
It's written mainly from java perspective, and while python class instances are a syntactic sugar over dicts (at least for simple data classes), it still applies to type hints.
Something still missing in all OpenAPI-first implementations I've seen for Python including
openapi-core
is type-safety w.r.t. the validated request body, URL parameters, and headers.openapi-core
validates this data, but there currently is no way to statically type it except for manually implementing the type hints and manually typing the request handlers. This is brittle and doesn't scale well.I suggest to generate code containing type hints and request handler interfaces for the supported web frameworks similar to
oapi-codegen
(Golang) orfastapi-code-generator
(Python).The details need to be discussed and figured out, of course, but I'd appreciate some feedback first. What do you think?
The text was updated successfully, but these errors were encountered: