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 :)