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

Generate Pydantic models #17

Merged
merged 187 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
5ed10f4
Start of workflow to generate Pydantic models
mmwinther Nov 14, 2023
279d2b8
Run generation command to stdout
mmwinther Nov 15, 2023
05ac1db
Generate Pydantic models
mmwinther Nov 15, 2023
8781935
Install git
mmwinther Nov 15, 2023
186e5e6
Install datamodel-codegen, don't use the container
mmwinther Nov 15, 2023
815f20a
Install using pipx
mmwinther Nov 15, 2023
03addb5
Specify python 3.11.5
mmwinther Nov 15, 2023
d682754
Bump datamodel-codegen to 0.24.0
mmwinther Nov 16, 2023
146fbf1
Install pyyaml for datamodel-codegen
mmwinther Nov 16, 2023
7b86c96
Correctly specify branch to push to
mmwinther Nov 16, 2023
909d13d
Merge 7b86c96a01ef45ce63d42c71e080651678a9a7be into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
bb4bcea
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
9cd0a65
Merge bb4bcea7eb0ceb7835d46e53301bf2ed02253b72 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
80fe377
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
4640e0b
Merge 80fe377b496a4d9600bd22fab157003b3bb15f95 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
306d101
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
784c362
Merge 306d101c05dae2556f43db18c0991e651722682a into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
a91146e
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
90ebdf3
Merge a91146edccc7143d0f088f48aa689030e8ad51f9 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
efe56b0
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
07ecd5b
Merge efe56b0b096eaf5b39130e19a6821e1963e9eaa7 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
e66cf62
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
11f4e19
Merge e66cf62a4c8542ed442b06376534fa9ea420a608 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
ae4bbbe
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
e899216
Merge ae4bbbe1539f2dc550c351ca9ef45e92b7ea3b91 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
b507a03
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
b4701f1
Merge b507a0382e70030880df9f78b725cb54681c3dd0 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
15743ef
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
e9a2143
Merge 15743ef9e06f278239bb998f3c4b7937b77e415d into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
2ec7f2a
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
21ee596
Merge 2ec7f2ac1becb205edc253772885c091e717e10c into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
d2f0372
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
9ffd555
Merge d2f0372440e2e79e777fdf7e8237e65e5d0001cc into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4deb787
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
a66e7c6
Merge 4deb7873198e1676181f1379eb9cb074df815e23 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
d53cef0
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
d5f21a3
Merge d53cef07493eac527c18e5552cef97fcbfe121b0 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
9242557
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
4360ecd
Merge 92425571a71b815292dd46334e9963fbee06aa99 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
fa09067
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
f825299
Merge fa09067039213487016a4a605ffd6248c3c4be58 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
0a6348e
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
c37afe8
Merge 0a6348e4b2029f3d1683e58b6c6e49719d6642c9 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
0891790
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
283fd0e
Merge 0891790fc631e8ec83350cea69fa0208b73aaa44 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
f8b66f7
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
498c25d
Merge f8b66f7d5c5eac3a3c01a50560d52d0a258527b6 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
91d4939
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
b3b75c4
Merge 91d49392460f79a111f2c7d65e076aa14aac9bef into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
70390ad
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
da87c8b
Merge 70390ad7b08374d6c84c4f38f91674a976e56ce2 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
79cd095
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
bb3e2d6
Merge 79cd095a3baa0b691abee54ffbc593a4ce908486 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
c87e2b8
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
d826899
Merge c87e2b8e28c25f1692a2b8dd9ba4bed363b64c7b into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4b2f1ea
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
ca68b59
Merge 4b2f1eaab3e9d4c4107735258b8a914c43c0ee3d into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
75c99c5
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
7eae014
Merge 75c99c5041f57900d34012e3ea8dfc7dcb0fe951 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
d48c128
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
0209f79
Merge d48c12848f2934463d525587dd83ec4d39ed1c9f into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
54ae281
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
ebfd2f7
Merge 54ae281b4762452340625f5da73ac39f90152c2b into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
8db77de
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
5d458bb
Merge 8db77de6c67c9139b2a87757571aa830d66aa634 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
a62a67d
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
668b34d
Merge a62a67df9c456aa8e28826eb405f828a2efb5d04 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
783c462
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
44a198a
Merge 783c462d21d5423d8d310a37abaf959d82821578 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
10cc993
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
067f6f8
Merge 10cc9938436f4a0f9e642c17d4f9bf56aa706ea4 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
556f7a9
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
9a44f69
Merge 556f7a9eaea10a24c89d881bf78d4c840633e37e into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
de27ff3
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
a9ad724
Merge de27ff3452f00087acc7ca4726c2a4142384c1ee into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
a1491a9
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
904b155
Merge a1491a95a3415c58fe62037513dfe541ef086fe0 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
d49eb63
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
c55960f
Merge d49eb63bebe4ed5fc12698861524db875925f1c5 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
daa2f0b
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
24996b8
Merge daa2f0b5dc064ca3dc262b88e4344135456d85b9 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
040b3a2
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
95b6dd2
Merge 040b3a274495e81e41358a91ec1bdeddb68fa483 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
a00e768
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
5bed01c
Merge a00e768bf8e38622c3cbbb6c5d2049f04e676830 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
2be0767
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
981c39b
Merge 2be0767fa3f18728fa4da77d82c6adf6f37f84dd into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
c4b74ca
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
554d1f2
Merge c4b74cae90823ed6f82ace2d7c4821392f5002de into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4ed87b7
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
784e6b5
Merge 4ed87b7f9bcad0fb855e5a581b97c99131dbae44 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
106cde7
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
42ccbe9
Merge 106cde76a14108f8c06d841319e5782c7c394001 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
35724a0
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
f4f75d4
Merge 35724a01b7c015c4f85207dc7b7191edc0b5ac4a into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
b7dd118
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
361bf5b
Merge b7dd11819f926de9199e45ecde4683767986c5b3 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
0b539ee
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
b2c351d
Specify which paths to trigger on
mmwinther Nov 16, 2023
c66b6bc
Merge b2c351d1c38e93fcfb3386aa90b0d4c902a5ad3e into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
2d9342a
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
5bbc46c
Merge 2d9342ae263a70ad3b90024a71f01f591e091160 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
bbdbd4a
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
9414046
Merge bbdbd4a78d8b3ae7900485ecebac2ab68d94455d into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
3fa0171
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
e96bd92
Merge 3fa0171d18d13382f1de1a6d7c42c537584d63b0 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
1ab71f0
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
31018e6
Merge 1ab71f039df55c6a75661f2d1aa6e0790694d157 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4b0862d
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
998119a
Merge 4b0862da5ea78def511c22f493c0c1d95939f4cb into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
b27e34d
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
36244d2
Merge b27e34d6b9348fb7c124d05fae8d3eb04dd8aefb into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
2b84bdd
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
914c522
Merge 2b84bdde416a7b9dfa63e6053d41f3b00cf25f81 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
03cd3af
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
8406ca5
Merge 03cd3afaaf4edb162a8a4028ff8cfd0eece2a6f0 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
6c789bb
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
998ca94
Merge 6c789bbc613a86f869bc6ebee7386c30faa8bfbf into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
6d4132b
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
e992fd0
Merge 6d4132b3a13b2aaedbf800074bcf37b65be8f7ec into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
5baf6b4
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
418e6c0
Merge 5baf6b4c2dd78aa53728d64a2ca68426d238ca3d into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
db19b4f
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
ec672c3
Merge db19b4fbb3c12c7783d1149a6f6832a87e6efcd6 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
2b3982b
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
f712c98
Specify which paths to trigger on
mmwinther Nov 16, 2023
c5ab992
Merge f712c98ef38e3a305dc261a1b4d36ca3cfb0cfd3 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
012a100
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
7440ae7
Merge 012a100822a11c945fcef128e7661bb98486f671 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
dcf0d52
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
3445f9c
Merge dcf0d523bb5a6d9c5ec837cafee6ba2896db92a2 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
7121d99
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
bc6c19a
Merge 7121d99dc7b51ca93314c597c38396cf691fc1f6 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
38faa33
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
4c2c3c0
Merge 38faa33ef9620a76a3ebfb0f9fa7d1034a801e16 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
27b5e8e
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
1eb3785
Merge 27b5e8e3fbaa20732e9ac0ab31f2ecede925ac4f into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
c073d04
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
4ec3048
Merge c073d04fb7a536103b56dbe38cdd6d343308276d into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
6c3e21e
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
96adf21
Merge 6c3e21ef0cac8d654be0d510de643774835436a7 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
f0a63ae
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
313818f
Merge f0a63ae036032288ef870cc6db20157571287ccf into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
2568135
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
f9438af
Merge 2568135878d414605dc5bb188047d5f65aecc076 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
11f5a5a
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
94a439f
Merge 11f5a5a9f3c2e927bcc40c9eb2b453d990d963c6 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
e2d7306
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
018cc10
Merge e2d7306d7046bb9e57d11aba6ab3162ee8fa2e7c into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
75a38f4
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
39b8b57
Merge 75a38f41096344978696a9105764b8e33d454d19 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
b782521
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
b515774
Merge b7825216aef9cc33b7d0b6de8e035c392eae06e5 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
8d4b107
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
aa448d3
Merge 8d4b107bf8a550b0c0864d91268ecf1757b0227d into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
281cc54
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
3c8a67e
Merge 281cc54fac947c10350096460894302c3ebe19ea into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
977fbd8
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
5f4a6c1
Merge 977fbd84724488f5ddc6107bfc85866f51240b0c into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
7c24fd7
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
42ac36a
Merge 7c24fd78fa8284a297fb90ace17e9b20cfd90539 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
6b93291
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
e523006
Merge 6b93291f25e6141973ca81844e35e63742d9cf61 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4559a16
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
41e4af3
Merge 4559a16cda3e0efac073b609a165b893afb6aa33 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
c5e01aa
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
47a3ea2
Merge c5e01aaaf7550f81b55f45af89e520ea99c8d216 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
19b126a
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
d9a7050
Merge 19b126a5cc0c6e188012b36092e555e73cf44daa into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
fbe8c94
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
c5ada7a
Merge fbe8c9475e7006bba828fde08ace3e0ef772d1ac into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
f50beb0
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
c13ed0b
Merge f50beb0258284837c442c3e4c2eafcc4306b99c5 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
7ff2fd0
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
904c0b6
Merge 7ff2fd0e43a96e80cb34563f91caeb4dc0a9f692 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4125a44
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
403a96d
Merge 4125a44ebbb838939381751f784a6392160efef0 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
4aba824
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
6391c27
Merge 4aba824489ea56d3aa9911bd66b63963e63c01f4 into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
faa5faa
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
1675170
Merge faa5faafffdca0fa1808396fa9b6100e2644172e into 2f9ec48375019e52f…
mmwinther Nov 16, 2023
99c000e
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
c158e90
Use push trigger, not pull_request
mmwinther Nov 16, 2023
335ecd7
Bump datamodel-codegen to 0.24.2
mmwinther Nov 16, 2023
30db6ea
Use github.ref
mmwinther Nov 16, 2023
2fd2d61
Add description for percentage_complete field
mmwinther Nov 16, 2023
b1540fc
[GENERATE] Pydantic models from JSON Schema
dapla-bot[bot] Nov 16, 2023
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
70 changes: 70 additions & 0 deletions .github/workflows/generate-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

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

jobs:
generate-python:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.DAPLA_BOT_APP_ID }}
private-key: ${{ secrets.DAPLA_BOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}

- name: Configure Git
run: |
git config user.name "dapla-bot[bot]"
git config user.email "143391972+dapla-bot[bot]@users.noreply.github.com"

- uses: actions/setup-python@v2
with:
python-version: 3.11.5

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

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

- name: Generate Python
run: >
datamodel-codegen
--input-file-type jsonschema
--input src/datadoc-json-schema/datadoc-json-schema.json
--output-model-type pydantic_v2.BaseModel
--force-optional
--use-default
--output generated/python/datadoc_model/datadoc_model/model.py

- name: Check for modified files
id: git-check
run: echo modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi) >> $GITHUB_OUTPUT

- name: Commit
if: steps.git-check.outputs.modified == 'true'
run: |
git add -A
git commit -m '[GENERATE] Pydantic models from JSON Schema'

- name: Push
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ steps.generate_token.outputs.token }}
branch: ${{ github.ref }}
296 changes: 296 additions & 0 deletions generated/python/datadoc_model/datadoc_model/model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
# generated by datamodel-codegen:
# filename: datadoc-json-schema.json
# timestamp: 2023-11-16T11:35:58+00:00

from __future__ import annotations

from datetime import datetime
from enum import Enum
from typing import List, Optional
from uuid import UUID

from pydantic import AnyUrl, BaseModel, Field
from typing_extensions import Literal


class Assessment(Enum):
SENSITIVE = 'SENSITIVE'
PROTECTED = 'PROTECTED'
OPEN = 'OPEN'


class DatasetStatus(Enum):
DRAFT = 'DRAFT'
INTERNAL = 'INTERNAL'
EXTERNAL = 'EXTERNAL'
DEPRECATED = 'DEPRECATED'


class DatasetState(Enum):
SOURCE_DATA = 'SOURCE_DATA'
INPUT_DATA = 'INPUT_DATA'
PROCESSED_DATA = 'PROCESSED_DATA'
STATISTICS = 'STATISTICS'
OUTPUT_DATA = 'OUTPUT_DATA'


class DataType(Enum):
STRING = 'STRING'
INTEGER = 'INTEGER'
DATETIME = 'DATETIME'
BOOLEAN = 'BOOLEAN'


class VariableRole(Enum):
IDENTIFIER = 'IDENTIFIER'
MEASURE = 'MEASURE'
START_TIME = 'START_TIME'
STOP_TIME = 'STOP_TIME'
ATTRIBUTE = 'ATTRIBUTE'


class LanguageStringType(BaseModel):
en: Optional[str] = None
nn: Optional[str] = None
nb: Optional[str] = None


class UnitType(Enum):
ARBEIDSULYKKE = 'ARBEIDSULYKKE'
BOLIG = 'BOLIG'
BYGNING = 'BYGNING'
EIENDOM = 'EIENDOM'
FAMILIE = 'FAMILIE'
FORETAK = 'FORETAK'
FYLKE = 'FYLKE'
HAVNEANLOEP = 'HAVNEANLOEP'
HUSHOLDNING = 'HUSHOLDNING'
KJOERETOEY = 'KJOERETOEY'
KOMMUNE = 'KOMMUNE'
KURS = 'KURS'
LOVBRUDD = 'LOVBRUDD'
PERSON = 'PERSON'
STAT = 'STAT'
STORFE = 'STORFE'
TRAFIKKULYKKE = 'TRAFIKKULYKKE'
TRANSAKSJON = 'TRANSAKSJON'
VARE_TJENESTE = 'VARE_TJENESTE'
VERDIPAPIR = 'VERDIPAPIR'
VIRKSOMHET = 'VIRKSOMHET'


class TemporalityTypeType(Enum):
FIXED = 'FIXED'
STATUS = 'STATUS'
ACCUMULATED = 'ACCUMULATED'
EVENT = 'EVENT'


class Dataset(BaseModel):
short_name: Optional[str] = Field(
None,
description='Name of (physical) data file, data table or dataset',
title='Short name',
)
assessment: Optional[Assessment] = Field(
None,
description='Value assessment (sensitivity classification) for the data set',
title='Assessment',
)
dataset_status: Optional[DatasetStatus] = Field(
None, description='Life cycle for data set', title='Data set status'
)
dataset_state: Optional[DatasetState] = Field(
None, description='Steady state of data', title='Data set state'
)
name: Optional[LanguageStringType] = Field(
None, description='Name of data set', title='Name'
)
description: Optional[LanguageStringType] = Field(
None, description='Free text description of the data set', title='Description'
)
data_source: Optional[LanguageStringType] = Field(
None,
description='Data source. Set either for the data set or instance variable.',
title='Data source',
)
register_uri: Optional[LanguageStringType] = Field(
None, description='Link to register', title='Register'
)
population_description: Optional[LanguageStringType] = Field(
None,
description='Description of the population covered in the data set. Includes unit type, spatial coverage and period of time.',
title='Description of population',
)
version: Optional[str] = Field(
None, description='Version of data set', title='Version'
)
version_description: Optional[LanguageStringType] = Field(
None,
description='Dataset version information in the form of descriptive text',
title='Version description',
)
unit_type: Optional[UnitType] = Field(
None,
description='Unit Type for data file, table or data set. See Definitions of Unit Types https://www.ssb.no/en/metadata/definisjoner-av-statistiske-enheter',
title='Unit type',
)
temporality_type: Optional[TemporalityTypeType] = Field(
None,
description='Temporality type. Either for the instance variable or the data set',
title='Temporality type',
)
subject_field: Optional[LanguageStringType] = Field(
None,
description='Primary area of statistics in which the data set is included',
title='Subject field',
)
keyword: Optional[List[str]] = Field(
None,
description='A list of searchable keywords that can contribute to the development of effective filtering and search services.',
title='Keyword(s)',
)
spatial_coverage_description: Optional[LanguageStringType] = Field(
None,
description="Description of the data set's spatial coverage",
title='Spatial coverage description',
)
id: Optional[UUID] = Field(
None, description='Unique identifier for the data set', title='Identifier'
)
owner: Optional[LanguageStringType] = Field(
None,
description='Owner of the data set (responsible division in Statistics Norway). See also Classification of organisational units https://www.ssb.no/en/klass/klassifikasjoner/83',
title='Owner',
)
file_path: Optional[str] = Field(
None,
description="The file path contains the data set's name and the path to where it is stored",
title='File path',
)
metadata_created_date: Optional[datetime] = Field(
None,
description='Created date for metadata about the data set',
title='Metadata created date',
)
metadata_created_by: Optional[str] = Field(
None, description='Created by identifiable person.', title='Metadata created by'
)
metadata_last_updated_date: Optional[datetime] = Field(
None,
description='Last updated date for metadata about the dataset',
title='Metadata last updated date',
)
metadata_last_updated_by: Optional[str] = Field(
None,
description='Last change made by identifiable person. ',
title='Metadata last updated by',
)
contains_data_from: Optional[str] = Field(
None,
description='The data set contains data from date/time',
title='Contains data from',
)
contains_data_until: Optional[str] = Field(
None,
description='The data set contains data up until date/time',
title='Contains data up until',
)


class Variable(BaseModel):
short_name: Optional[str] = Field(
None,
description='Physical name of the variable in the dataset. Should match the recommended short name.',
title='Short name',
)
name: Optional[LanguageStringType] = Field(
None,
description='Variable names can be inherited from VarDef, but can also be documented/changed here',
title='Name',
)
data_type: Optional[DataType] = Field(
None, description='Data type', title='Data type'
)
variable_role: Optional[VariableRole] = Field(
None,
description='Role of the instance variable in the data set',
title='Variable role',
)
definition_uri: Optional[AnyUrl] = Field(
None,
description="A link (URI) to the variable's definition in Vardok/VarDef",
title='Definition URI',
)
direct_person_identifying: Optional[bool] = Field(
None,
description='Direct Person identifying Information (DPI). Some of the values \u200b\u200bin an instance variable kan be DPI, others not. In this case, DPI is set equal to true. For example, the variable exporter where some of the values \u200b\u200bcan be organization number, others social security numbers (sole proprietorships).',
title='Direct Person identifying Information (DPI)',
)
data_source: Optional[LanguageStringType] = Field(
None,
description='Data source. Set at data set level, but can be overwritten at variable instance level.',
title='Data source',
)
population_description: Optional[LanguageStringType] = Field(
None,
description='The population the variable describes can be specified in more detail here. Set at dataset level, but can be overwritten at instance variable level.',
title='Population description',
)
comment: Optional[LanguageStringType] = Field(
None,
description='Further clarification of the variables definition',
title='Comment',
)
temporality_type: Optional[TemporalityTypeType] = Field(
None,
description='Temporality type. Set either for variable instance or dataset.',
title='Temporality type',
)
measurement_unit: Optional[str] = Field(
None, description='Measurement unit', title='Measurement unit'
)
format: Optional[str] = Field(
None,
description='The format of the values \u200b\u200b(physical format or regular expression) in machine-readable form for validation. This can be used as a further specification of the data type (dataType) in those cases where this is relevant.',
title='Format',
)
classification_uri: Optional[AnyUrl] = Field(
None,
description='Link (URI) to valid classification or code list',
title='Classification or codelist URI',
)
sentinel_value_uri: Optional[AnyUrl] = Field(
None,
description='A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values \u200b\u200bhave been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant',
title='Sentinel value URI',
)
invalid_value_description: Optional[LanguageStringType] = Field(
None,
description='Invalid value(s) description used in addition (or as an alternative) to standard sentinel values.',
title='Invalid value(s) description',
)
id: Optional[UUID] = Field(
None,
description='Unique SSB identifier for the instance variable in the data set',
title='Identifier',
)
contains_data_from: Optional[datetime] = Field(
None,
description='The instance variable in the data set contains data from and including this date. This can be useful information for data sets that contain many instance variables in addition to data for many periods/years. In many cases, it will then be the case that some variables only contain data for the most recent periods/years, e.g. if the entire data set contains data from 1970 to 2020, while some instance variables only contain data from 1998 onwards.',
title='Contains data from',
)
contains_data_until: Optional[datetime] = Field(
None,
description='The instance variable in the data set contains data up to and including this date. This can be useful information for data sets that contain many instance variables in addition to data for many periods/years. In many cases, it will then be the case that some of the instance variables in the data set are terminated (no longer updated) after a given point in time.',
title='Contains data up until',
)


class Model(BaseModel):
percentage_complete: Optional[int] = Field(
None, description='Percentage of obligatory metadata fields populated.'
)
document_version: Literal['2.0.0'] = None
dataset: Optional[Dataset] = None
variables: Optional[List[Variable]] = None
2 changes: 1 addition & 1 deletion src/datadoc-json-schema/datadoc-json-schema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",

"type": "object",
"properties": {
"percentage_complete": {
"$comment": "Used by the DataDoc app (internal information)",
"description": "Percentage of obligatory metadata fields populated.",
"type": "integer"
},
"document_version": {
Expand Down