Producing docstrings from raw JSON

38 views
Skip to first unread message

Dylan Gleason

unread,
Apr 14, 2014, 8:24:30 PM4/14/14
to swagger-sw...@googlegroups.com
I am currently using swagger-php to generate JSON source from an API library class written in PHP. I am using this file to view and interact with the API via swagger-ui, which is working out great. However, going forward, I will need to incorporate additional API libraries written in additional languages, which might necessitate a different build process. To avoid having to write annotations in every single language that supports Swagger annotations, my idea is the following:
  • write various library/wrapper classes for API calls in different languages (e.g. PHP, Python, C#, Java, etc.)
  • write the static, raw JSON API source
  • use a build script that will parse JSON and make docstring comments for each library in each language
My question is this: is there a solution that is comparable to this already out there? And if not, my second question is: how would one might go about rolling their own solution? 

To me this sounds like it would require building a rather complex grammar using ANTLR or some other lexer/parser and may be more trouble than it's worth, ultimately.

Any thoughts about how to best approach this would be most welcome :)

Ron

unread,
Apr 15, 2014, 11:52:40 AM4/15/14
to swagger-sw...@googlegroups.com
Wouldn't swagger-codegen solve the issue you're referring to?


--
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.

Dylan Gleason

unread,
Apr 18, 2014, 12:23:36 PM4/18/14
to swagger-sw...@googlegroups.com
Thanks Ron. swagger-codegen is what I was looking for.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages