API Dash is a beautiful open-source cross-platform API Client built using Flutter which can help you easily create & customize your API requests, visually inspect responses and generate API integration code. A lightweight alternative to postman/insomnia.
[x] I have updated my branch and synced it with project main branch before making this PR
[x] I have run the tests (flutter test) and all tests are passing
Added/updated tests?
[x] Yes, I have added and personally tested all the test cases and the generated code behaves as expected.
Instructions to run the generated code in local computer
Install Apache Maven on your local system. You can alternatively use ./mvnw if you don't want to install maven on your local system or have version incompatibility issues.
Include Unirest as Maven dependency as mentioned in the documentation.
Include the generated code as Main class in your maven project.
Create a MANIFEST file for specifying the Main Class inside the project as mentioned in the Documentation.
You can otherwise use <build> tag inside <project> tag inside your pom.xml file, as following
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/libs
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>libs/</classpathPrefix>
<!-- here we specify that we want to use the main method within the App class -->
<mainClass>{{Fully qualified ClassName where main method is located}}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</build>
Build the project using mvn clean compile package and then execute the jar file.
PR Description
This PR adds automated code generation for Java's Unirest library and also tests the generated code.
Related Issues
Checklist
main
branch before making this PRflutter test
) and all tests are passingAdded/updated tests?
Instructions to run the generated code in local computer
./mvnw
if you don't want to install maven on your local system or have version incompatibility issues.You can otherwise use
<build>
tag inside<project>
tag inside yourpom.xml
file, as followingmvn clean compile package
and then execute the jar file.