Skip to content

Commit debbc2e

Browse files
committed
feat (core): Generate JSON Schema from Enola Core Meta Proto during build
This commit is part of the overall work I've done over the past few week-ends, see enola-dev#451 for history; it is only commited separately here for clearer future git log.
1 parent af32050 commit debbc2e

11 files changed

+3264
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"$ref": "#/definitions/Connector",
4+
"definitions": {
5+
"Connector": {
6+
"properties": {
7+
"error": {
8+
"oneOf": [
9+
{
10+
"type": "null"
11+
},
12+
{
13+
"type": "string"
14+
}
15+
],
16+
"description": "Always fails with this error message (for testing, only)."
17+
},
18+
"java_class": {
19+
"oneOf": [
20+
{
21+
"type": "null"
22+
},
23+
{
24+
"type": "string"
25+
}
26+
],
27+
"description": "Java class name for in-process connector on the Java classpath."
28+
},
29+
"fs": {
30+
"$ref": "#/definitions/dev.enola.core.meta.FileSystemRepository",
31+
"additionalProperties": false,
32+
"oneOf": [
33+
{
34+
"type": "null"
35+
},
36+
{}
37+
],
38+
"title": "TODO java_guice lookup?",
39+
"description": "TODO java_guice lookup?"
40+
},
41+
"grpc": {
42+
"oneOf": [
43+
{
44+
"type": "null"
45+
},
46+
{
47+
"type": "string"
48+
}
49+
],
50+
"description": "Invokes remote connector via gRPC. The \"connection string\" here is a target endpoint in hostname:port format. (It's NOT an URI, so there is no scheme:// nor any /path/ or #fragment.)"
51+
}
52+
},
53+
"additionalProperties": false,
54+
"oneOf": [
55+
{
56+
"type": "null"
57+
},
58+
{
59+
"type": "object"
60+
}
61+
],
62+
"title": "Connector"
63+
},
64+
"dev.enola.core.meta.FileSystemRepository": {
65+
"properties": {
66+
"path": {
67+
"oneOf": [
68+
{
69+
"type": "null"
70+
},
71+
{
72+
"type": "string"
73+
}
74+
]
75+
},
76+
"format": {
77+
"enum": [
78+
"FORMAT_UNSPECIFIED",
79+
0,
80+
"FORMAT_TEXTPROTO",
81+
1,
82+
"FORMAT_YAML",
83+
2,
84+
"FORMAT_JSON",
85+
3
86+
],
87+
"oneOf": [
88+
{
89+
"type": "string"
90+
},
91+
{
92+
"type": "integer"
93+
},
94+
{
95+
"type": "null"
96+
}
97+
],
98+
"title": "Format"
99+
}
100+
},
101+
"additionalProperties": false,
102+
"oneOf": [
103+
{
104+
"type": "null"
105+
},
106+
{
107+
"type": "object"
108+
}
109+
],
110+
"title": "File System Repository"
111+
}
112+
}
113+
}
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"$ref": "#/definitions/Data",
4+
"definitions": {
5+
"Data": {
6+
"properties": {
7+
"label": {
8+
"oneOf": [
9+
{
10+
"type": "null"
11+
},
12+
{
13+
"type": "string"
14+
}
15+
],
16+
"description": "Human readable label, may be shown on a UI."
17+
},
18+
"description": {
19+
"oneOf": [
20+
{
21+
"type": "null"
22+
},
23+
{
24+
"type": "string"
25+
}
26+
],
27+
"description": "Short 1-2 sentences of description, may be shown on a UI e.g. as tooltip."
28+
},
29+
"tags": {
30+
"additionalProperties": {
31+
"oneOf": [
32+
{
33+
"type": "null"
34+
},
35+
{
36+
"type": "string"
37+
}
38+
]
39+
},
40+
"oneOf": [
41+
{
42+
"type": "null"
43+
},
44+
{
45+
"type": "object"
46+
}
47+
],
48+
"description": "Tags."
49+
},
50+
"type_url": {
51+
"oneOf": [
52+
{
53+
"type": "null"
54+
},
55+
{
56+
"type": "string"
57+
}
58+
],
59+
"description": "The fully qualified name of the (root) Protocol Buffer Message; see https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto"
60+
}
61+
},
62+
"additionalProperties": false,
63+
"oneOf": [
64+
{
65+
"type": "null"
66+
},
67+
{
68+
"type": "object"
69+
}
70+
],
71+
"title": "Data"
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)