Skip to content

Commit

Permalink
Merge pull request #14 from dhis2/support-multiple-api-versions
Browse files Browse the repository at this point in the history
Add dhis2-json-schema-generator as a Git submodule
  • Loading branch information
mortenoh committed May 19, 2022
2 parents 27e0eaf + 4b6bf31 commit 6edd181
Show file tree
Hide file tree
Showing 13 changed files with 360 additions and 82 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- uses: actions/setup-java@v2
with:
java-version: '11'
Expand All @@ -30,4 +32,4 @@ jobs:
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust
mvn deploy --settings .mvn/settings.xml -Dgpg.skip=false -DskipTests=true -B
mvn clean deploy --settings .mvn/settings.xml -Dgpg.skip=false -Dmaven.test.skip=true -B
8 changes: 5 additions & 3 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -25,10 +25,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'true'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -39,7 +41,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -53,4 +55,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
4 changes: 4 additions & 0 deletions .gitmodules
@@ -0,0 +1,4 @@
[submodule "dhis2-json-schema-generator"]
path = dhis2-json-schema-generator
url = https://github.com/dhis2/dhis2-json-schema-generator.git
branch = json-schemas
1 change: 1 addition & 0 deletions dhis2-json-schema-generator
89 changes: 25 additions & 64 deletions pom.xml
Expand Up @@ -19,58 +19,11 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<includePluginDependencies>true</includePluginDependencies>
<mainClass>org.hisp.dhis.integration.jsonschemagen.Dhis2JsonSchemaGenerator</mainClass>
<arguments>target/generated-resources/schemas</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>org.hisp.dhis.integration</groupId>
<artifactId>dhis2-json-schema-generator</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.dhis2.dhis2-core</groupId>
<artifactId>dhis-api</artifactId>
<version>2.37.4</version>
</dependency>
<dependency>
<groupId>com.github.dhis2.dhis2-core</groupId>
<artifactId>dhis-service-dxf2</artifactId>
<version>2.37.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<sourceDirectory>${project.build.directory}/generated-resources/schemas</sourceDirectory>
<targetPackage>org.hisp.dhis.api.v2_37_4.model</targetPackage>
<useOptionalForGetters>true</useOptionalForGetters>
<generateBuilders>true</generateBuilders>
<includeDynamicBuilders>true</includeDynamicBuilders>
Expand All @@ -81,9 +34,34 @@
</configuration>
<executions>
<execution>
<id>v2.37.6</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceDirectory>dhis2-json-schema-generator/schemas/v2.37.6</sourceDirectory>
<targetPackage>org.hisp.dhis.api.v2_37_6.model</targetPackage>
</configuration>
</execution>
<execution>
<id>v2.36.10</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceDirectory>dhis2-json-schema-generator/schemas/v2.36.10</sourceDirectory>
<targetPackage>org.hisp.dhis.api.v2_36_10.model</targetPackage>
</configuration>
</execution>
<execution>
<id>v2.35.13</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceDirectory>dhis2-json-schema-generator/schemas/v2.35.13</sourceDirectory>
<targetPackage>org.hisp.dhis.api.v2_35_13.model</targetPackage>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -213,23 +191,6 @@
</dependency>
</dependencies>

<pluginRepositories>
<pluginRepository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</pluginRepository>
<pluginRepository>
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<distributionManagement>
<repository>
<id>ossrh</id>
Expand Down
Expand Up @@ -25,13 +25,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hisp.dhis.integration.sdk;
package org.hisp.dhis.api.model;

import java.util.HashMap;
import java.util.Map;

import org.hisp.dhis.api.v2_37_4.model.Pager;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down

0 comments on commit 6edd181

Please sign in to comment.