I want to include swagger-parser in Java, so that I can parse JSON or YAML files to extract the required information. I am using it as a JAVA program/application and not on a server or Springboot. I have googled a lot, but the installations required Maven. Could someone help with how I can install and integrate the swagger-parser with JAVA program please (preferably local installation)? Thank you.
1 Answer
I'm not familiar with swagger-parser, however in cases like these you'll need to download the swagger-parser JAR file and the JAR files of its dependencies (this will be probably into the dozens) and put then into the lib directory of your project.
- Go to the swagger-parser page in Maven Central: https://mvnrepository.com/artifact/io.swagger.parser.v3/swagger-parser
- Click on the version you want (most likely the most current one: 2.0.21).
- At the top where it says Files click on
jarto download the JAR file. - Scroll down to the next table which is labeled Compile Dependencies.
- For each of the entries in there click on the version number.
- Now you will have to recursively repeat starting from step 3 to download each JAR file and in turn their compile dependencies.
As I said this will probably be dozens of files, so this will be a lot of work, so you may want to consider learning about Maven and using it, because it will do all the downloads for you.