Power Platform Connector Validator. Checks apiDefinition.swagger.json, apiProperties.json, and script.csx against official Microsoft schemas and documented requirements.
npm install -g ppcvOr run without installing:
npx ppcv ./MyConnectorppcv [path] [options]
Arguments:
path Path to a connector folder or apiDefinition.swagger.json
(defaults to current directory)
Options:
--json, -j Output results as JSON (for CI/CD pipelines)
--help, -h Show help
--version, -v Show version
# Validate a connector folder
ppcv ./MyConnector
# JSON output for CI/CD
ppcv ./MyConnector --json
# Validate current directory
ppcv
# Pipe JSON to jq
ppcv ./MyConnector -j | jq '.errors'
# Batch validate all connectors
for dir in */; do
if [ -f "$dir/apiDefinition.swagger.json" ]; then
ppcv "$dir" --json
fi
done- Required fields (
swagger,info,paths) - Swagger 2.0 version
- Host and basePath format
- Unique operationIds
- Response definitions on every operation
- Parameter completeness (name, in, type, required)
- Path parameters have
x-ms-url-encoding - Array schemas include
items - Security definitions have
type x-ms-connector-metadatapresence
- Required
properties.iconBrandColor(hex format) - Connection parameter types and OAuth
identityProvidervalues scriptOperationscross-checked against swagger operationIds- Valid
capabilitiesvalues
Per MS Learn: Write code in a custom connector:
- File size under 1 MB
- Class named
ScriptextendingScriptBase - Implements
ExecuteAsyncmethod - Only supported namespaces in
usingstatements - No
new HttpClient()(usethis.Context.SendAsync) - Fully qualified
Newtonsoft.Json.Formatting(avoids ambiguous references) - Balanced braces (catches truncated files)
{
"connector": "MyConnector",
"path": "/path/to/MyConnector",
"valid": true,
"operations": 12,
"errors": [],
"warnings": ["..."],
"files": {
"apiDefinition.swagger.json": { "valid": true, "errors": [], "warnings": [] },
"apiProperties.json": { "valid": true, "errors": [], "warnings": [] },
"script.csx": { "valid": true, "errors": [], "warnings": [] }
}
}- name: Validate connectors
run: |
npx ppcv ./MyConnector --json > result.json
if [ $(jq '.valid' result.json) = "false" ]; then
jq '.errors[]' result.json
exit 1
fiMIT