Skip to content

Commit

Permalink
clean up protocol definition files & change to yamlschema (#514)
Browse files Browse the repository at this point in the history
* clean up protocol files

* fmt

* convert to yaml

* fix extensions

* revert quote changes

* convert rest to yaml

* fix builds

* fix build v2

* fmt

* fix build v3
  • Loading branch information
jrhizor authored Oct 7, 2020
1 parent ebb1f05 commit ee487c1
Show file tree
Hide file tree
Showing 64 changed files with 900 additions and 1,002 deletions.
5 changes: 4 additions & 1 deletion airbyte-config/models/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import org.jsonschema2pojo.SourceType

plugins {
id "com.github.eirnym.js2p" version "1.0"
}

jsonSchema2Pojo {
source = files("${sourceSets.main.output.resourcesDir}/json")
sourceType = SourceType.YAMLSCHEMA
source = files("${sourceSets.main.output.resourcesDir}/types")
targetDirectory = new File(project.buildDir, 'generated/src/gen/java/')

targetPackage = 'io.airbyte.config'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@
public enum ConfigSchema {

// workspace
STANDARD_WORKSPACE("StandardWorkspace.json"),
STANDARD_WORKSPACE("StandardWorkspace.yaml"),

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

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

// sync
STANDARD_SYNC("StandardSync.json"),
STANDARD_SYNC_SUMMARY("StandardSyncSummary.json"),
STANDARD_SYNC_SCHEDULE("StandardSyncSchedule.json"),
STANDARD_SYNC("StandardSync.yaml"),
STANDARD_SYNC_SUMMARY("StandardSyncSummary.yaml"),
STANDARD_SYNC_SCHEDULE("StandardSyncSchedule.yaml"),

STATE("State.json");
STATE("State.yaml");

static final Path KNOWN_SCHEMAS_ROOT = prepareSchemas();
private static final String RESOURCE_DIR = "json";
private static final String RESOURCE_DIR = "types";

/*
* JsonReferenceProcessor relies on all of the json in consumes being in a file system (not in a
Expand All @@ -68,7 +68,7 @@ private static Path prepareSchemas() {
try {
final List<String> filenames = MoreResources.listResources(ConfigSchema.class, RESOURCE_DIR)
.map(p -> p.getFileName().toString())
.filter(p -> p.endsWith(".json"))
.filter(p -> p.endsWith(".yaml"))
.collect(Collectors.toList());

final Path configRoot = Files.createTempDirectory("schemas");
Expand Down
8 changes: 0 additions & 8 deletions airbyte-config/models/src/main/resources/json/DataType.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions airbyte-config/models/src/main/resources/json/JobConfig.json

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions airbyte-config/models/src/main/resources/json/JobOutput.json

This file was deleted.

36 changes: 0 additions & 36 deletions airbyte-config/models/src/main/resources/json/JobSyncConfig.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ee487c1

Please sign in to comment.