pact-plugin-driver 0.0.0

Pact support library that interface for interacting with Pact plugins
Documentation
syntax = "proto3";

import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

package io.pact.plugin;

message InitPluginRequest {
  string implementation = 1;
  string version = 2;
}

message CatalogueEntry {
  string type = 1;
  string key = 2;
  map<string, string> values = 3;
}

message InitPluginResponse {
  repeated CatalogueEntry catalogue = 1;
}

message Catalogue {
  repeated CatalogueEntry catalogue = 1;
}

message Void {}

message Body {
  string contentType = 1;
  google.protobuf.BytesValue content = 2;
}

message CompareContentsRequest {
  Body expected = 1;
  Body actual = 2;
  bool allow_unexpected_keys = 3;
  map<string, MatchingRules> rules = 4;
}

message ContentTypeMismatch {
  string expected = 1;
  string actual = 2;
}

message ContentMismatch {
  google.protobuf.BytesValue expected = 1;
  google.protobuf.BytesValue actual = 2;
  string mismatch = 3;
  string path = 4;
  string diff = 5;
}

message CompareContentsResponse {
  ContentTypeMismatch typeMismatch = 1;
  // TODO: This needs to be a list of results where each result has a key and a list of
  // mismatches
  repeated ContentMismatch results = 2;
}

message ConfigureContentsRequest {
  string contentType = 1;
  google.protobuf.Struct contentsConfig = 2;
}

message MatchingRule {
  string type = 1;
  google.protobuf.Struct values = 2;
}

message MatchingRules {
  repeated MatchingRule rule = 1;
}

message Generator {
  string type = 1;
  google.protobuf.Struct values = 2;
}

message ConfigureContentsResponse {
  Body contents = 1;
  map<string, MatchingRules> rules = 2;
  map<string, Generator> generators = 3;
}

message GenerateContentRequest {
    Body contents = 1;
    map<string, Generator> generators = 2;
}

message GenerateContentResponse {
  Body contents = 1;
}

service PactPlugin {
  rpc InitPlugin(InitPluginRequest) returns (InitPluginResponse);
  rpc UpdateCatalogue(Catalogue) returns (Void);
  rpc CompareContents(CompareContentsRequest) returns (CompareContentsResponse);
  rpc ConfigureContents(ConfigureContentsRequest) returns (ConfigureContentsResponse);
  rpc GenerateContent(GenerateContentRequest) returns (GenerateContentResponse);
}