diff --git a/common/rest-java-model/build.gradle b/common/rest-java-model/build.gradle index 10ca9d04..109e4b14 100644 --- a/common/rest-java-model/build.gradle +++ b/common/rest-java-model/build.gradle @@ -20,16 +20,16 @@ swaggerSources { dependsOn validation } } - modelV2 { - inputFile = file('../swagger/v2/swagger.yaml') + modelV1Exp { + inputFile = file('../swagger/v1exp/swagger.yaml') code { language = 'java' - configFile = file('../swagger/v2/swagger_codegen.json') + configFile = file('../swagger/v1exp/swagger_codegen.json') components = [models: true] dependsOn validation } } } -compileJava.dependsOn swaggerSources.model.code, swaggerSources.modelV2.code -sourceSets.main.java.srcDirs "${swaggerSources.model.code.outputDir}/src/main/java", "${swaggerSources.modelV2.code.outputDir}/src/main/java" +compileJava.dependsOn swaggerSources.model.code, swaggerSources.modelV1Exp.code +sourceSets.main.java.srcDirs "${swaggerSources.model.code.outputDir}/src/main/java", "${swaggerSources.modelV1Exp.code.outputDir}/src/main/java" diff --git a/common/rest-spring-api/build.gradle b/common/rest-spring-api/build.gradle index 303e5cc1..f81c3ed8 100644 --- a/common/rest-spring-api/build.gradle +++ b/common/rest-spring-api/build.gradle @@ -21,11 +21,11 @@ swaggerSources { dependsOn validation } } - apiV2 { - inputFile = file('../swagger/v2/swagger.yaml') + apiV1Exp { + inputFile = file('../swagger/v1exp/swagger.yaml') code { language = 'spring' - configFile = file('../swagger/v2/swagger_codegen.json') + configFile = file('../swagger/v1exp/swagger_codegen.json') components = [models: true, apis: true] dependsOn validation } @@ -41,5 +41,5 @@ bootJar { enabled=false } -compileJava.dependsOn swaggerSources.api.code, swaggerSources.apiV2.code -sourceSets.main.java.srcDirs "${swaggerSources.api.code.outputDir}/src/main/java", "${swaggerSources.apiV2.code.outputDir}/src/main/java" +compileJava.dependsOn swaggerSources.api.code, swaggerSources.apiV1Exp.code +sourceSets.main.java.srcDirs "${swaggerSources.api.code.outputDir}/src/main/java", "${swaggerSources.apiV1Exp.code.outputDir}/src/main/java" diff --git a/common/swagger/v1exp/swagger.yaml b/common/swagger/v1exp/swagger.yaml index f795cafa..0aa59231 100644 --- a/common/swagger/v1exp/swagger.yaml +++ b/common/swagger/v1exp/swagger.yaml @@ -26,15 +26,15 @@ paths: schema: type: object properties: - mediaScoreRequest: - $ref: '#/components/schemas/MediaScoreRequest' + scoreMediaRequest: + $ref: '#/components/schemas/scoreMediaRequest' files: type: array items: type: string format: binary required: - - mediaScoreRequest + - scoreMediaRequest - files responses: '200': @@ -49,7 +49,7 @@ paths: description: Invalid payload components: schemas: - MediaScoreRequest: + scoreMediaRequest: allOf: - $ref: '../v1/swagger.yaml#/definitions/ScoreRequest' - properties: diff --git a/common/swagger/v2/swagger.yaml b/common/swagger/v1openapi3/swagger.yaml similarity index 98% rename from common/swagger/v2/swagger.yaml rename to common/swagger/v1openapi3/swagger.yaml index 47495e86..ee4e18bc 100644 --- a/common/swagger/v2/swagger.yaml +++ b/common/swagger/v1openapi3/swagger.yaml @@ -1,15 +1,16 @@ openapi: '3.0.0' info: - title: Scoring API - v2 + title: Scoring API - v1.2.0-openapi3 description: >- This is a definition of the REST API for scoring from H2O. This API is intended to be used within DAI and eventually across all H2O scoring systems. + This API combines both v1 and v1Exp in OPENAPI 3.0 spec. contact: email: support@h2o.ai license: name: License url: 'http://www.h2o.ai' - version: 1.3.0 + version: 1.2.0-openapi3 servers: - url: / paths: @@ -173,15 +174,15 @@ paths: schema: type: object properties: - mediaScoreRequest: - $ref: '#/components/schemas/MediaScoreRequest' + scoreMediaRequest: + $ref: '#/components/schemas/scoreMediaRequest' files: type: array items: type: string format: binary required: - - mediaScoreRequest + - scoreMediaRequest - files responses: '200': @@ -399,7 +400,7 @@ components: type: array items: $ref: '#/components/schemas/Row' - MediaScoreRequest: + scoreMediaRequest: allOf: - $ref: '#/components/schemas/ScoreRequest' - properties: diff --git a/common/swagger/v1openapi3/swagger_codegen.json b/common/swagger/v1openapi3/swagger_codegen.json new file mode 100644 index 00000000..199e80a6 --- /dev/null +++ b/common/swagger/v1openapi3/swagger_codegen.json @@ -0,0 +1,7 @@ +{ + "basePackage":"ai.h2o.mojos.deploy.common.rest.v1openapi3", + "configPackage":"ai.h2o.mojos.deploy.common.rest.v1openapi3.config", + "modelPackage": "ai.h2o.mojos.deploy.common.rest.v1openapi3.model", + "apiPackage" : "ai.h2o.mojos.deploy.common.rest.v1openapi3.api", + "interfaceOnly" : true +} diff --git a/common/swagger/v2/swagger_codegen.json b/common/swagger/v2/swagger_codegen.json deleted file mode 100644 index 6dc58be3..00000000 --- a/common/swagger/v2/swagger_codegen.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "basePackage":"ai.h2o.mojos.deploy.common.rest.v2", - "configPackage":"ai.h2o.mojos.deploy.common.rest.v2.config", - "modelPackage": "ai.h2o.mojos.deploy.common.rest.v2.model", - "apiPackage" : "ai.h2o.mojos.deploy.common.rest.v2.api", - "interfaceOnly" : true -}