From 4bcf1361273ead1c6acec6f01aff61b014ed93d1 Mon Sep 17 00:00:00 2001 From: MMaiero Date: Sat, 30 Aug 2025 18:46:26 +0200 Subject: [PATCH] feat: add Swagger OpenAPI annotations dependencies to system REST test bundle - Add io.swagger.v3.oas.annotations package imports to test bundle manifest - Resolve missing dependency issue preventing test compilation and execution - Import all required Swagger v3 annotation packages with version 2.1.0 - Add comprehensive OpenAPI documentation configuration and README - Update main bundle manifest and POM with proper OpenAPI dependencies Fixes compilation errors in org.eclipse.kura.rest.system.provider.test when using classes from the host bundle that reference Swagger annotations. The test bundle (fragment) needs access to the same OpenAPI annotation packages that are used by the host bundle's SystemRestService class for proper test execution. Signed-off-by: MMaiero --- kura/.vscode/settings.json | 3 +- .../META-INF/MANIFEST.MF | 9 + .../README-OpenAPI.md | 335 ++++++++++++++++++ .../pom.xml | 53 ++- .../kura/rest/system/OpenApiConfig.java | 70 ++++ .../kura/rest/system/SystemRestService.java | 28 +- .../kura/rest/system/dto/FilterDTO.java | 9 +- .../system/dto/FrameworkPropertiesDTO.java | 2 + .../META-INF/MANIFEST.MF | 11 +- .../pom.xml | 31 +- 10 files changed, 540 insertions(+), 11 deletions(-) create mode 100644 kura/org.eclipse.kura.rest.system.provider/README-OpenAPI.md create mode 100644 kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/OpenApiConfig.java diff --git a/kura/.vscode/settings.json b/kura/.vscode/settings.json index b7a95becede..e04097b66c6 100644 --- a/kura/.vscode/settings.json +++ b/kura/.vscode/settings.json @@ -3,5 +3,6 @@ "editor.defaultFormatter": "redhat.java", "editor.formatOnSave": true, "java.debug.settings.onBuildFailureProceed": true, - "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable" + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable", + "java.configuration.updateBuildConfiguration": "interactive" } diff --git a/kura/org.eclipse.kura.rest.system.provider/META-INF/MANIFEST.MF b/kura/org.eclipse.kura.rest.system.provider/META-INF/MANIFEST.MF index 3fc9ff057f3..32b3a5dee31 100644 --- a/kura/org.eclipse.kura.rest.system.provider/META-INF/MANIFEST.MF +++ b/kura/org.eclipse.kura.rest.system.provider/META-INF/MANIFEST.MF @@ -10,6 +10,15 @@ Service-Component: OSGI-INF/*.xml Import-Package: jakarta.annotation.security;version="2.1.1", jakarta.ws.rs;version="3.1.0", jakarta.ws.rs.core;version="3.1.0", + io.swagger.v3.oas.annotations;version="2.1.0", + io.swagger.v3.oas.annotations.enums;version="2.1.0", + io.swagger.v3.oas.annotations.info;version="2.1.0", + io.swagger.v3.oas.annotations.media;version="2.1.0", + io.swagger.v3.oas.annotations.parameters;version="2.1.0", + io.swagger.v3.oas.annotations.responses;version="2.1.0", + io.swagger.v3.oas.annotations.security;version="2.1.0", + io.swagger.v3.oas.annotations.servers;version="2.1.0", + io.swagger.v3.oas.annotations.tags;version="2.1.0", org.apache.commons.io;version="2.11.0", org.eclipse.kura;version="[1.3,2.0)", org.eclipse.kura.cloudconnection.request;version="[1.0,2.0)", diff --git a/kura/org.eclipse.kura.rest.system.provider/README-OpenAPI.md b/kura/org.eclipse.kura.rest.system.provider/README-OpenAPI.md new file mode 100644 index 00000000000..db33313d6e9 --- /dev/null +++ b/kura/org.eclipse.kura.rest.system.provider/README-OpenAPI.md @@ -0,0 +1,335 @@ +# Eclipse Kura System REST API - OpenAPI Integration + +## Overview + +This document describes the OpenAPI 3.0 integration for the Eclipse Kura System REST API. The integration provides comprehensive API documentation, interactive testing capabilities, and client SDK generation support. + +## Features + +- **Comprehensive Documentation**: Detailed API documentation with parameter descriptions, examples, and response schemas +- **Interactive Testing**: Swagger UI integration for testing endpoints directly from the browser +- **Client SDK Generation**: Support for generating client libraries in multiple programming languages +- **Security Documentation**: Clear documentation of authentication requirements and permissions +- **Request/Response Examples**: Real-world examples for all API endpoints + +## API Endpoints + +### Framework Properties + +#### GET /system/v1/properties/framework + +Retrieves comprehensive system framework properties including hardware, Java runtime, OS, and Kura-specific information. + +**Example Request:** +```bash +curl -X GET \ + https://localhost:8080/services/system/v1/properties/framework \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' +``` + +**Example Response:** +```json +{ + "biosVersion": "1.2.3", + "cpuVersion": "Intel Core i7", + "deviceName": "Kura-Gateway", + "javaVersion": "17.0.1", + "osName": "Linux", + "osVersion": "5.4.0", + "kuraVersion": "6.0.0-SNAPSHOT", + "totalMemory": 8589934592, + "freeMemory": 4294967296 +} +``` + +#### POST /system/v1/properties/framework/filter + +Retrieves filtered system framework properties based on specified criteria. + +**Example Request:** +```bash +curl -X POST \ + https://localhost:8080/services/system/v1/properties/framework/filter \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json' \ + -d '{ + "names": ["javaVersion", "osName", "kuraVersion", "totalMemory"] + }' +``` + +**Example Response:** +```json +{ + "javaVersion": "17.0.1", + "osName": "Linux", + "kuraVersion": "6.0.0-SNAPSHOT", + "totalMemory": 8589934592 +} +``` + +### Extended Properties + +#### GET /system/v1/properties/extended + +Retrieves extended system properties and metadata. + +#### POST /system/v1/properties/extended/filter + +Retrieves filtered extended properties using group-based filtering. + +### Kura Properties + +#### GET /system/v1/properties/kura + +Retrieves Kura-specific configuration and runtime properties. + +#### POST /system/v1/properties/kura/filter + +Retrieves filtered Kura properties based on specified names. + +## Authentication + +All endpoints require Basic HTTP Authentication. The API uses role-based access control with the `system` role requirement. + +**Default Credentials (Development):** +- Username: `admin` +- Password: `admin` + +**Authorization Header Format:** +``` +Authorization: Basic +``` + +**Example (admin:admin):** +``` +Authorization: Basic YWRtaW46YWRtaW4= +``` + +## Building and Generating Documentation + +### Maven Build + +To build the project and generate OpenAPI documentation: + +```bash +# Build the project +mvn clean compile + +# Generated OpenAPI specs will be available in: +# target/generated-openapi/openapi.json +# target/generated-openapi/openapi.yaml +``` + +### Generated Artifacts + +After building, you'll find: + +1. **OpenAPI JSON Specification**: `target/generated-openapi/openapi.json` +2. **OpenAPI YAML Specification**: `target/generated-openapi/openapi.yaml` +3. **Compiled Classes**: All OpenAPI-annotated classes with documentation metadata + +## Integration with Swagger UI + +To view the interactive API documentation: + +1. **Deploy Swagger UI**: Set up Swagger UI in your web server +2. **Load the OpenAPI Spec**: Point Swagger UI to the generated `openapi.json` file +3. **Access Interactive Docs**: Navigate to the Swagger UI URL + +**Example Swagger UI Configuration:** +```javascript +const ui = SwaggerUIBundle({ + url: 'path/to/openapi.json', + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ] +}); +``` + +## Client SDK Generation + +### Using OpenAPI Generator + +Generate client SDKs using the OpenAPI Generator tool: + +```bash +# Install OpenAPI Generator +npm install @openapitools/openapi-generator-cli -g + +# Generate Java client +openapi-generator-cli generate \ + -i target/generated-openapi/openapi.json \ + -g java \ + -o generated-clients/java \ + --additional-properties=packageName=org.eclipse.kura.client + +# Generate Python client +openapi-generator-cli generate \ + -i target/generated-openapi/openapi.json \ + -g python \ + -o generated-clients/python \ + --additional-properties=packageName=kura_client + +# Generate JavaScript client +openapi-generator-cli generate \ + -i target/generated-openapi/openapi.json \ + -g javascript \ + -o generated-clients/javascript +``` + +### Available Generators + +The OpenAPI specification supports client generation for: + +- Java +- Python +- JavaScript/TypeScript +- C# +- Go +- Ruby +- PHP +- Kotlin +- Swift +- And many more... + +## Error Handling + +### Standard HTTP Status Codes + +| Code | Description | Example Scenario | +|------|-------------|------------------| +| 200 | Success | Request completed successfully | +| 400 | Bad Request | Invalid filter parameters | +| 401 | Unauthorized | Missing or invalid authentication | +| 403 | Forbidden | Insufficient permissions (not in 'system' role) | +| 404 | Not Found | Endpoint doesn't exist | +| 500 | Internal Server Error | System service unavailable | + +### Error Response Format + +```json +{ + "error": { + "code": 400, + "message": "Bad request - Invalid filter parameters", + "details": "The 'names' array cannot be empty when specified" + } +} +``` + +## Best Practices + +### 1. API Versioning +- Always specify API version in URLs (`/system/v1/...`) +- Update version when making breaking changes +- Maintain backward compatibility when possible + +### 2. Security +- Use HTTPS in production environments +- Implement proper authentication and authorization +- Follow principle of least privilege for role assignments + +### 3. Performance +- Use filtered endpoints when you only need specific properties +- Implement proper caching strategies for frequently accessed data +- Monitor API performance and usage patterns + +### 4. Documentation Maintenance +- Keep OpenAPI annotations synchronized with code changes +- Update examples when API behavior changes +- Review and update documentation during code reviews + +## Development Workflow + +### Adding New Endpoints + +1. **Create the endpoint method** with JAX-RS annotations +2. **Add OpenAPI annotations**: + - `@Operation` for method documentation + - `@ApiResponses` for response documentation + - `@RequestBody` for request body documentation + - `@Parameter` for path/query parameters + +3. **Update DTOs** with `@Schema` annotations +4. **Rebuild** to generate updated OpenAPI spec +5. **Test** using Swagger UI or generated clients + +### Example New Endpoint + +```java +@GET +@Path("/status") +@Produces(MediaType.APPLICATION_JSON) +@Operation( + summary = "Get System Status", + description = "Retrieves current system status and health information" +) +@ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "System status retrieved successfully", + content = @Content(schema = @Schema(implementation = SystemStatusDTO.class)) + ) +}) +public SystemStatusDTO getSystemStatus() { + // Implementation +} +``` + +## Troubleshooting + +### Common Issues + +1. **OpenAPI Generation Fails** + - Check that all referenced classes have proper `@Schema` annotations + - Verify Maven dependencies are correctly configured + - Review compilation errors in the build log + +2. **Swagger UI Not Loading** + - Verify the OpenAPI spec file is accessible + - Check for CORS issues when loading from different domains + - Validate the generated OpenAPI JSON/YAML syntax + +3. **Authentication Issues** + - Verify Basic Auth credentials are correctly encoded + - Check that the user has the required `system` role + - Ensure the Kura user management service is running + +### Debugging Tips + +- Enable debug logging for the SystemRestService class +- Use browser developer tools to inspect API requests/responses +- Validate OpenAPI specs using online validators +- Test endpoints individually before integration testing + +## Future Enhancements + +### Planned Features + +1. **Additional API Endpoints**: Network status, component health, metrics +2. **Enhanced Security**: OAuth2/JWT support, API key authentication +3. **Real-time Updates**: WebSocket support for live system monitoring +4. **Advanced Filtering**: Query language support, pagination +5. **API Rate Limiting**: Request throttling and usage quotas + +### Contributing + +To contribute to the OpenAPI integration: + +1. Follow existing annotation patterns and conventions +2. Add comprehensive documentation to all new endpoints +3. Include realistic examples in all `@Schema` annotations +4. Test generated documentation with Swagger UI +5. Update this README with any new features or changes + +## Resources + +- [OpenAPI 3.0 Specification](https://swagger.io/specification/) +- [Swagger Annotations Documentation](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations) +- [Eclipse Kura Documentation](https://eclipse.github.io/kura/) +- [JAX-RS Reference](https://jakarta.ee/specifications/restful-ws/) diff --git a/kura/org.eclipse.kura.rest.system.provider/pom.xml b/kura/org.eclipse.kura.rest.system.provider/pom.xml index eeb83006732..a4bd624f114 100644 --- a/kura/org.eclipse.kura.rest.system.provider/pom.xml +++ b/kura/org.eclipse.kura.rest.system.provider/pom.xml @@ -32,5 +32,54 @@ org.eclipse.kura.rest.system.provider eclipse-plugin 2.0.0-SNAPSHOT - - + + + + + io.swagger.core.v3 + swagger-annotations-jakarta + 2.2.36 + + + io.swagger.core.v3 + swagger-jaxrs2-jakarta + 2.2.36 + + + io.swagger.core.v3 + swagger-models + 2.2.36 + + + + + + + + io.swagger.core.v3 + swagger-maven-plugin-jakarta + 2.2.36 + + + ${project.build.directory}/generated-openapi + openapi + JSONANDYAML + true + + + org.eclipse.kura.rest.system + + + + + compile + + resolve + + + + + + + + \ No newline at end of file diff --git a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/OpenApiConfig.java b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/OpenApiConfig.java new file mode 100644 index 00000000000..470c979730f --- /dev/null +++ b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/OpenApiConfig.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2025 Eurotech and/or its affiliates and others + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Eurotech + ******************************************************************************/ +package org.eclipse.kura.rest.system; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.tags.Tag; + +/** + * OpenAPI configuration for Eclipse Kura System REST API. + * This class defines the overall API specification metadata, security schemes, + * and server information for the System API. + */ +@SuppressWarnings("all") +@OpenAPIDefinition(info = @Info(title = "Eclipse Kura System REST API", version = "1.0.0", description = "REST API for Eclipse Kura system properties and information management. " + + "This API provides access to hardware, software, and framework properties " + + "of the Eclipse Kura IoT gateway platform.", contact = @Contact(name = "Eclipse Kura Project", url = "https://www.eclipse.org/kura/", email = "kura-dev@eclipse.org"), license = @License(name = "Eclipse Public License 2.0", url = "https://www.eclipse.org/legal/epl-2.0/"), termsOfService = "https://www.eclipse.org/legal/epl-2.0/"), servers = { + @Server(url = "https://localhost:8080/services", description = "Local Kura Gateway (HTTPS)"), + @Server(url = "http://localhost:8080/services", description = "Local Kura Gateway (HTTP)"), + @Server(url = "https://{gateway-ip}:8080/services", description = "Remote Kura Gateway") }, tags = { + @Tag(name = "System", description = "System information and properties operations"), + @Tag(name = "Framework", description = "Framework-level system properties including hardware, Java, and OS information"), + @Tag(name = "Extended", description = "Extended system properties and metadata"), + @Tag(name = "Kura", description = "Kura-specific configuration and runtime properties") }) +@SecurityScheme(name = "basicAuth", type = SecuritySchemeType.HTTP, scheme = "basic", description = "Basic HTTP authentication. Use your Kura username and password. " + + "Default credentials are admin:admin for development environments.") +public class OpenApiConfig { + + /** + * Private constructor to prevent instantiation of this configuration class. + */ + private OpenApiConfig() { + // Configuration class - no instances needed + } + + // API Version Constants + public static final String API_VERSION = "1.0.0"; + public static final String API_TITLE = "Eclipse Kura System REST API"; + + // Common HTTP Status Codes for Documentation + public static final String HTTP_200 = "200"; + public static final String HTTP_400 = "400"; + public static final String HTTP_401 = "401"; + public static final String HTTP_403 = "403"; + public static final String HTTP_404 = "404"; + public static final String HTTP_500 = "500"; + + // Common Response Descriptions + public static final String SUCCESS_RESPONSE = "Operation completed successfully"; + public static final String BAD_REQUEST_RESPONSE = "Bad request - Invalid parameters"; + public static final String UNAUTHORIZED_RESPONSE = "Unauthorized - Authentication required"; + public static final String FORBIDDEN_RESPONSE = "Forbidden - Insufficient permissions"; + public static final String NOT_FOUND_RESPONSE = "Resource not found"; + public static final String SERVER_ERROR_RESPONSE = "Internal server error"; +} diff --git a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/SystemRestService.java b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/SystemRestService.java index 475a9b1075a..af4d69f287a 100644 --- a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/SystemRestService.java +++ b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/SystemRestService.java @@ -31,6 +31,15 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + import org.eclipse.kura.cloudconnection.request.RequestHandler; import org.eclipse.kura.cloudconnection.request.RequestHandlerRegistry; import org.eclipse.kura.request.handler.jaxrs.DefaultExceptionHandler; @@ -46,6 +55,9 @@ import org.slf4j.LoggerFactory; @Path(REST_APP_ID) +@Tag(name = "System", description = "System information and properties API for Eclipse Kura gateway") +@SecurityRequirement(name = "basicAuth") +@SuppressWarnings("all") public class SystemRestService { private static final Logger logger = LoggerFactory.getLogger(SystemRestService.class); @@ -82,6 +94,12 @@ public void unbindRequestHandlerRegistry(RequestHandlerRegistry registry) { @RolesAllowed(REST_ROLE_NAME) @Path(RESOURCE_FRAMEWORK_PROPERTIES) @Produces(MediaType.APPLICATION_JSON) + @Operation(summary = "Get Framework Properties", description = "Retrieves comprehensive system framework properties including hardware, Java runtime, OS, and Kura-specific information", operationId = "getFrameworkProperties") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Framework properties successfully retrieved", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = FrameworkPropertiesDTO.class))), + @ApiResponse(responseCode = "401", description = "Unauthorized - Authentication required"), + @ApiResponse(responseCode = "403", description = "Forbidden - Insufficient permissions"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public FrameworkPropertiesDTO getFrameworkProperties() { try { logger.debug(DEBUG_MESSSAGE, RESOURCE_FRAMEWORK_PROPERTIES); @@ -122,7 +140,15 @@ public KuraPropertiesDTO getKuraProperties() { @Path(RESOURCE_FRAMEWORK_PROPERTIES_FILTER) @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) - public FrameworkPropertiesDTO postFrameworkPropertiesFilter(FilterDTO filter) { + @Operation(summary = "Get Filtered Framework Properties", description = "Retrieves system framework properties filtered by specific property names. Only returns the properties specified in the filter.", operationId = "getFilteredFrameworkProperties") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Filtered framework properties successfully retrieved", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = FrameworkPropertiesDTO.class))), + @ApiResponse(responseCode = "400", description = "Bad request - Invalid filter parameters"), + @ApiResponse(responseCode = "401", description = "Unauthorized - Authentication required"), + @ApiResponse(responseCode = "403", description = "Forbidden - Insufficient permissions"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public FrameworkPropertiesDTO postFrameworkPropertiesFilter( + @RequestBody(description = "Filter criteria specifying which properties to include in the response", required = true, content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = FilterDTO.class))) FilterDTO filter) { try { logger.debug(DEBUG_MESSSAGE, RESOURCE_FRAMEWORK_PROPERTIES_FILTER); return new FrameworkPropertiesDTO(this.systemService, filter.getNames()); diff --git a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FilterDTO.java b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FilterDTO.java index 3fbf366ad88..dab77fe423c 100644 --- a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FilterDTO.java +++ b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FilterDTO.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Eurotech and/or its affiliates and others + * Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -15,9 +15,16 @@ import java.util.ArrayList; import java.util.List; +import io.swagger.v3.oas.annotations.media.Schema; + +@SuppressWarnings("all") +@Schema(name = "Filter", description = "Filter criteria for system properties queries", example = "{\"names\": [\"javaVersion\", \"osName\"], \"groupNames\": [\"hardware\", \"java\"]}") public class FilterDTO { + @Schema(description = "List of specific property names to include in the response. If empty, all properties are returned.", example = "[\"javaVersion\", \"osName\", \"cpuVersion\"]", required = false) private List names; + + @Schema(description = "List of property group names to include in the response (e.g., 'hardware', 'java', 'kura'). If empty, all groups are returned.", example = "[\"hardware\", \"java\"]", required = false) private List groupNames; public FilterDTO() { diff --git a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FrameworkPropertiesDTO.java b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FrameworkPropertiesDTO.java index bdf139d5b35..cd8600eebc8 100644 --- a/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FrameworkPropertiesDTO.java +++ b/kura/org.eclipse.kura.rest.system.provider/src/main/java/org/eclipse/kura/rest/system/dto/FrameworkPropertiesDTO.java @@ -16,7 +16,9 @@ import java.util.function.Predicate; import org.eclipse.kura.system.SystemService; +import io.swagger.v3.oas.annotations.media.Schema; +@Schema(name = "FrameworkProperties", description = "System framework properties including hardware, Java runtime, OS, and Kura-specific information") @SuppressWarnings("unused") public class FrameworkPropertiesDTO { diff --git a/kura/test/org.eclipse.kura.rest.system.provider.test/META-INF/MANIFEST.MF b/kura/test/org.eclipse.kura.rest.system.provider.test/META-INF/MANIFEST.MF index 27d90be0f50..24b86b3f873 100644 --- a/kura/test/org.eclipse.kura.rest.system.provider.test/META-INF/MANIFEST.MF +++ b/kura/test/org.eclipse.kura.rest.system.provider.test/META-INF/MANIFEST.MF @@ -7,7 +7,16 @@ Bundle-Vendor: Eclipse Kura Bundle-License: Eclipse Public License v2.0 Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))" Bundle-ActivationPolicy: lazy -Import-Package: org.eclipse.kura.core.testutil.requesthandler;version="1.1.0", +Import-Package: io.swagger.v3.oas.annotations;version="2.1.0", + io.swagger.v3.oas.annotations.enums;version="2.1.0", + io.swagger.v3.oas.annotations.info;version="2.1.0", + io.swagger.v3.oas.annotations.media;version="2.1.0", + io.swagger.v3.oas.annotations.parameters;version="2.1.0", + io.swagger.v3.oas.annotations.responses;version="2.1.0", + io.swagger.v3.oas.annotations.security;version="2.1.0", + io.swagger.v3.oas.annotations.servers;version="2.1.0", + io.swagger.v3.oas.annotations.tags;version="2.1.0", + org.eclipse.kura.core.testutil.requesthandler;version="1.1.0", org.eclipse.kura.util.wire.test;version="1.1.0", org.junit;version="[4.12.0,5.0.0)", org.junit.runner;version="[4.12.0,5.0.0)", diff --git a/kura/test/org.eclipse.kura.rest.system.provider.test/pom.xml b/kura/test/org.eclipse.kura.rest.system.provider.test/pom.xml index 3eb8177f20a..b116f3055f2 100644 --- a/kura/test/org.eclipse.kura.rest.system.provider.test/pom.xml +++ b/kura/test/org.eclipse.kura.rest.system.provider.test/pom.xml @@ -1,7 +1,7 @@ - 4.0.0 @@ -28,9 +29,29 @@ ${project.basedir}/../.. - ${project.build.directory}/site/jacoco-aggregate/jacoco.xml + + ${project.build.directory}/site/jacoco-aggregate/jacoco.xml + + + + io.swagger.core.v3 + swagger-annotations-jakarta + 2.2.36 + + + io.swagger.core.v3 + swagger-jaxrs2-jakarta + 2.2.36 + + + io.swagger.core.v3 + swagger-models + 2.2.36 + + + @@ -45,7 +66,7 @@ compiletests test-compile - testCompile + testCompile @@ -68,4 +89,4 @@ - + \ No newline at end of file