Skip to content

Creating aliases outside the context of the original struct #790

@ctron

Description

@ctron

Assuming I have some struct:

pub struct SearchResult<T> {};

Which I use throughout different APIs. that makes it impossible to use the #[alias], as it doesn't know anything about the downstream types. And even does not have access to them.

I tried using an simple pub type SearchResult = common::SearchResult<Foo>, using it as part of the actix function, as well as registering it to the OpenAPI schema. However, this again results in an object referencing T:

      properties:
        result:
          $ref: '#/components/schemas/T'

Metadata

Metadata

Assignees

No one assigned

    Labels

    AliasesWork for global aliasesGenerics - HardStuff concerning generics implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions