Skip to content

Request: Add type parameter to Reference #39

@rafalkrupinski

Description

@rafalkrupinski

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 to Reference (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 function def resolve_ref[T](obj_or_ref: T| Reference[T]) -> T:... and then schema = resolve_ref(schema_or_ref) gives us a concrete type.

I'd be happy to prepare a PR, if such change is welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions