Skip to content

Body model in typespec.http results in warning due to missing doc decorator #2238

@swathipil

Description

@swathipil

In typespec.http ( typespec>http>lib>http.tsp ), the Body model is current defined as follows:

@doc("")
model Body<T> {
  @body
  body: T;
}

Because the body: T doesn't have a doc decorator, using this Body model results in the following warning when emitting a swagger from the typespec:

azure-rest-api-specs/specification/schemaregistry/SchemaRegistry/node_modules/@typespec/http/lib/http.tsp:31:3 - warning @azure-tools/typespec-azure-core/documentation-required: The ModelProperty named 'body' should have a documentation or description, please use decorator @doc to add it.
> 31 |   @body
     |   ^^^^^
> 32 |   body: T;
     | ^^^^^^^^^^

I believe updating the Body model to something would remove this warning:

@doc("")
model Body<T> {
  @body
  @doc("The body.")
  body: T;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions