Replies: 1 comment
-
Implemented. |
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
-
Status: implemented.
Context
It is possible that the configuration contains more than one service (possibly even in one Smithy file).
The current behavior is that the first service found will be used, but that's not very useful, predictable or convenient for any users with more than one service. Especially given there is no way to dynamically reload the list of dependencies right now.
It should be supported in some way, ideally on a per-file basis, or even on a per-operation basis: given that I want to support chaining operations in a single file, each operation should be able to use a different service.
Proposal
I propose the following semantics:
1. Require service-scoping operations when more than one service is detected.
If many services are detected, every operation must be prefixed with the service name.
e.g. if you have kinesis and dynamodb services, in order to call
ListStreams
you'll have to write:2. Allow setting an implicit service for the entire file
This would be similar to setting the namespace in a Smithy file.
For now you'll only be able to have one implicit service per file. In the future there might be support for multiple such services, provided their operations don't overlap.
Suggested syntax:
This builds up on Smithy's own syntax for imports (
namespace#symbol
), but adds the extraservice
keyword. I considereduse the.namespace#Kinesis.*
, but the operations aren't really scoped under the service so it didn't feel right. Also, I feel like syntax with*
tends to be more difficult to use.Comments inside a
use service
clause will not be allowed.use
andservice
will be soft keywords (possible to use as identifiers).use service
has to be the first non-comment entry in the file.Completions will insert a
use service
clause automatically, unless one already exists - in that case, they would insert a fully-qualified name of the operation.Suggestions welcome!
Beta Was this translation helpful? Give feedback.
All reactions