Skip to content

Commit cfcd6b5

Browse files
committed
Ondemand report input schema format
1 parent 33a7f28 commit cfcd6b5

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-0
lines changed

docs/guides/ondemand-reports.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: On-demand Reports
3+
sidebar_label: On-demand Reports (Beta)
4+
description:
5+
CodeRabbit offers a way to generate on-demand reports using a simple API request
6+
sidebar_position: 5
7+
---
8+
9+
```mdx-code-block
10+
import ReportSchema from "@site/src/components/ReportSchema";
11+
```
12+
13+
:::info
14+
15+
This feature is in beta
16+
17+
:::
18+
19+
CodeRabbit offers a way to generate on-demand reports using the [API](https://api.coderabbit.ai/api/swagger/).
20+
You will be able to use the API by creating an [API key](https://app.coderabbit.ai/settings/api-keys).
21+
22+
23+
On-demand report input schema:
24+
25+
```mdx-code-block
26+
<ReportSchema />
27+
```
28+
29+
[API Reference](https://api.coderabbit.ai/api/swagger/)

src/components/ReportSchema.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Schema from "@site/static/schema/reporting.json";
2+
import JSONSchemaViewer from "@theme/JSONSchemaViewer";
3+
4+
export default function Viewer(): JSX.Element {
5+
return <JSONSchemaViewer schema={Schema} />;
6+
}

static/schema/reporting.json

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"scheduleRange": {
5+
"type": "string",
6+
"enum": [
7+
"Dates"
8+
]
9+
},
10+
"from": {
11+
"type": "string",
12+
"format": "date"
13+
},
14+
"to": {
15+
"type": "string",
16+
"format": "date"
17+
},
18+
"prompt": {
19+
"type": "string"
20+
},
21+
"promptTemplate": {
22+
"type": "string",
23+
"enum": [
24+
"Daily Standup Report",
25+
"Sprint Report",
26+
"Release Notes",
27+
"Custom"
28+
]
29+
},
30+
"parameters": {
31+
"type": "array",
32+
"items": {
33+
"type": "object",
34+
"properties": {
35+
"parameter": {
36+
"type": "string",
37+
"enum": [
38+
"REPOSITORY",
39+
"LABEL",
40+
"TEAM",
41+
"USER"
42+
]
43+
},
44+
"operator": {
45+
"type": "string",
46+
"enum": [
47+
"IN",
48+
"ALL"
49+
]
50+
},
51+
"values": {
52+
"type": "array",
53+
"items": {
54+
"type": "string"
55+
}
56+
}
57+
},
58+
"required": [
59+
"parameter",
60+
"operator",
61+
"values"
62+
],
63+
"additionalProperties": false
64+
}
65+
},
66+
"groupBy": {
67+
"type": "string",
68+
"enum": [
69+
"NONE",
70+
"REPOSITORY",
71+
"LABEL",
72+
"TEAM",
73+
"USER"
74+
]
75+
},
76+
"subgroupBy": {
77+
"type": "string",
78+
"enum": [
79+
"NONE",
80+
"REPOSITORY",
81+
"LABEL",
82+
"TEAM",
83+
"USER"
84+
]
85+
}
86+
},
87+
"required": [
88+
"from",
89+
"to"
90+
],
91+
"additionalProperties": false,
92+
"$schema": "http://json-schema.org/draft-07/schema#"
93+
}

0 commit comments

Comments
 (0)