swagger : annotation in java code to json spec conversion - rest

I am looking for a tool that reads the java file with swagger annotation and generates that API JSON spec file? Please do let me know if there is already one.

You can use swaggerdocgen Maven plugin to generate Swagger documents in the both JSON and YAML formats. This is assuming that you are able to use Maven for your application.
You can find more information about swaggerdocgen plugin here: https://github.com/WASdev/tool.swagger.docgen
Basically, you need to create a WAR Maven project and add your application files there. Then as part of running mvn package, the Swagger document will be generated in the 'Target' directory of your project.

Related

Is it possible to generate an OpenAPI YAML file from annotated source files via openapi-generator-maven-plugin

Is it possible to generate an OpenAPI YAML file from annotated source files via the openapi-generator-maven-plugin and the generator openapi-yaml?
The Maven plugin as well as CLI tool require an input-spec and only generate from that, not from soruce files. I've searched the (sadly sparse :() documentation and so far found nothing.
Additionally, if this isn't possible (which is likely I guess), is there any other possibility? This project is sadly non-Spring so using springdoc is no alternative.
Thanks!

Missing of some java packages while cresting Maven project on Eclipse

I have created a maven project to implement an example on REST API. To get the values as xml file from a resource which is created by java class, I want to implement an annotation called XmlRootElement which is available in a package javax.xml.bind.annotation. But I was saying like there is no such file called annotation in javax.xml.bind package. Not only this but I don't have some packages to implement such project. Can someone help me?

Bring back the original project from a WSDL file or a WAR file

We have lost our java code that implement a web service. Now we have only a wsdl file (and a WAR file) published in tomcat. We need to bring back the original java project so I have tried to generate java source code from WSDL file (and WAR file) and I succeeded -by using axis2 (WSDL2JAVA) plugin- but I think it generates only the java classes that should exist in the src package of the project.. no welcome pages or index.xml etc.. I Don't know what other things are missing and how to bring them back.
My question is: what to do after generating java classes from WSDL file? should I complete the other project parts in my own? Is there a way to bring back exactly the original project from WSDL or WAR file?
As per the Scenario you mentioned for WAR file you can use JAD tool to unpack the whole code but with certain limitations like you cannot edit or save the code and I am not sure about the copy feature because it was not working for previous version.
Here is the link below.
https://varaneckas.com/jad/

Spring Rest Doc - generate html without maven

I am using Spring Rest Doc and I am generating the HTML file of the documentation using the mvn:install.
Now I have been asked to generate this file without maven cause in our project we are not going to use it.
Is there any way to generate it without the maven install task?
Thank you
There's an Asciidoctor Ant task that can be used to generate HTML from Asciidoctor in an Ant build.

Swagger Generates docs for the classes in jar

New to swagger :
I have a web application which combines multiple modules jars into a single war file. Now I want to be able to generate swagger docs for those modules classes (jars) as well. how do I do it?