[ { "name": "repo/valid", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "repo/id/\"\"", "kind": "repo", "body": { "repoId": "", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_repoId", "status": 400 } }, { "name": "repo/id/\"ab\"", "kind": "repo", "body": { "repoId": "ab", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_repoId", "status": 400 } }, { "name": "repo/id/\"bad/name\"", "kind": "repo", "body": { "repoId": "bad/name", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_repoId", "status": 400 } }, { "name": "repo/id/\"a b\"", "kind": "repo", "body": { "repoId": "a b", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_repoId", "status": 400 } }, { "name": "repo/id/\"ééé\"", "kind": "repo", "body": { "repoId": "ééé", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_repoId", "status": 400 } }, { "name": "repo/id/\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"", "kind": "repo", "body": { "repoId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "repo/source/branch/null", "kind": "repo", "body": { "repoId": "example", "source": { "branch": null, "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "branch_not_specified", "status": 400 } }, { "name": "repo/source/branch/\"\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "branch_not_specified", "status": 400 } }, { "name": "repo/source/branch/false", "kind": "repo", "body": { "repoId": "example", "source": { "branch": false, "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "branch_not_specified", "status": 400 } }, { "name": "repo/source/branch/0", "kind": "repo", "body": { "repoId": "example", "source": { "branch": 0, "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "branch_not_specified", "status": 400 } }, { "name": "repo/source/commit/null", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": null, "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "commit_not_specified", "status": 400 } }, { "name": "repo/source/commit/\"\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "commit_not_specified", "status": 400 } }, { "name": "repo/source/commit/false", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": false, "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "commit_not_specified", "status": 400 } }, { "name": "repo/source/commit/0", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": 0, "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "commit_not_specified", "status": 400 } }, { "name": "repo/options/null", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": null, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "repo/options/false", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": false, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "repo/options/\"\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": "", "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "repo/options/0", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": 0, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "repo/terms/null", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": null }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "repo/terms/\"terms\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": "terms" }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "repo/terms/{}", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": {} }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "repo/terms/42", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": 42 }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "repo/precedence/source-options-terms", "kind": "repo", "body": { "repoId": "example", "source": {}, "options": null, "terms": null }, "expected": { "code": "branch_not_specified", "status": 400 } }, { "name": "repo/precedence/options-terms", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": null, "terms": null }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "repo/missing-source", "kind": "repo", "body": { "repoId": "example", "options": {}, "terms": [] }, "expected": { "code": "source_not_provided", "status": 400 } }, { "name": "repo/commit/\"xyz\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "xyz", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_commit_format", "status": 400 } }, { "name": "repo/commit/\"a-b\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "a-b", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_commit_format", "status": 400 } }, { "name": "repo/commit/\"abc\\n\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "abc\n", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_commit_format", "status": 400 } }, { "name": "repo/commit/\"123\"", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "repo/precedence/terms-commit", "kind": "repo", "body": { "repoId": "example", "source": { "branch": "main", "commit": "xyz", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": null }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "gist/valid", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "gist/id/\"\"", "kind": "gist", "body": { "gistId": "", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_gistId", "status": 400 } }, { "name": "gist/id/\"ab\"", "kind": "gist", "body": { "gistId": "ab", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_gistId", "status": 400 } }, { "name": "gist/id/\"bad/name\"", "kind": "gist", "body": { "gistId": "bad/name", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_gistId", "status": 400 } }, { "name": "gist/id/\"a b\"", "kind": "gist", "body": { "gistId": "a b", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_gistId", "status": 400 } }, { "name": "gist/id/\"ééé\"", "kind": "gist", "body": { "gistId": "ééé", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_gistId", "status": 400 } }, { "name": "gist/id/\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"", "kind": "gist", "body": { "gistId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "gist/source/gistId/null", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": null, "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "gistId_not_specified", "status": 400 } }, { "name": "gist/source/gistId/\"\"", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "gistId_not_specified", "status": 400 } }, { "name": "gist/source/gistId/false", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": false, "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "gistId_not_specified", "status": 400 } }, { "name": "gist/source/gistId/0", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": 0, "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "gistId_not_specified", "status": 400 } }, { "name": "gist/options/null", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": null, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "gist/options/false", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": false, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "gist/options/\"\"", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": "", "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "gist/options/0", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": 0, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "gist/terms/null", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": null }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "gist/terms/\"terms\"", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": "terms" }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "gist/terms/{}", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": {} }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "gist/terms/42", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": 42 }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "gist/precedence/source-options-terms", "kind": "gist", "body": { "gistId": "example", "source": {}, "options": null, "terms": null }, "expected": { "code": "gistId_not_specified", "status": 400 } }, { "name": "gist/precedence/options-terms", "kind": "gist", "body": { "gistId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": null, "terms": null }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "gist/missing-source", "kind": "gist", "body": { "gistId": "example", "options": {}, "terms": [] }, "expected": { "code": "gistId_not_specified", "status": 400 } }, { "name": "pr/valid", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/id/\"\"", "kind": "pr", "body": { "pullRequestId": "", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_pullRequestId", "status": 400 } }, { "name": "pr/id/\"ab\"", "kind": "pr", "body": { "pullRequestId": "ab", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_pullRequestId", "status": 400 } }, { "name": "pr/id/\"bad/name\"", "kind": "pr", "body": { "pullRequestId": "bad/name", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_pullRequestId", "status": 400 } }, { "name": "pr/id/\"a b\"", "kind": "pr", "body": { "pullRequestId": "a b", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_pullRequestId", "status": 400 } }, { "name": "pr/id/\"ééé\"", "kind": "pr", "body": { "pullRequestId": "ééé", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "invalid_pullRequestId", "status": 400 } }, { "name": "pr/id/\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"", "kind": "pr", "body": { "pullRequestId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/source/repositoryFullName/null", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": null, "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "repository_not_specified", "status": 400 } }, { "name": "pr/source/repositoryFullName/\"\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "", "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "repository_not_specified", "status": 400 } }, { "name": "pr/source/repositoryFullName/false", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": false, "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "repository_not_specified", "status": 400 } }, { "name": "pr/source/repositoryFullName/0", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": 0, "pullRequestId": 42 }, "options": {}, "terms": [] }, "expected": { "code": "repository_not_specified", "status": 400 } }, { "name": "pr/source/pullRequestId/null", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": null }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_not_specified", "status": 400 } }, { "name": "pr/source/pullRequestId/\"\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": "" }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_not_specified", "status": 400 } }, { "name": "pr/source/pullRequestId/false", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": false }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_not_specified", "status": 400 } }, { "name": "pr/source/pullRequestId/0", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 0 }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_not_specified", "status": 400 } }, { "name": "pr/options/null", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": null, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "pr/options/false", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": false, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "pr/options/\"\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": "", "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "pr/options/0", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": 0, "terms": [] }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "pr/terms/null", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": null }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "pr/terms/\"terms\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": "terms" }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "pr/terms/{}", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": {} }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "pr/terms/42", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": {}, "terms": 42 }, "expected": { "code": "invalid_terms_format", "status": 400 } }, { "name": "pr/precedence/source-options-terms", "kind": "pr", "body": { "pullRequestId": "example", "source": {}, "options": null, "terms": null }, "expected": { "code": "repository_not_specified", "status": 400 } }, { "name": "pr/precedence/options-terms", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 42 }, "options": null, "terms": null }, "expected": { "code": "options_not_provided", "status": 400 } }, { "name": "pr/number/1.5", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 1.5 }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_is_not_a_number", "status": 400 } }, { "name": "pr/number/100000000000000000000", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 100000000000000000000 }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/number/1e+21", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": 1e+21 }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_is_not_a_number", "status": 400 } }, { "name": "pr/number/-1e+21", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": -1e+21 }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_is_not_a_number", "status": 400 } }, { "name": "pr/number/\"1.0\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": "1.0" }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/number/\"1e3\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": "1e3" }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_is_not_a_number", "status": 400 } }, { "name": "pr/number/\" 42 \"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": " 42 " }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/number/\"42abc\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": "42abc" }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_is_not_a_number", "status": 400 } }, { "name": "pr/number/\"0x10\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": "0x10" }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/number/true", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": true }, "options": {}, "terms": [] }, "expected": { "code": "pullRequestId_is_not_a_number", "status": 400 } }, { "name": "pr/number/\"0\"", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": "0" }, "options": {}, "terms": [] }, "expected": null }, { "name": "pr/number/-1", "kind": "pr", "body": { "pullRequestId": "example", "source": { "branch": "main", "commit": "abc123", "gistId": "snippet", "repositoryFullName": "owner/repo", "pullRequestId": -1 }, "options": {}, "terms": [] }, "expected": null } ]