diff --git a/contract/build.gradle b/contract/build.gradle index d6d662970..5950265ac 100644 --- a/contract/build.gradle +++ b/contract/build.gradle @@ -3,6 +3,7 @@ import org.openapitools.generator.gradle.plugin.tasks.GenerateTask plugins { id "java-library" alias(libs.plugins.openapi.generator) + alias(libs.plugins.openapi.validator) } @@ -60,6 +61,21 @@ tasks.register('generateBackendApi', GenerateTask) { """] } +openAPIStyleValidator { + inputFile = "${project.projectDir}/src/main/resources/swagger/kafbat-ui-api.yaml" + validateModelPropertiesDescription = false + validateModelPropertiesExample = false + parameterNamingConvention = "UnderscoreCase" + propertyNamingConvention = "camelCase" + queryParamNamingConvention = "camelCase" + pathParamNamingConvention = "camelCase" + validateOperationDescription = false + validateInfoLicense = false + validateInfoDescription = false + validateInfoContact = false +} + + tasks.register('generateConnectClient', GenerateTask) { generatorName = "java" inputSpec = specDir.file("kafka-connect-api.yaml").asFile.absolutePath diff --git a/contract/src/main/resources/swagger/kafbat-ui-api.yaml b/contract/src/main/resources/swagger/kafbat-ui-api.yaml index b8a7ae81b..ba54bc7c5 100644 --- a/contract/src/main/resources/swagger/kafbat-ui-api.yaml +++ b/contract/src/main/resources/swagger/kafbat-ui-api.yaml @@ -2157,7 +2157,7 @@ paths: 204: description: Existing quota deleted - /api/clusters/{clusterName}/acl/streamApp: + /api/clusters/{clusterName}/acl/streamapp: post: tags: - Acls @@ -2486,7 +2486,6 @@ components: - KAFKA_ACL_EDIT # create & delete ACLs - CLIENT_QUOTA_MANAGEMENT required: - - id - name - status @@ -3237,7 +3236,6 @@ components: type: integer format: int64 required: - - topic - partition - offsetMax - offsetMin @@ -3439,16 +3437,16 @@ components: type: string address: type: string - connectors_count: + connectorsCount: type: integer nullable: true - failed_connectors_count: + failedConnectorsCount: type: integer nullable: true - tasks_count: + tasksCount: type: integer nullable: true - failed_tasks_count: + failedTasksCount: type: integer nullable: true required: @@ -3567,21 +3565,21 @@ components: type: integer state: $ref: '#/components/schemas/ConnectorTaskStatus' - worker_id: + workerId: type: string trace: type: string required: - id - state - - worker_id + - workerId ConnectorStatus: type: object properties: state: $ref: '#/components/schemas/ConnectorState' - worker_id: + workerId: type: string required: - state @@ -3646,7 +3644,7 @@ components: - STRING required: type: boolean - default_value: + defaultValue: type: string importance: type: string @@ -3665,7 +3663,7 @@ components: - MEDIUM - LONG - NONE - display_name: + displayName: type: string dependents: type: array @@ -3681,7 +3679,7 @@ components: type: string value: type: string - recommended_values: + recommendedValues: type: array items: type: string @@ -3705,7 +3703,7 @@ components: properties: name: type: string - error_count: + errorCount: type: integer groups: type: array @@ -3791,7 +3789,7 @@ components: type: string name: type: string - connector_class: + connectorClass: type: string type: $ref: '#/components/schemas/ConnectorType' @@ -3801,9 +3799,9 @@ components: type: string status: $ref: '#/components/schemas/ConnectorStatus' - tasks_count: + tasksCount: type: integer - failed_tasks_count: + failedTasksCount: type: integer required: - name diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfddc8eb0..77386fce2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -46,6 +46,7 @@ spring-boot = { id = 'org.springframework.boot', version.ref = 'spring-boot' } spring-dependency-management = { id = 'io.spring.dependency-management', version = '1.1.3' } git-properties = { id = 'com.gorylenko.gradle-git-properties', version = '2.4.2' } openapi-generator = { id = 'org.openapi.generator', version = '7.9.0' } +openapi-validator = {id = "org.openapitools.openapistylevalidator", version = "1.10" } allure = { id = 'io.qameta.allure', version = '2.10.0' } nexus-publish-plugin = { id = 'io.github.gradle-nexus.publish-plugin', version = '1.1.0' } node-gradle = { id = 'com.github.node-gradle.node', version = '7.1.0' } @@ -53,6 +54,8 @@ node-gradle = { id = 'com.github.node-gradle.node', version = '7.1.0' } docker-remote-api = { id = 'com.bmuschko.docker-remote-api', version = '9.4.0' } sonarqube = { id = "org.sonarqube", version = "6.0.1.5171" } + + [libraries] spring-starter-actuator = { module = 'org.springframework.boot:spring-boot-starter-actuator', version.ref = 'spring-boot' } spring-starter-test = { module = 'org.springframework.boot:spring-boot-starter-test', version.ref = 'spring-boot' }