microsoft / typespec

https://typespec.io/
MIT License
4.08k stars 188 forks source link

Update emitter to set extensions at the root of the document #3837

Closed MaggieKimani1 closed 1 month ago

MaggieKimani1 commented 1 month ago

Clear and concise description of the problem

This feature request proposes adding extensions defined on a Namespace at the root of an OpenApi document.

Typespec sample:

Playground

@service
@route("/createSong")
@extension("x-custom", "foo")
namespace Suno {

}

Result:

openapi: 3.0.0
info:
  title: (title)
  version: 0.0.0
tags: []
paths: {}
components: {}

Expectation:

openapi: 3.0.0
info:
  title: (title)
  version: 0.0.0
tags: []
paths: {}
components: {}
x-custom: foo

Checklist

markcowl commented 1 month ago

est: 3