Skip to content
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

[server] How to handle "reusable" endpoint/topic definitions? #71

Open
jamesmunns opened this issue Dec 29, 2024 · 0 comments
Open

[server] How to handle "reusable" endpoint/topic definitions? #71

jamesmunns opened this issue Dec 29, 2024 · 0 comments

Comments

@jamesmunns
Copy link
Owner

The current endpoints! and topics! macros don't have any way to "include" definitions that are made externally, for example if you have a common subset of functionality.

We might want to add some way to declare "includes", so you can avoid re-defining types. This could look something like:

endpoints!{
    list = ENDPOINTS_LIST;
    // These are defined somewhere else using the `endpoint!` macro, and are
    // added to the table below as if they were defined here.
    import = [
        shared_icd::AdminEndpoint,
        shared_icd::IdentEndpoint,
    ];
    | EndpointTy     | RequestTy     | ResponseTy    | Path              |
    | ----------     | ---------     | ----------    | ----              |
    | Endpoint1      | Req1          | Resp1         | "endpoints/one"   |
    | Endpoint2      | Req2          | Resp2         | "endpoints/two"   |
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant