Skip to content

Commit

Permalink
feat (core): Generate JSON Schema from Enola Core Meta Proto during b…
Browse files Browse the repository at this point in the history
…uild

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.
  • Loading branch information
vorburger committed Feb 16, 2024
1 parent 0945dd0 commit 1d70689
Show file tree
Hide file tree
Showing 15 changed files with 3,173 additions and 2 deletions.
113 changes: 113 additions & 0 deletions docs/models/enola/schemas/Connector.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Connector",
"definitions": {
"Connector": {
"properties": {
"error": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"description": "Always fails with this error message (for testing, only). TODO Remove this again? This was really useful in earlier testing, only."
},
"java_class": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"description": "Java class name for in-process connector on the Java classpath."
},
"fs": {
"$ref": "#/definitions/dev.enola.core.meta.FileSystemRepository",
"additionalProperties": false,
"oneOf": [
{
"type": "null"
},
{}
],
"title": "TODO java_guice lookup?",
"description": "TODO java_guice lookup?"
},
"grpc": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"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.)"
}
},
"additionalProperties": false,
"oneOf": [
{
"type": "null"
},
{
"type": "object"
}
],
"title": "Connector"
},
"dev.enola.core.meta.FileSystemRepository": {
"properties": {
"path": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
]
},
"format": {
"enum": [
"FORMAT_UNSPECIFIED",
0,
"FORMAT_TEXTPROTO",
1,
"FORMAT_YAML",
2,
"FORMAT_JSON",
3
],
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Format"
}
},
"additionalProperties": false,
"oneOf": [
{
"type": "null"
},
{
"type": "object"
}
],
"title": "File System Repository"
}
}
}
74 changes: 74 additions & 0 deletions docs/models/enola/schemas/Data.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Data",
"definitions": {
"Data": {
"properties": {
"label": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"description": "Human readable label, may be shown on a UI."
},
"description": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"description": "Short 1-2 sentences of description, may be shown on a UI e.g. as tooltip."
},
"tags": {
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
]
},
"oneOf": [
{
"type": "null"
},
{
"type": "object"
}
],
"description": "Tags."
},
"type_url": {
"oneOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"description": "The fully qualified name of the (root) Protocol Buffer Message; see https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto"
}
},
"additionalProperties": false,
"oneOf": [
{
"type": "null"
},
{
"type": "object"
}
],
"title": "Data"
}
}
}
Loading

0 comments on commit 1d70689

Please sign in to comment.