Open
Description
Describe the bug
HTTP do not warn, refuse, or have linter rules about recursively using body
or bodyRoot
. It was discussed today with @markcowl and @timotheeguerin that this is not a valid pattern, therefore it's suggested that we refuse it.
This may happen unexpectidely when people are using template. Some template of Azure-core for instance include bodyRoot
, and any usage of body
would fall in this situation, and silently do nothing and be confusing for emitters.
It feels to me that HTTP should be explicit about its behavior, and this is not the case today.
Reproduction
@route("bodyRootWithBody")
op bodyRootWithBody(
@bodyRoot _: {
@body body: bytes;
},
): void;
@route("bodyWithBody")
op bodyWithBody(
@body _: {
@body body: bytes;
},
): void;
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.