microsoft / typespec

https://typespec.io/
MIT License
4.07k stars 187 forks source link

POC TypeSpec to AsyncAPI #2463

Open mikekistler opened 11 months ago

mikekistler commented 11 months ago

AsyncAPI is a sister specification to OpenAPI for describing asynchronous (e.g. message queuing) APIs. AsyncAPI is gaining some traction in the industry and by producing an emitter for this we could demonstrate the flexibility and power of TypeSpec in another API domain.

allenjzhang commented 11 months ago

Backlog

SnakeDoc commented 4 months ago

This feature would make TypeSpec a "do-all" tool for those writing OpenAPI and AsyncAPI specs. It's not uncommon to have both within a single system.

Adding my support for this feature! 👍

kennethaasan commented 2 months ago

I agree with the above. At Sportradar we use both OpenAPI and AsyncAPI with JSON Schema and would consider TypeSpec if AsyncAPI was supported.

sandrolain commented 2 months ago

I'm considering using typespec, but at the moment I'm mostly working on event driven architectures. Support for the generation of specifications for asynchronous APIs and event schemas, such as AsyncAPI and cloudevents, would also be fantastic.

bterlson commented 2 months ago

Folks chiming in for AsyncAPI support, please feel free to link your AsyncAPI specs if they are public, it would be great to take a look!

chiodonia commented 2 months ago

@SwissPost we designed hundreds of APIs (both REST and Streaming) using https://github.com/swisspost/apikana. Found TypeSpec very interesting but still missing the support for AsyncAPI

SnakeDoc commented 2 months ago

Folks chiming in for AsyncAPI support, please feel free to link your AsyncAPI specs if they are public, it would be great to take a look!

I don't have a public spec to offer at the moment - however the AsyncAPI team does maintain example specs in their repos for testing, such as this - just note the v3 directory contains AsyncAPI 3.x spec examples.

You may also be interested in these two discussions: #141 and #151, which showcase some 3.x spec examples and expected outputs from the validation/bundling process.

creatorrr commented 1 month ago

any updates on this @bterlson ?

bterlson commented 1 month ago

Nothing new to share, unfortunately. Keep chiming in with support, though!

SnakeDoc commented 1 month ago

I'm chiming in with support! ;)

aeworxet commented 1 week ago

There are official examples in https://github.com/asyncapi/spec/tree/master/examples, and you can view an example for nearly any version of the AsyncAPI Specification:

$ git tag

1.1.0
1.2.0
2.0.0
...
v2.0.0
v2.1.0
...
v2.4.0
v2.4.0-2022-04-release.1
...
v2.5.0-next-spec.5
v2.6.0
v3.0.0
v3.0.0-next-major-spec.1
...

There is also a separate repository, which provides all the JSON Schema documents for validating AsyncAPI documents. https://github.com/asyncapi/spec-json-schemas