Skip to content

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

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

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

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions