$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "oldSpec": "{\n \"openapi\": \"3.0.3\",\n \"info\": {\n \"title\": \"Order API\",\n \"version\": \"1.0\"\n },\n \"paths\": {\n \"/orders/{id}\": {\n \"parameters\": [\n {\n \"name\": \"id\",\n \"in\": \"path\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"get\": {\n \"responses\": {\n \"200\": {\n \"description\": \"OK\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"required\": [\n \"id\",\n \"status\"\n ],\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"open\",\n \"paid\"\n ]\n }\n }\n }\n }\n }\n }\n }\n },\n \"post\": {\n \"requestBody\": {\n \"required\": true,\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"required\": [\n \"status\"\n ],\n \"properties\": {\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"open\",\n \"paid\"\n ]\n }\n }\n }\n }\n }\n },\n \"responses\": {\n \"204\": {\n \"description\": \"Updated\"\n }\n }\n }\n }\n }\n}",
< "newSpec": "{\n \"openapi\": \"3.0.3\",\n \"info\": {\n \"title\": \"Order API\",\n \"version\": \"2.0\"\n },\n \"paths\": {\n \"/orders/{id}\": {\n \"parameters\": [\n {\n \"name\": \"id\",\n \"in\": \"path\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"get\": {\n \"responses\": {\n \"200\": {\n \"description\": \"OK\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"required\": [\n \"id\",\n \"status\"\n ],\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"open\",\n \"paid\",\n \"refunded\"\n ]\n }\n }\n }\n }\n }\n }\n },\n \"parameters\": [\n {\n \"name\": \"X-Tenant\",\n \"in\": \"header\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ]\n },\n \"post\": {\n \"requestBody\": {\n \"required\": true,\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"required\": [\n \"status\"\n ],\n \"properties\": {\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"open\"\n ]\n }\n }\n }\n }\n }\n },\n \"responses\": {\n \"202\": {\n \"description\": \"Queued\"\n }\n }\n }\n },\n \"/health\": {\n \"get\": {\n \"responses\": {\n \"200\": {\n \"description\": \"Healthy\"\n }\n }\n }\n }\n }\n}",
< "severityFilter": [
< "high",
< "warning",
< "info"
< ]
<}
<EOF
$curl "https://api.apify.com/v2/actors/afkdigital~openapi-breaking-change-detector/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'