-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: Add type parameter to Reference #39
Comments
Hey @rafalkrupinski! Thanks for reaching out. References can also be pointing at separate documents as well (e.g. |
OK, I think I get what you meant. The value of Regarding ref resolver, above I meant then that users could have such a function in their projects, but perhaps it's a good idea for this project to provide one. I was going to look at referencing library for my project, but I haven't done it yet. |
I've edited my answer @mike-oakley |
Wherever a
Reference
is used in OpenAPI, it's clear to us what the referred object type is supposed to be. Adding a type parameter toReference
(and every field that uses it) would make it clear to tools.If we had
schema_or_ref: Schema | Reference[Schema]
, we could also have a resolver functiondef resolve_ref[T](obj_or_ref: T| Reference[T]) -> T:...
and thenschema = resolve_ref(schema_or_ref)
gives us a concrete type.I'd be happy to prepare a PR, if such change is welcome.
The text was updated successfully, but these errors were encountered: