asyncapi / asyncapi/spec

[2.0.0 REVIEW] Thoughts on a selection expression for models

Open
#238 10 comments 0 reactions 0 assignees View on GitHub
👻 Needs Champion 💭 Strawman (RFC 0) keep-open
Dominant language
JavaScript
Stars
5.3k
Forks
382
Avg merge
7m
Merged PRs (30d)
4

Description

In regards to the [oneOf](https://www.asyncapi.com/docs/specifications/2.0.0-rc1/#a-name-operationobject-a-operation-object) support for a `message` within the `Operation` object:

Having the concept of "multiple message shapes can be received over this channel operation" is very useful - Perfect!

However, what indicates to the recipient which message should be chosen at runtime?

Within AWS API Gateway, we support a concept of a `modelSelectionExpression` on our Routes - I think this roughly aligns with your `Runtime Expression` concept at a high level. Do you think this sort of runtime expression should be added within the `Operation`?

-Jason
AWS API Gateway

Contributor guide

Open the contributing guide

Research direction

Review the AsyncAPI 2.0.0 Operation and message/oneOf definitions, then compare them with AWS API Gateway's modelSelectionExpression and the Runtime Expression concept. A complete contribution would need a settled proposal for where selection belongs and updated specification text and examples, but this issue does not name files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.