Alternative API Specifications - RAML, AsyncAPI, XSD, and more #3995
Replies: 2 comments
-
Hi @ewinnington This is something we've talked about internally and intentionally left out from design documentation/public issues as we wanted to see whether there was any kind of customer demand for it. On different description formatsIf you look at Kiota's internals, you'll notice it goes through the following process to generate code flowchart LR
oai[OpenAPI Document] --> oainet[OpenAPI.NET representation]
oainet --> CodeDOM
CodeDOM --> refined[Language refined DOM]
refined --> writers[Code Element Writers]
writers --> code[Generated Code]
Assuming we do some heavy refactoring, we should be able to swap the first two steps to support another description format. On supporting different transport layersRight now the abstractions layers are designed with some assumptions about an HTTP/REST transport. It might work without changes for websockets and MQTT, but we might run into major design issues. Overall mid-term (6 months horizon) plans at this timeAt this time we're still focusing on OpenAPI, adding support for 3.1 is one of our major investments in the area, completing languages support for the languages we started is another. Additional elementsOne reason that often gets cited for GRPc/GraphQL/MQTT over HTTP/REST is the performance aspect. (besides architecture differences or developer experience preferences). I hope this lengthy reply answers more of your questions, don't hesitate to follow up. |
Beta Was this translation helpful? Give feedback.
-
Oh great Overlord ;), thank you so much for that in depth and thoughtful answer. Thank you also for the pointer to CBOR, I was not aware of it. Might be one to investigate for some of my internal use cases. For RAML, I’m sure a conversion of api spec to OpenApi is quick, possible and probably good enough. Mulesoft Anypoint provides that conversion functionality in the box - might even be available as a library. AsyncApi on the other hand really targets a much wider spectrum and would probably involve support for more protocols - requiring a deeper investment to support. I’m very happy to hear that you have internally thought about it. It’s true that the market is dominated by openapi specs and thus you can provide the most value for effort by targeting it. Just the websockets definition is missing from the official spec of OpenAPI and not currently in scope for official support last I read. One vendor’s API I consume has simply used the HTTP OPTIONS verb to document the websockets messages since the verb is so seldom used. |
Beta Was this translation helpful? Give feedback.
-
Beyond the OpenAPI OAS Specification, there exists other competing specifications with their own advantages and representations.
AsyncAPI
This is for example used to document Websocket messages.
RAML
RAML is used in Mulesoft's Anypoint API Gateway, among others.
Is there a view of extending Kiota to generate clients using other specifications?
Another example of specifications would be XML XSD specifications for RabbitMQ message serializations - which is common in some trading platforms and messaging. Here I use tools to generate classes for the XML deserialization.
I understand that it is a slippery slope, because if you start adding more supports, then the question comes should it do a GRPC specification to client? This is provided by grpc tools currently - but maybe kiota could integrate with such other existing tool pipelines?
This is not a request, but I would be curious to know about what is the idea of the kiota project on this topic.
Beta Was this translation helpful? Give feedback.
All reactions