Swagger-codegen: Thrift Support?

Created on 9 Aug 2016  路  4Comments  路  Source: swagger-api/swagger-codegen

Hi,

this question is probably terribly naive, but can I document my Thrift interfaces with Swagger? If so, what would I have to do to implement this? The underlying scenario is that in my codebase Thrift is used alongside REST for latency-critical, data-intensive components and it would be very handy to have one unified documentation for it. Unfortunately, I have no prior experience with Swagger beyond using it for understanding IBM services.

Thank you very much in advance.

Best wishes,
Joe

Question

Most helpful comment

i have met the same problem, i want document the thrift interface,who can help me?
the file posted as below:
namespace java thrift.service

service Hello {
string helloString(1:string para)
i32 helloInt(1:i32 para)
bool helloBoolean(1:bool para)
void helloVoid()
string helloNull()
}

All 4 comments

I don't know much about Thrift, other then what I've read in the first paragraph of Wikipedia's page. But about Swagger:

  • Swagger Spec (or now OpenAPI Spec) is a specification of a definition language for JSON-based HTTP operations (which make it possible to have REST services).
  • Swagger-Codegen can generate from those definitions code in many languages, either helping to implement a server or a client (and can also generate some other outputs like HTML documentation).
  • Swagger-UI can show documentation based on the specification, also allowing to try the calls to a server.

(There are some more related projects in the Swagger API organization, and also some other implementations by independent vendors.)

I guess you could generate Swagger/OpenAPI definitions from your Thrift definitions, or the other way around, to have the same data models and/or operations for both transports. Then you can generate documentation from the OpenAPI definitions.

i have met the same problem, i want document the thrift interface,who can help me?
the file posted as below:
namespace java thrift.service

service Hello {
string helloString(1:string para)
i32 helloInt(1:i32 para)
bool helloBoolean(1:bool para)
void helloVoid()
string helloNull()
}

@wing328 Why was this issue closed?
I don't think swagger supports thrift already even though v2.2.2 was closed on Mar 1, 2017

@Ajeet-Ganga thanks for tagging me but I'm no longer involved in this project. I hope others will be able to help you out. Good luck.

Was this page helpful?
0 / 5 - 0 ratings