Skip to content

[Bug]: multiple @example on an object or property should warn when using OpenAPI emitter #4511

Open
@Arithmomaniac

Description

@Arithmomaniac

Describe the bug

In OpenAPI, parameters, requests, and response all support examples. However, objects and properties only support (a single) example.

Trying to use @example twice in such a case should result in a compilation error., or at least a visible warning.

Reproduction

Playground link. Note that when multiple examples are specified, the last is silently chosen.

Checklist

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdesign:neededA design request has been raised that needs a proposalemitter:openapi3Issues for @typespec/openapi3 emittertriaged:core

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions