-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidation.proto
More file actions
116 lines (86 loc) · 2.92 KB
/
validation.proto
File metadata and controls
116 lines (86 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
syntax = "proto3";
package invopop.phive.v1;
option go_package = "github.com/invopop/phive;phive";
option java_package = "rpc";
option java_outer_classname = "ValidationProto";
// Service definition for phive validation operations
service ValidationService {
// Lists all available VESIDs (Validation Execution Set IDs)
rpc ListVesIds(ListVesIdsRequest) returns (ListVesIdsResponse);
// Validates an XML document against a specific VESID
rpc ValidateXml(ValidateXmlRequest) returns (ValidateXmlResponse);
}
// Request to list all available VESIDs
message ListVesIdsRequest {
// Optional filter to match VESIDs by pattern (e.g., "com.helger.*")
string filter = 1;
}
// Response containing list of available VESIDs
message ListVesIdsResponse {
// List of available VESID strings
repeated VesIdInfo vesids = 1;
// Error message if the listing failed
string error_message = 2;
}
// Information about a VESID
message VesIdInfo {
// The VESID in coordinate format (e.g., "com.helger.phive:test_xsd:1.0")
string vesid = 1;
// Human-readable name/description if available
string name = 2;
// Version of the validation set
string version = 3;
// Status (e.g., "VALID", "DEPRECATED", etc.)
string status = 4;
}
// Request to validate an XML document
message ValidateXmlRequest {
// The VESID to use for validation (e.g., "com.helger.phive:test_xsd:1.0")
// Can use pseudo-versions like "latest" or "latest-release"
string vesid = 1;
// XML content as bytes
bytes xml_content = 2;
// Optional: source identifier for logging/tracking
string source_identifier = 3;
}
// Response from XML validation
message ValidateXmlResponse {
// Overall validation success
bool success = 1;
// The resolved VESID that was used (if pseudo-version was used)
string resolved_vesid = 2;
// Validation results for each validation layer
repeated ValidationLayerResult results = 3;
// Error message if validation failed to execute
string error_message = 4;
// Timestamp when validation was performed (ISO 8601 format)
string timestamp = 5;
}
// Result from a single validation layer (e.g., XSD, Schematron)
message ValidationLayerResult {
// The type of validation (e.g., "XSD", "Schematron", "EDIFACT")
string validation_type = 1;
// Artifact ID used for this validation
string artifact_id = 2;
// Success indicator for this layer
bool success = 3;
// List of errors found in this layer
repeated ValidationError errors = 4;
// List of warnings (if any)
repeated ValidationError warnings = 5;
}
// Validation error or warning
message ValidationError {
// Error level (ERROR, WARN, INFO)
string level = 1;
// Error message
string message = 2;
// Location in the document (line number if available)
string location = 3;
// XPath or other locator
string xpath = 4;
// Test ID (for Schematron rules)
string test_id = 5;
// Additional error details
map<string, string> details = 6;
}