Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions build.gradle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR, we should generate the types and commit them, and them import them to the APIs for use to replace Object

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'io.qameta.allure' version '2.11.2'
id 'org.ajoberstar.grgit' version '5.2.0'
id 'org.jreleaser' version '1.19.0'
id("org.openapi.generator") version "7.14.0"
}

repositories {
Expand Down Expand Up @@ -56,6 +57,10 @@ dependencies {
implementation "org.bouncycastle:bcprov-jdk18on:${bouncycastleVersion}"
implementation "org.json:json:${jsonVersion}"
implementation "org.greenbytes.http:structured-fields:${structuredFieldsVersion}"
// OpenAI generate model dependencies
implementation "com.squareup.okhttp3:okhttp:4.12.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this one needed specifically?

implementation "com.google.code.gson:gson:2.11.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have jackson - can we configure it to use that instead?

implementation "jakarta.annotation:jakarta.annotation-api:2.1.1"

testImplementation platform("org.junit:junit-bom:${junitVersion}")
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
Expand Down Expand Up @@ -187,3 +192,37 @@ tasks.register('allureE2ETestReport') {
tasks.named('allureReport') {
enabled = false
}

tasks.openApiGenerate {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the command called to the README somewhere so people know how to re-generate types?

generatorName.set("java")
inputSpec.set("$rootDir/spec.yaml")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to come from a file or can make a HTTP call to KERIA in real time?

outputDir.set("$buildDir/generated".toString())
modelPackage.set("org.cardanofoundation.signify.generated.keria.model")
invokerPackage.set("org.cardanofoundation.signify.generated.keria.model")
// globalProperties.set([
// models: ""
// ])
configOptions = [
library : "resttemplate",
useGson : "true",
useJakartaEe : "true"
]
}

sourceSets {
main {
java {
srcDir "$buildDir/generated/src/main/java"
}
}
}

//tasks.register('copyGeneratedModels', Copy) {
// dependsOn tasks.openApiGenerate
// from("$buildDir/generated/src/main/java/org/cardanofoundation/signify/generated/keria/model")
// into("src/main/java/org/cardanofoundation/signify/generated/keria/model")
//}
//
//tasks.named("openApiGenerate") {
// finalizedBy(copyGeneratedModels)
//}
Loading
Loading