Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

allow to add annotations for routes for generated client #1065

Closed
miki725 opened this issue Jul 17, 2023 · 1 comment
Closed

allow to add annotations for routes for generated client #1065

miki725 opened this issue Jul 17, 2023 · 1 comment

Comments

@miki725
Copy link

miki725 commented Jul 17, 2023

it would be useful to add annotations which will persist in the generated client similarly to how route can be annotated for the generated docs (e.g. tags)

export const jsonEndpoints = {
"get /v1/user/retrieve": true,
"post /v1/user/:id": true,
"post /v1/avatar/upload": true,
};

currently generated client only has a single js-exported constant jsonEndpoints which enumerates all endpoints where the value is true. it would be nice to be able to add custom annotations to either the same constant or another exported constant with custom metadata about the endpoint the client can take into account when making requests to the api. perhaps something like:

const helloWorldEndpoint = defaultEndpointsFactory.build({
  ...,
  annotations: {
    foo: "bar"
  }
});
@RobinTail
Copy link
Owner

Hello @miki725 ,

could you please clarify what kind of things could go to such annotations to be useful for the client in order to request the endpoint?

Repository owner locked and limited conversation to collaborators Aug 5, 2023
@RobinTail RobinTail converted this issue into discussion #1079 Aug 5, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants