-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/oidf 33 #15
Merged
Merged
Feature/oidf 33 #15
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b59690b
feat: Created OpenAPI specs project of the EntityStatement class
27ab326
chore: Created README.md and disabled model-only profile
266ecf0
chore: Added the build jar task
d2c1c55
Merge branch 'develop' of github.com:Sphereon-Opensource/OpenID-Feder…
90d7466
chore: Fixed versioning
353a7d6
bugfix: Fixed Open Api specs file path
593a8a4
refactor: Fixed the profiles section of the documentation
057e7dc
refactor: Added fat jat and maven publication to local repository
7258a02
refactor: changed to string the value of the dateTimeLibrary property
88db3a1
refactor: Upgraded OpenAPI generator and removed unneeded serializati…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Open API specs | ||
|
||
The Open API specs of OpenID Federation. | ||
|
||
## Entity Statement | ||
|
||
An Entity Statement contains the information needed for the Entity that is the subject of the Entity Statement to | ||
participate in federation(s). An Entity Statement is a signed JWT. The subject of the JWT is the Entity itself. The | ||
issuer of the JWT is the party that issued the Entity Statement. All Entities in a federation publish an Entity Statement | ||
about themselves called an Entity Configuration. Superior Entities in a federation publish Entity Statements about their | ||
Immediate Subordinate Entities called Subordinate Statements. | ||
|
||
### Profiles | ||
|
||
The Open API generator will generate models, infrastructures and apis by default. To make | ||
it generate models only uncomment `profiles=models-only` from gradle.properties or pass the profile in the comment line. | ||
|
||
### Run Open API generator | ||
|
||
Generate models, infrastructures and apis: | ||
```shell | ||
gradle clean openApiGenerate | ||
``` | ||
|
||
Generate only models: | ||
```shell | ||
gradle clean openApiGenerate -Pprofile=model-only | ||
``` | ||
|
||
Generate the jar file: | ||
```shell | ||
gradle clean build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
plugins { | ||
kotlin("jvm") version "2.0.0" | ||
id("org.openapi.generator") version "6.6.0" | ||
id("maven-publish") | ||
} | ||
|
||
group = "com.sphereon.oid.fed" | ||
version = "0.1.0-SNAPSHOT" | ||
|
||
project.extra.set("openApiPackage", "com.sphereon.oid.fed.openapi") | ||
|
||
val profiles = project.properties["profiles"]?.toString()?.split(",") ?: emptyList() | ||
val isModelsOnlyProfile = profiles.contains("models-only") | ||
val ktorVersion = "2.3.11" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("io.ktor:ktor-client-core:$ktorVersion") | ||
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion") | ||
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.0") | ||
} | ||
|
||
openApiGenerate { | ||
val openApiPackage: String by project | ||
generatorName.set("kotlin") | ||
packageName.set("com.sphereon.oid.fed.openapi") | ||
apiPackage.set("$openApiPackage.api") | ||
modelPackage.set("$openApiPackage.models") | ||
inputSpec.set("$projectDir/src/main/kotlin/com/sphereon/oid/fed/openapi/openapi.yaml") | ||
library.set("multiplatform") | ||
outputDir.set("$projectDir/build/generated") | ||
configOptions.set( | ||
mapOf( | ||
"dateLibrary" to "java8", | ||
"serializationLibrary" to "jackson" | ||
) | ||
) | ||
|
||
if (isModelsOnlyProfile) { | ||
globalProperties.set( | ||
configOptions.get().plus( | ||
mapOf( | ||
"models" to "" | ||
) | ||
) | ||
) | ||
} | ||
} | ||
|
||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("mavenKotlin") { | ||
from(components["kotlin"]) | ||
} | ||
} | ||
} | ||
|
||
tasks.compileKotlin { | ||
dependsOn(tasks.openApiGenerate) | ||
} | ||
|
||
tasks.jar { | ||
dependsOn(tasks.compileKotlin) | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
archiveBaseName.set(project.name) | ||
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) | ||
from("$projectDir/build/classes/kotlin/main") | ||
} | ||
|
||
kotlin { | ||
sourceSets.main { | ||
kotlin.srcDirs( | ||
"$projectDir/build/generated/src/commonMain/kotlin" | ||
) | ||
} | ||
jvmToolchain(21) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
kotlin.code.style=official | ||
#profiles=models-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" | ||
} | ||
rootProject.name = "openapi" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still says java8 & jackson. That's not going to work on nodejs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time please leave a message here when something is resolved or not applicable. (I am waiting for that)