Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ follows [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Fixed (OpenAPI groups — `bugfix/149-openapi-groups`, #149)
- Swagger UI now has groups for `codebase` (code copilot and GitHub), `gateway` (Jira integrations), `overview` and `search`; before, only workspace, discovery, iam and billing were documented, so those endpoints were missing from `/swagger-ui.html` and `/api-docs/*`.

### Fixed (AI allowance gaps — `feature/141-quota-gaps`, #141)
- Uploading a recording (`POST /api/sessions/{id}/upload`), processing a session into stories (`POST /api/sessions/{id}/process`) and verifying a suggestion against the code (`POST /api/projects/{id}/suggestions/{id}/verify-code`) now check the monthly AI allowance first and answer `402 AI_QUOTA_EXCEEDED` when it is spent, before touching the session (it keeps its status). Recording live, transcribing, sharing, exporting and reading are not affected.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,38 @@ public GroupedOpenApi billingApi() {
.build();
}

@Bean
public GroupedOpenApi codebaseApi() {
return GroupedOpenApi.builder()
.group("codebase")
.packagesToScan("com.kntro.reqsai.codebase.interfaces")
.build();
}

@Bean
public GroupedOpenApi gatewayApi() {
return GroupedOpenApi.builder()
.group("gateway")
.packagesToScan("com.kntro.reqsai.gateway.interfaces")
.build();
}

@Bean
public GroupedOpenApi overviewApi() {
return GroupedOpenApi.builder()
.group("overview")
.packagesToScan("com.kntro.reqsai.overview.interfaces")
.build();
}

@Bean
public GroupedOpenApi searchApi() {
return GroupedOpenApi.builder()
.group("search")
.packagesToScan("com.kntro.reqsai.search.interfaces")
.build();
}

@Bean
@Profile("dev")
public GroupedOpenApi devToolsApi() {
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/com/kntro/reqsai/SmokeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ void servesOwnOpenApiDocument() {
assertThat(res.getBody()).contains("Reqs-AI");
}

@Test
void documentsEveryModuleWithControllers() {
ResponseEntity<String> config = get("/api-docs/swagger-config");
assertThat(config.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(config.getBody()).contains("workspace", "discovery", "iam", "billing",
"codebase", "gateway", "overview", "search");
assertThat(get("/api-docs/codebase").getBody()).contains("/code");
assertThat(get("/api-docs/gateway").getBody()).contains("/integrations");
}

@Test
void protectedActuatorEndpointRequiresAuth() {
// metrics is exposed but must be secured (only health/** is public).
Expand Down
Loading