Skip to content

Commit ce7de4e

Browse files
committed
feat: draft branch can be merged with changes from git
1 parent 49117f6 commit ce7de4e

File tree

4 files changed

+152
-0
lines changed

4 files changed

+152
-0
lines changed

api-client-ktor/build.gradle.kts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
2+
3+
plugins {
4+
base
5+
`maven-publish`
6+
alias(libs.plugins.openapi.generator)
7+
alias(libs.plugins.kotlin.serialization)
8+
kotlin("jvm")
9+
}
10+
11+
val generatorTask = tasks.register("generateKtorClient", GenerateTask::class) {
12+
dependsOn(":redocly:npm_run_bundle")
13+
group = "openapi tools"
14+
configOptions = mapOf(
15+
"library" to "jvm-ktor",
16+
"serializationLibrary" to "kotlinx_serialization"
17+
)
18+
gitUserId = "modelix"
19+
gitRepoId = "modelix.openapi"
20+
generatorName = "kotlin"
21+
inputSpec = project(":redocly")
22+
.layout.projectDirectory
23+
.file("bundled/git-connector-v1.yaml")
24+
.asFile.absolutePath
25+
outputDir =
26+
layout.buildDirectory
27+
.dir("generated/ktor")
28+
.get()
29+
.asFile.absolutePath
30+
//importMappings.put("UUID", "kotlin.uuid.Uuid")
31+
}
32+
33+
val generatedKotlinSrc = project.layout.buildDirectory.dir("generated/ktor/src/main/kotlin")
34+
sourceSets.main {
35+
kotlin.srcDir(generatedKotlinSrc)
36+
}
37+
38+
dependencies {
39+
api(libs.ktor.client.core)
40+
implementation(libs.ktor.client.content.negotiation)
41+
}
42+
43+
tasks.compileKotlin {
44+
dependsOn(generatorTask)
45+
}
46+
47+
publishing {
48+
publications {
49+
create<MavenPublication>("apiClientKtor") {
50+
from(components["java"])
51+
}
52+
}
53+
}

gradle/libs.versions.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ logback = "1.5.18"
88
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" }
99
ktor-server-auth = { group = "io.ktor", name = "ktor-server-auth", version.ref = "ktor" }
1010
ktor-server-data-conversion = { group = "io.ktor", name = "ktor-server-data-conversion", version.ref = "ktor" }
11+
12+
ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
1113
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
14+
ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref = "ktor" }
15+
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
16+
ktor-client-websockets = { group = "io.ktor", name = "ktor-client-websockets", version.ref = "ktor" }
17+
ktor-client-js = { group = "io.ktor", name = "ktor-client-js", version.ref = "ktor" }
18+
ktor-client-auth = { group = "io.ktor", name = "ktor-client-auth", version.ref = "ktor" }
19+
20+
ktor-serialization = { group = "io.ktor", name = "ktor-serialization", version.ref = "ktor" }
21+
ktor-serialization-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
1222

1323
[plugins]
1424
gitVersion = { id = "com.palantir.git-version", version = "4.0.0" }

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
rootProject.name = "modelix.openapi"
33

4+
include("api-client-ktor")
45
include("redocly")
56
//include("client-ts")
67
include("api-server-stubs-ktor")

specifications/git-connector/v1/git.yaml

100644100755
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,79 @@ paths:
218218
responses:
219219
"200":
220220
description: OK
221+
/drafts/{draftId}/rebaseJob:
222+
get:
223+
operationId: getDraftRebaseJob
224+
tags: [Drafts]
225+
parameters:
226+
- name: draftId
227+
in: path
228+
required: true
229+
schema:
230+
type: string
231+
responses:
232+
"200":
233+
description: OK
234+
content:
235+
application/json:
236+
schema:
237+
$ref: '#/components/schemas/DraftRebaseJob'
238+
post:
239+
operationId: rebaseDraft
240+
tags: [Drafts]
241+
parameters:
242+
- name: draftId
243+
in: path
244+
required: true
245+
schema:
246+
type: string
247+
requestBody:
248+
content:
249+
application/json:
250+
schema:
251+
$ref: '#/components/schemas/DraftRebaseJob'
252+
responses:
253+
"200":
254+
description: OK
255+
256+
/drafts/{draftId}/preparationJob:
257+
get:
258+
operationId: getDraftBranchPreparationJob
259+
tags: [Drafts]
260+
parameters:
261+
- name: draftId
262+
in: path
263+
required: true
264+
schema:
265+
type: string
266+
responses:
267+
"200":
268+
description: OK
269+
content:
270+
application/json:
271+
schema:
272+
$ref: '#/components/schemas/DraftPreparationJob'
273+
post:
274+
operationId: prepareDraftBranch
275+
tags: [Drafts]
276+
parameters:
277+
- name: draftId
278+
in: path
279+
required: true
280+
schema:
281+
type: string
282+
requestBody:
283+
content:
284+
application/json:
285+
schema:
286+
$ref: '#/components/schemas/DraftPreparationJob'
287+
responses:
288+
"200":
289+
description: OK
290+
content:
291+
application/json:
292+
schema:
293+
$ref: '#/components/schemas/DraftPreparationJob'
221294

222295
components:
223296
schemas:
@@ -318,6 +391,21 @@ components:
318391
modelixBranchName: { type: string }
319392
defaultWorkspace: { type: string }
320393

394+
DraftRebaseJob:
395+
type: object
396+
required: [baseGitCommit]
397+
properties:
398+
baseGitCommit: { type: string }
399+
gitBranchName: { type: string }
400+
active: { type: boolean }
401+
errorMessage: { type: string }
402+
403+
DraftPreparationJob:
404+
type: object
405+
properties:
406+
active: { type: boolean }
407+
errorMessage: { type: string }
408+
321409
securitySchemes:
322410
modelixJwtAuth:
323411
type: http

0 commit comments

Comments
 (0)