Generate swagger definition from service implementation

1,299 views
Skip to first unread message

sanjeewa malalgoda

unread,
Jan 16, 2017, 12:56:20 AM1/16/17
to Swagger
Hi All,
I'm working on swagger yaml/json generation for new REST API framework. I have java object which represent complete service definition including all annotations. 
Now i wanted to generate swagger yaml,json from that model. Can anyone point me where i can start with. 
Do we have swagger writer or swagger bean object which we can use to generate yaml file. I looked at swagger codegen project and i need to do opposite of that. 

Thanks,
sanjeewa.

tony tam

unread,
Jan 16, 2017, 10:56:03 PM1/16/17
to swagger-sw...@googlegroups.com
Well, you can use the tools inside swagger-core (https://github.com/swagger-api/swagger-core) to turn a POJO into JSON or YAML, but that tool is typically used to convert an entire API into JSON or YAML.  To get just a single model converted, take a look at the swagger-core module inside the project, there are tests that convert single POJOs into the swagger format.

Tony

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages