Skip to content

Additional ApiResource Type for Lists #57

Closed

Description

@samuelru

I really appreciate your library as it provides an easy way to define an API with Swagger definition for paged return types (Hydra) and individual entries. Nevertheless, it would be very helpful to have also a simple list as return type. It is already possible to achieve this by simply returning an array in the OperationHandler, but it is not possible to define the corresponding ApiResource to get the correct Swagger definition (without paging attributes and the correct return type). For example, such an ApiResource could be called "listOperations".

My question now is, would it be in your interest to add this function to your library? If it is possible I would be willing to help as well.

Activity

  1. klamparski commented on Nov 2, 2021

    @klamparski
    Collaborator

    Hi @samuelru,

    Thanks for the feedback. I already though a little about OpenAPI specification for non standard operations (these with custom OperationHandler) but it becomes pretty complex thing. It is definitely not on our roadmap and I guess won't be there in nearest future.

    Of course it would be great if you could help with that but I'm not sure if I understand your idea with "listOperations". IMO it's not only about the list but all custom responses from operation handlers. For me most important is to decide where definition of the documentation will be kept (on endpoints definition in entity, on operation handler class or completely separate place or maybe other idea). We would need to think about pros and cons of each of these places before we proceed with this issue.

    To make it easier to learn t3api in a lot of places we are trying to follow configuration definition from ApiPlatform. I think we should do the same also regarding OpenAPI so ApiPlatform's documentation about cusomization is probably best point to start from.

  2. kszymukowicz commented on Nov 4, 2021

    @kszymukowicz
    Collaborator

    @samuelru I am moving this issue to Discussions, to Ideas section.

  3. locked and limited conversation to collaborators on Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions