Skip to content

Commit

Permalink
feat: Add JSON schema to bitbucket source plugin (#16558)
Browse files Browse the repository at this point in the history
Closes #16374
  • Loading branch information
candiduslynx committed Feb 9, 2024
1 parent 46521b7 commit fe08e47
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugins/source/bitbucket/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.1'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'com.konghq:unirest-java:3.14.2'
implementation 'io.grpc:grpc-protobuf:1.57.1'
implementation 'io.grpc:grpc-stub:1.57.1'
implementation 'io.grpc:grpc-services:1.57.1'
implementation 'io.grpc:grpc-testing:1.57.1'

// gRPC
implementation 'io.grpc:grpc-protobuf:1.61.1'
implementation 'io.grpc:grpc-stub:1.61.1'
implementation 'io.grpc:grpc-services:1.61.1'
testImplementation 'io.grpc:grpc-testing:1.61.1'

implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'

implementation 'io.cloudquery:plugin-pb-java:0.0.13'
implementation 'io.cloudquery:plugin-sdk-java:0.0.20'
implementation 'io.cloudquery:plugin-pb-java:0.0.14'
implementation 'io.cloudquery:plugin-sdk-java:0.0.21'
}

// Apply a specific Java toolchain to ease working on different environments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class BitbucketPlugin extends Plugin {

public BitbucketPlugin() {
super("bitbucket", PLUGIN_VERSION);
this.setJsonSchema(Spec.jsonSchema);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,35 @@ public void validate() throws ConfigurationException {
throw new ConfigurationException("Username and password are required");
}
}

public static final String jsonSchema =
"""
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/cloudquery/cloudquery/plugins/source/bitbicket/spec",
"$ref": "#/$defs/Spec",
"$defs": {
"Spec": {
"properties": {
"username": {
"type": "string",
"minLength": 1,
"description": "BitBucket user."
},
"password": {
"type": "string",
"minLength": 1,
"description": "BitBucket password."
},
},
"additionalProperties": false,
"type": "object",
"required": [
"username",
"password"
]
},
}
}
""";
}

0 comments on commit fe08e47

Please sign in to comment.