#2579 feat: add OpenAPI specification endpoint and related handlers#2583
#2579 feat: add OpenAPI specification endpoint and related handlers#2583
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements OpenAPI specification generation for the ArcadeDB HTTP API by adding a new endpoint at /api/v1/openapi.json that serves a comprehensive OpenAPI 3.0+ specification. The implementation includes proper authentication, caching for performance, and extensive integration tests.
- Adds OpenAPI endpoint implementation with caching and authentication requirements
- Includes comprehensive integration tests that validate the endpoint functionality and spec format
- Adds necessary Swagger/OpenAPI dependencies for spec generation and validation
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| OpenApiSpecGenerationIT.java | Comprehensive integration test suite validating OpenAPI endpoint accessibility, spec format, endpoint coverage, and security |
| OpenApiSpecGenerator.java | Core generator class that creates the complete OpenAPI specification with all endpoints, schemas, and security definitions |
| OpenApiHandler.java | Alias class extending GetOpenApiHandler for backward compatibility with test expectations |
| GetOpenApiHandler.java | HTTP handler serving the OpenAPI spec at /api/v1/openapi.json with caching and authentication |
| HttpServer.java | Registers the new OpenAPI endpoint in the server routes |
| pom.xml | Adds required Swagger and OpenAPI dependencies for spec generation and testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/src/main/java/com/arcadedb/server/http/handler/OpenApiSpecGenerator.java
Outdated
Show resolved
Hide resolved
d1c3c17 to
22bf435
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
|
Impressive! |
c10a8b5 to
76d328c
Compare
… server initialization
76d328c to
b45ceaa
Compare
This pull request adds initial support for serving an OpenAPI 3.0+ specification for the ArcadeDB HTTP API. It introduces a new endpoint at
/api/v1/openapi.jsonthat provides a machine-readable API spec, adds necessary dependencies, and includes integration tests to validate the endpoint and its output. The changes lay the groundwork for future improvements in API documentation and client generation.OpenAPI Endpoint Implementation:
GetOpenApiHandlerto serve the OpenAPI specification at/api/v1/openapi.json, including caching for performance and requiring authentication for access. (server/src/main/java/com/arcadedb/server/http/handler/GetOpenApiHandler.java)server/src/main/java/com/arcadedb/server/http/HttpServer.java)Dependency Management:
pom.xmlto support spec generation and validation. (server/pom.xml)Testing and Validation:
OpenApiSpecGenerationIT) that verifies the endpoint is accessible, returns valid OpenAPI 3.0+ JSON, documents all expected endpoints, includes request/response models, and provides security information. (server/src/test/java/com/arcadedb/server/http/OpenApiSpecGenerationIT.java)Backward Compatibility:
OpenApiHandleras an alias forGetOpenApiHandlerto match test expectations and maintain naming consistency. (server/src/main/java/com/arcadedb/server/http/handler/OpenApiHandler.java)Internal Imports:
HttpServer.javato include the new handler. (server/src/main/java/com/arcadedb/server/http/HttpServer.java)