Global, implicit parameters in client #1271
atombender
started this conversation in
General
Replies: 1 comment
-
Ah, looks like an out-of-band API version can be injected via a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to recognize that certain parameters are present on all endpoints and should be set out-of-band?
For example:
/v{version}
tag=foo
At the moment, these must defined something like:
Which generates a signature like this:
with a type:
This is tedious to fill in at every client call site. In particular:
Instead, it would be nice to be able to mark these parameters as either "client-level" or "contextual", so you could have client code like this:
The only way to work around this at the moment, as far as I know, is to pass in empty strings here, and then wrap the client in something that injects the data into every call, which is not very convenient. (The tag could be injected as an
http.Client
wrapper which looks at whether the URL contains atag
and otherwise adds it. But the version is a path parameter, so this wouldn't work there.)Are there other workarounds?
Beta Was this translation helpful? Give feedback.
All reactions