Skip to content

Commit 1e0d075

Browse files
committed
fix(docs): correct API endpoint URLs to /api/v1 prefix
- All API endpoints now correctly show /api/v1 prefix - Fixed impact endpoint: POST not GET, takes JSON body not query params - Fixed style endpoint: /style-analysis not /style - Updated all curl examples with correct URLs
1 parent 277321e commit 1e0d075

4 files changed

Lines changed: 39 additions & 46 deletions

File tree

frontend/src/pages/api/APIAnalysisPage.tsx

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function APIAnalysisPage() {
3333
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
3434
GET
3535
</span>
36-
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/dependencies</code>
36+
<code className="text-sm text-gray-300">/api/v1/repos/{'{repo_id}'}/dependencies</code>
3737
</div>
3838

3939
<p className="text-gray-300 mb-4">
@@ -73,44 +73,30 @@ export function APIAnalysisPage() {
7373
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
7474
<DocsCodeBlock language="bash">
7575
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
76-
http://localhost:8000/api/repos/repo_abc123/dependencies`}
76+
http://localhost:8000/api/v1/repos/repo_abc123/dependencies`}
7777
</DocsCodeBlock>
7878

7979
{/* Impact Analysis */}
8080
<h2 id="impact" className="text-2xl font-semibold text-white mt-12 mb-4">Impact Analysis</h2>
8181

8282
<div className="flex items-center gap-3 p-3 bg-white/[0.02] border border-white/10 rounded-lg mb-4">
83-
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
84-
GET
83+
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-blue-400 bg-blue-500/10">
84+
POST
8585
</span>
86-
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/impact</code>
86+
<code className="text-sm text-gray-300">/api/v1/repos/{'{repo_id}'}/impact</code>
8787
</div>
8888

8989
<p className="text-gray-300 mb-4">
9090
Analyze the impact of changing a specific file.
9191
</p>
9292

93-
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Query Parameters</h4>
94-
<div className="overflow-x-auto mb-4">
95-
<table className="w-full text-sm">
96-
<thead>
97-
<tr className="border-b border-white/10">
98-
<th className="text-left py-2 text-gray-400 font-medium">Parameter</th>
99-
<th className="text-left py-2 text-gray-400 font-medium">Type</th>
100-
<th className="text-left py-2 text-gray-400 font-medium">Required</th>
101-
<th className="text-left py-2 text-gray-400 font-medium">Description</th>
102-
</tr>
103-
</thead>
104-
<tbody className="text-gray-300">
105-
<tr>
106-
<td className="py-2 font-mono text-blue-400">file</td>
107-
<td className="py-2 font-mono text-xs">string</td>
108-
<td className="py-2"><span className="text-amber-400">Yes</span></td>
109-
<td className="py-2">Path to the file to analyze</td>
110-
</tr>
111-
</tbody>
112-
</table>
113-
</div>
93+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Request Body</h4>
94+
<DocsCodeBlock language="json">
95+
{`{
96+
"repo_id": "repo_abc123",
97+
"file_path": "src/auth/middleware.py"
98+
}`}
99+
</DocsCodeBlock>
114100

115101
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Response</h4>
116102
<DocsCodeBlock language="json">
@@ -141,8 +127,11 @@ export function APIAnalysisPage() {
141127

142128
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
143129
<DocsCodeBlock language="bash">
144-
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
145-
"http://localhost:8000/api/repos/repo_abc123/impact?file=src/auth/middleware.py"`}
130+
{`curl -X POST \\
131+
-H "Authorization: Bearer YOUR_API_KEY" \\
132+
-H "Content-Type: application/json" \\
133+
-d '{"repo_id": "repo_abc123", "file_path": "src/auth/middleware.py"}' \\
134+
http://localhost:8000/api/v1/repos/repo_abc123/impact`}
146135
</DocsCodeBlock>
147136

148137
{/* Code Style */}
@@ -152,7 +141,7 @@ export function APIAnalysisPage() {
152141
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
153142
GET
154143
</span>
155-
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/style</code>
144+
<code className="text-sm text-gray-300">/api/v1/repos/{'{repo_id}'}/style-analysis</code>
156145
</div>
157146

158147
<p className="text-gray-300 mb-4">
@@ -191,7 +180,7 @@ export function APIAnalysisPage() {
191180
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
192181
GET
193182
</span>
194-
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/insights</code>
183+
<code className="text-sm text-gray-300">/api/v1/repos/{'{repo_id}'}/insights</code>
195184
</div>
196185

197186
<p className="text-gray-300 mb-4">
@@ -229,7 +218,7 @@ export function APIAnalysisPage() {
229218
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
230219
<DocsCodeBlock language="bash">
231220
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
232-
http://localhost:8000/api/repos/repo_abc123/insights`}
221+
http://localhost:8000/api/v1/repos/repo_abc123/insights`}
233222
</DocsCodeBlock>
234223

235224
<DocsPagination

frontend/src/pages/api/APIOverviewPage.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ export function APIOverviewPage() {
4242

4343
<DocsCodeBlock language="text">
4444
{`# Local development
45-
http://localhost:8000/api
45+
http://localhost:8000/api/v1
4646
4747
# Hosted version
48-
https://api.opencodeintel.com/api`}
48+
https://api.opencodeintel.com/api/v1`}
4949
</DocsCodeBlock>
5050

51+
<p className="text-gray-300 mt-4 mb-4">
52+
The API is versioned. Current version is <code className="px-1.5 py-0.5 bg-white/10 rounded text-sm">v1</code>.
53+
</p>
54+
5155
<h2 id="authentication" className="text-2xl font-semibold text-white mt-12 mb-4">Authentication</h2>
5256

5357
<p className="text-gray-300 mb-4">
@@ -56,7 +60,7 @@ https://api.opencodeintel.com/api`}
5660

5761
<DocsCodeBlock language="bash">
5862
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
59-
http://localhost:8000/api/repos`}
63+
http://localhost:8000/api/v1/repos`}
6064
</DocsCodeBlock>
6165

6266
<p className="text-gray-300 mt-4 mb-4">
@@ -91,14 +95,14 @@ https://api.opencodeintel.com/api`}
9195
href="/docs/api/analysis"
9296
/>
9397
<EndpointLink
94-
method="GET"
98+
method="POST"
9599
path="/repos/{id}/impact"
96100
description="Analyze change impact"
97101
href="/docs/api/analysis"
98102
/>
99103
<EndpointLink
100104
method="GET"
101-
path="/repos/{id}/style"
105+
path="/repos/{id}/style-analysis"
102106
description="Analyze code style"
103107
href="/docs/api/analysis"
104108
/>

frontend/src/pages/api/APIRepositoriesPage.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function APIRepositoriesPage() {
2929

3030
{/* List Repositories */}
3131
<h2 id="list" className="text-2xl font-semibold text-white mt-12 mb-4">List Repositories</h2>
32-
<EndpointHeader method="GET" path="/api/repos" />
32+
<EndpointHeader method="GET" path="/api/v1/repos" />
3333

3434
<p className="text-gray-300 mb-4">Returns all repositories accessible to your account.</p>
3535

@@ -54,12 +54,12 @@ export function APIRepositoriesPage() {
5454
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
5555
<DocsCodeBlock language="bash">
5656
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
57-
http://localhost:8000/api/repos`}
57+
http://localhost:8000/api/v1/repos`}
5858
</DocsCodeBlock>
5959

6060
{/* Get Repository */}
6161
<h2 id="get" className="text-2xl font-semibold text-white mt-12 mb-4">Get Repository</h2>
62-
<EndpointHeader method="GET" path="/api/repos/{repo_id}" />
62+
<EndpointHeader method="GET" path="/api/v1/repos/{repo_id}" />
6363

6464
<p className="text-gray-300 mb-4">Get details for a specific repository.</p>
6565

@@ -89,7 +89,7 @@ export function APIRepositoriesPage() {
8989

9090
{/* Add Repository */}
9191
<h2 id="create" className="text-2xl font-semibold text-white mt-12 mb-4">Add Repository</h2>
92-
<EndpointHeader method="POST" path="/api/repos" />
92+
<EndpointHeader method="POST" path="/api/v1/repos" />
9393

9494
<p className="text-gray-300 mb-4">Add a new repository for indexing.</p>
9595

@@ -117,12 +117,12 @@ export function APIRepositoriesPage() {
117117
-H "Authorization: Bearer YOUR_API_KEY" \\
118118
-H "Content-Type: application/json" \\
119119
-d '{"url": "https://github.com/user/my-project"}' \\
120-
http://localhost:8000/api/repos`}
120+
http://localhost:8000/api/v1/repos`}
121121
</DocsCodeBlock>
122122

123123
{/* Delete Repository */}
124124
<h2 id="delete" className="text-2xl font-semibold text-white mt-12 mb-4">Delete Repository</h2>
125-
<EndpointHeader method="DELETE" path="/api/repos/{repo_id}" />
125+
<EndpointHeader method="DELETE" path="/api/v1/repos/{repo_id}" />
126126

127127
<p className="text-gray-300 mb-4">Remove a repository and all its indexed data.</p>
128128

@@ -140,7 +140,7 @@ export function APIRepositoriesPage() {
140140

141141
{/* Reindex Repository */}
142142
<h2 id="reindex" className="text-2xl font-semibold text-white mt-12 mb-4">Reindex Repository</h2>
143-
<EndpointHeader method="POST" path="/api/repos/{repo_id}/reindex" />
143+
<EndpointHeader method="POST" path="/api/v1/repos/{repo_id}/reindex" />
144144

145145
<p className="text-gray-300 mb-4">Trigger a fresh index of the repository. Use after major code changes.</p>
146146

frontend/src/pages/api/APISearchPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function APISearchPage() {
3333
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-blue-400 bg-blue-500/10">
3434
POST
3535
</span>
36-
<code className="text-sm text-gray-300">/api/search</code>
36+
<code className="text-sm text-gray-300">/api/v1/search</code>
3737
</div>
3838

3939
<p className="text-gray-300 mb-4">
@@ -163,7 +163,7 @@ export function APISearchPage() {
163163
-H "Authorization: Bearer YOUR_API_KEY" \\
164164
-H "Content-Type: application/json" \\
165165
-d '{"query": "error handling", "repo_id": "repo_abc123"}' \\
166-
http://localhost:8000/api/search`}
166+
http://localhost:8000/api/v1/search`}
167167
</DocsCodeBlock>
168168

169169
<h3 className="text-lg font-medium text-white mt-8 mb-3">Search with Filters</h3>
@@ -178,7 +178,7 @@ export function APISearchPage() {
178178
"min_score": 0.7,
179179
"file_filter": "**/*.py"
180180
}' \\
181-
http://localhost:8000/api/search`}
181+
http://localhost:8000/api/v1/search`}
182182
</DocsCodeBlock>
183183

184184
<DocsCallout type="tip">

0 commit comments

Comments
 (0)