Skip to content

Add json schemas to source #41

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

Merged
merged 2 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
23 changes: 19 additions & 4 deletions dataline-config/src/main/java/io/dataline/config/ConfigSchema.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
package io.dataline.config;

public enum ConfigSchema {
SOURCE_CONNECTION_CONFIGURATION("SourceConnectionConfiguration.json"),
// workspace
STANDARD_WORKSPACE("StandardWorkspace.json"),

// source
STANDARD_SOURCE("StandardSource.json"),
SOURCE_CONNECTION_SPECIFICATION("SourceConnectionSpecification.json"),
SOURCE_CONNECTION_IMPLEMENTATION("SourceConnectionImplementation.json"),

// destination
STANDARD_DESTINATION("StandardDestination.json"),
DESTINATION_CONNECTION_SPECIFICATION("DestinationConnectionSpecification.json"),
DESTINATION_CONNECTION_IMPLEMENTATION("DestinationConnectionImplementation.json"),

// test connection
STANDARD_CONNECTION_STATUS("StandardConnectionStatus.json"),

// discover schema
STANDARD_DISCOVERY_OUTPUT("StandardDiscoveryOutput.json"),
DESTINATION_CONNECTION_CONFIGURATION("DestinationConnectionConfiguration.json"),
STANDARD_SYNC_CONFIGURATION("StandardSyncConfiguration.json"),

// sync
STANDARD_SYNC("StandardSync.json"),
STANDARD_SYNC_SUMMARY("StandardSyncSummary.json"),
STANDARD_SYNC_STATE("StandardSyncState.json"),
STANDARD_SYNC_SCHEDULE("StandardSyncSchedule.json"),
STATE("State.json");

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/DestinationConnectionImplementation.json",
"title": "DestinationConnectionImplementation",
"description": "information required for connection to a destination.",
"type": "object",
"required": ["destinationSpecificationId", "destinationImplementationId", "configuration"],
"additionalProperties": false,
"properties": {
"destinationSpecificationId": {
"type": "string",
"format": "uuid"
},
"destinationImplementationId": {
"type": "string",
"format": "uuid"
},
"configuration": {
"description": "type any. information here varies by integration. this data is validated against a specification"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/DestinationSpecification.json",
"title": "DestinationConnectionSpecification",
"description": "specification for how to configure a connection to a destination",
"type": "object",
"required": ["destinationId", "destinationSpecificationId", "specification"],
"additionalProperties": false,
"properties": {
"destinationId": {
"type": "string",
"format": "uuid"
},
"destinationSpecificationId": {
"type": "string",
"format": "uuid"
},
"specification": {
"description": "type any. information here varies by integration"
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/SourceConnectionConfiguration.json",
"title": "SourceConnectionConfiguration",
"description": "information required for connection to a destination.", "type": "object",
"required": ["sourceSpecificationId", "sourceImplementationId", "configuration"],
"additionalProperties": false,
"properties": {
"sourceSpecificationId": {
"type": "string",
"format": "uuid"
},
"sourceImplementationId": {
"type": "string",
"format": "uuid"
},
"configuration": {
"description": "type any. information here varies by integration. this data is validated against a specification"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/SourceSpecification.json",
"title": "SourceConnectionSpecification",
"description": "specification for how to configure a connection to a source",
"type": "object",
"required": ["sourceId", "sourceSpecificationId", "specification"],
"additionalProperties": false,
"properties": {
"sourceId": {
"type": "string",
"format": "uuid"
},
"sourceSpecificationId": {
"type": "string",
"format": "uuid"
},
"specification": {
"description": "type any. information here varies by integration"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "StandardConnectionStatus",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardConnectionStatus.json",
"title": "StandardConnectionStatus",
"description": "describes the result of a 'test connection' action.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "StandardDataSchema",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardDataSchema.json",
"title": "StandardDataSchema",
"type": "object",
"definitions": {
Expand Down
21 changes: 21 additions & 0 deletions dataline-config/src/main/resources/json/StandardDestination.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/Destination.json",
"title": "Source",
"description": "describes a destination",
"type": "object",
"required": [
"destinationId",
"name"
],
"additionalProperties": false,
"properties": {
"destinationId": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "StandardDiscoveryOutput",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardDiscoveryOutput.json",
"title": "StandardDiscoveryOutput",
"description": "describes the standard output for any discovery run.",
"type": "object",
Expand Down
21 changes: 21 additions & 0 deletions dataline-config/src/main/resources/json/StandardSource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/Source.json",
"title": "Source",
"description": "describes a source",
"type": "object",
"required": [
"sourceId",
"name"
],
"additionalProperties": false,
"properties": {
"sourceId": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "StandardSyncConfiguration",
"title": "StandardSyncConfiguration",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardSyncConfiguration.json",
"title": "StandardSync",
"description": "configuration required for sync for ALL taps",
"type": "object",
"required": ["syncMode", "schema"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://dataline.io/docs/models/StandardScheduleConfiguration.json",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardScheduleConfiguration.json",
"title": "StandardScheduleConfiguration",
"type": "object",
"required": ["timeUnit", "units"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "StandardSyncSummary",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardSyncSummary.json",
"title": "StandardSyncSummary",
"description": "standard information output by ALL taps for a sync step (our version of state.json)",
"type": "object",
Expand Down
37 changes: 37 additions & 0 deletions dataline-config/src/main/resources/json/StandardWorkspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/StandardWorkspaceConfiguration.json",
"title": "StandardWorkspace",
"description": "workspace configuration",
"type": "object",
"required": ["workspaceId", "name", "slug", "initialSetupComplete"],
"additionalProperties": false,
"properties": {
"workspaceId": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"slug": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"initialSetupComplete": {
"type": "boolean"
},
"anonymousDataCollection": {
"type": "boolean"
},
"news": {
"type": "boolean"
},
"securityUpdates": {
"type": "boolean"
}
}
}
5 changes: 3 additions & 2 deletions dataline-config/src/main/resources/json/State.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "DestinationConnectionConfiguration",
"title": "DestinationConnectionConfiguration",
"$id": "https://github.com/datalineio/dataline/blob/master/dataline-config/src/main/resources/json/State.json",
"title": "State",
"description": "information output by the connection.",
"type": "object",
"required": ["connectionId", "state"],
Expand All @@ -12,6 +12,7 @@
"format": "uuid"
},
"state": {
"description": "type any. information here varies by integration"
}
}
}