Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to model v3 #44

Merged
merged 50 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
da27e9f
Added ARRAY to data_type-enum for variable.
BjornRoarJoneid Feb 5, 2024
5af8a65
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 5, 2024
1e62950
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 5, 2024
e46592d
New attribute multiplication_factor added variable model.
BjornRoarJoneid Feb 5, 2024
d41475e
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 5, 2024
92e9ee3
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 5, 2024
4b6dc7a
Replaced 'sentinel_value_uri' with a new object called 'special_value…
BjornRoarJoneid Feb 5, 2024
2ff2a0b
Replaced 'sentinel_value_uri' with a new object called 'special_value…
BjornRoarJoneid Feb 5, 2024
3bbabb4
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 5, 2024
16613ad
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 5, 2024
58a8ae2
Added 'data_element_path' for documentation of hierarchical datasets.
BjornRoarJoneid Feb 6, 2024
1117228
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 6, 2024
a19c25b
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 6, 2024
4343f38
Added 'customType' attribute to dataset.
BjornRoarJoneid Feb 6, 2024
c92b91d
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 6, 2024
6467ce9
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 6, 2024
b358e55
Added 'customType' attribute to variable metadata.
BjornRoarJoneid Feb 7, 2024
8b14e20
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 7, 2024
7b406cb
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 7, 2024
36fedf6
register_uri attribute removed.
BjornRoarJoneid Feb 12, 2024
a753158
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
33a1c9b
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 12, 2024
c1f2ae8
subject_field changed to string (from languageStringType)
BjornRoarJoneid Feb 12, 2024
c43b4ad
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
8352eb7
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 12, 2024
39bcd1d
Added new attribute contains_personal_data
BjornRoarJoneid Feb 12, 2024
d1799d7
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 12, 2024
3792859
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
b77d070
Added use_restriction and use_restriction_date.
BjornRoarJoneid Feb 12, 2024
ee5f320
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
36ec1d3
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 12, 2024
a1fb58e
Changed languageStringType to support many languages.
BjornRoarJoneid Feb 12, 2024
37063e2
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
c42c4e1
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 12, 2024
78e8942
Bumped to json schema to version 3.0.0
BjornRoarJoneid Feb 12, 2024
9864f52
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
7e9e136
Changed 'unit_type'-type to string
BjornRoarJoneid Feb 12, 2024
6120696
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
32ed62d
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 12, 2024
bef970a
Removed unitType.json
BjornRoarJoneid Feb 12, 2024
aa469cd
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 12, 2024
0614071
Merge remote-tracking branch 'origin/main' into update-to-model-v3
mmwinther Feb 22, 2024
bec2ccb
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 22, 2024
4383fb1
Release python-v5.0.0
mmwinther Feb 22, 2024
74eea14
Format pom.xml
mmwinther Feb 22, 2024
4277a39
Give workflows names
mmwinther Feb 22, 2024
65c0176
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 22, 2024
9327a80
[GENERATE] Java classes from JSON Schema
dapla-bot[bot] Feb 22, 2024
e2d4274
Remove no directory since it's not norwegian-specific
mmwinther Feb 22, 2024
3fa85ff
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Feb 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/generate-java.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Generate Java

on:
push:
branches:
- "**"
- "!main"
- "**"
- "!main"
paths:
- "src/**"
- "generated/java/datadoc-model/pom.xml"
- ".github/workflows/generate-java.yml"
- "src/**"
- "generated/java/datadoc-model/pom.xml"
- ".github/workflows/generate-java.yml"

# Allow only one generate workflow to run at a time. This avoids race conditions when
# pushing to the same branch.
Expand Down Expand Up @@ -38,10 +39,10 @@ jobs:

- name: Generate Java
run: |
pushd generated/java/datadoc-model
rm -rf src/main/java
./mvnw jsonschema2pojo:generate
popd
pushd generated/java/datadoc-model
rm -rf src/main/java
./mvnw jsonschema2pojo:generate
popd

- name: Check for modified files
id: git-check
Expand All @@ -50,11 +51,11 @@ jobs:
- name: Commit
if: steps.git-check.outputs.modified == 'true'
run: |
git add -A
git commit -m '[GENERATE] Java classes from JSON Schema'
git add -A
git commit -m '[GENERATE] Java classes from JSON Schema'

- name: Push
if: steps.git-check.outputs.modified == 'true'
run: |
git pull --rebase origin "${GITHUB_REF}"
git push origin "${GITHUB_REF}"
git pull --rebase origin "${GITHUB_REF}"
git push origin "${GITHUB_REF}"
51 changes: 26 additions & 25 deletions .github/workflows/generate-python.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Generate Python

on:
push:
branches:
- "**"
- "!main"
- "**"
- "!main"
paths:
- "src/**/*.json"
- ".github/workflows/generate-python.yml"
- "src/**/*.json"
- ".github/workflows/generate-python.yml"

# Allow only one generate workflow to run at a time. This avoids race conditions when
# pushing to the same branch.
Expand Down Expand Up @@ -40,29 +41,29 @@ jobs:

- name: Install pipx
run: |
python -m pip install --upgrade pipx
python -m pipx ensurepath
python -m pip install --upgrade pipx
python -m pipx ensurepath

- name: Install datamodel-codegen
run: |
python -m pipx install datamodel-code-generator==0.25.2
python -m pipx install datamodel-code-generator==0.25.2

- name: Generate Python
run: >
datamodel-codegen
--input-file-type jsonschema
--input src/metadata-container-json-schema.json
--output-model-type pydantic_v2.BaseModel
--base-class "datadoc_model.datadoc_base_model.DatadocBaseModel"
--use-default
--use-title-as-name
--use-one-literal-as-default
--force-optional
--use-subclass-enum
--use-standard-collections
--use-double-quotes
--target-python-version 3.10
--output generated/python/datadoc_model/datadoc_model/model.py
datamodel-codegen
--input-file-type jsonschema
--input src/metadata-container-json-schema.json
--output-model-type pydantic_v2.BaseModel
--base-class "datadoc_model.datadoc_base_model.DatadocBaseModel"
--use-default
--use-title-as-name
--use-one-literal-as-default
--force-optional
--use-subclass-enum
--use-standard-collections
--use-double-quotes
--target-python-version 3.10
--output generated/python/datadoc_model/datadoc_model/model.py

- name: Check for modified files
id: git-check
Expand All @@ -71,11 +72,11 @@ jobs:
- name: Commit
if: steps.git-check.outputs.modified == 'true'
run: |
git add -A
git commit -m '[GENERATE] Pydantic models from JSON Schema'
git add -A
git commit -m '[GENERATE] Pydantic models from JSON Schema'

- name: Push
if: steps.git-check.outputs.modified == 'true'
run: |
git pull --rebase origin "${GITHUB_REF}"
git push origin "${GITHUB_REF}"
git pull --rebase origin "${GITHUB_REF}"
git push origin "${GITHUB_REF}"
112 changes: 57 additions & 55 deletions generated/java/datadoc-model/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>no.ssb.dapla.metadata</groupId>
<artifactId>datadoc-model</artifactId>
Expand All @@ -13,7 +15,8 @@
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<artifact-registry.url>artifactregistry://europe-north1-maven.pkg.dev/artifact-registry-5n/dapla-stat-maven/</artifact-registry.url>
<artifact-registry.url>
artifactregistry://europe-north1-maven.pkg.dev/artifact-registry-5n/dapla-stat-maven/</artifact-registry.url>
<github.repository>statisticsnorway/ssb-datadoc-model</github.repository>

<!-- Dependency versions -->
Expand All @@ -35,66 +38,66 @@

<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${jakarta.validation-api.version}</version>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${jakarta.validation-api.version}</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<tagNameFormat>java-v@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>${jsonschema2pojo-maven-plugin.version}</version>
<configuration>
<sourceDirectory>${basedir}../../../../src</sourceDirectory>
<outputDirectory>${basedir}/src/main/java</outputDirectory>
<targetPackage>no.ssb.dapla.metadata</targetPackage>
<serializable>true</serializable>
<includeConstructors>true</includeConstructors>
<includeJsr303Annotations>true</includeJsr303Annotations>
<useJakartaValidation>true</useJakartaValidation>
<useTitleAsClassname>true</useTitleAsClassname>
<generateBuilders>true</generateBuilders>
<useInnerClassBuilders>true</useInnerClassBuilders>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
</plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<tagNameFormat>java-v@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>${jsonschema2pojo-maven-plugin.version}</version>
<configuration>
<sourceDirectory>${basedir}../../../../src</sourceDirectory>
<outputDirectory>${basedir}/src/main/java</outputDirectory>
<targetPackage>no.ssb.dapla.metadata</targetPackage>
<serializable>true</serializable>
<includeConstructors>true</includeConstructors>
<includeJsr303Annotations>true</includeJsr303Annotations>
<useJakartaValidation>true</useJakartaValidation>
<useTitleAsClassname>true</useTitleAsClassname>
<generateBuilders>true</generateBuilders>
<useInnerClassBuilders>true</useInnerClassBuilders>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<extensions>
Expand All @@ -104,7 +107,6 @@
<version>${artifactregistry-maven-wagon.version}</version>
</extension>
</extensions>

</build>

<repositories>
Expand Down Expand Up @@ -158,4 +160,4 @@
</repository>
</distributionManagement>

</project>
</project>
Loading
Loading