Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
Merge branch 'update-swagger-v2-support-openapi3' into add-scoring-me…
Browse files Browse the repository at this point in the history
…dia-endpoint
  • Loading branch information
jih147 committed Jun 13, 2023
2 parents bcb2668 + 9c01c0f commit e1aeafb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
10 changes: 5 additions & 5 deletions common/rest-java-model/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 5 additions & 5 deletions common/rest-spring-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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"
8 changes: 4 additions & 4 deletions common/swagger/v1exp/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -49,7 +49,7 @@ paths:
description: Invalid payload
components:
schemas:
MediaScoreRequest:
scoreMediaRequest:
allOf:
- $ref: '../v1/swagger.yaml#/definitions/ScoreRequest'
- properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -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: [email protected]
license:
name: License
url: 'http://www.h2o.ai'
version: 1.3.0
version: 1.2.0-openapi3
servers:
- url: /
paths:
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -399,7 +400,7 @@ components:
type: array
items:
$ref: '#/components/schemas/Row'
MediaScoreRequest:
scoreMediaRequest:
allOf:
- $ref: '#/components/schemas/ScoreRequest'
- properties:
Expand Down
7 changes: 7 additions & 0 deletions common/swagger/v1openapi3/swagger_codegen.json
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 0 additions & 7 deletions common/swagger/v2/swagger_codegen.json

This file was deleted.

0 comments on commit e1aeafb

Please sign in to comment.