Skip to content
Open
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
2 changes: 1 addition & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ COPY --from=builder /var/app/zally-server/build/libs/zally-server.jar /

EXPOSE 8080

CMD java -jar /zally-server.jar
CMD java -Dbind-type=true -jar /zally-server.jar
3 changes: 2 additions & 1 deletion server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ subprojects {
includeCompileClasspath = false
}

tasks.withType<KotlinCompile>().configureEach() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "17"
}

Expand Down Expand Up @@ -186,6 +186,7 @@ subprojects {
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
systemProperty("bind-type", "true")
}

tasks.jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ class CommonFieldTypesRuleTest {
assertThat(rule.checkTypesOfCommonFields(context)).isEmpty()
}

@Test
fun `checkTypesOfCommonFields should not return any violations for openapi version with 'type' as array`() {
@Language("YAML")
val context =
DefaultContextFactory().getOpenApiContext(
"""
openapi: 3.1.0
components:
schemas:
Pet:
properties:
id:
type: string
""".trimIndent()
)

assertThat(rule.checkTypesOfCommonFields(context)).isEmpty()
}

@Test
fun `checkTypesOfCommonFields should return a violation for a specification with invalid common field in a schema`() {
@Language("YAML")
Expand Down Expand Up @@ -262,7 +281,7 @@ class CommonFieldTypesRuleTest {
CustomId:
type: object
properties:
id:
id:
type: integer
format: int64
""".trimIndent()
Expand Down
4 changes: 4 additions & 0 deletions server/zally-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ dependencies {
testImplementation("org.mockito:mockito-core:4.11.0")
}

tasks.withType<JavaExec> {
systemProperty("bind-type", "true")
}

tasks.bootRun {
jvmArgs = listOf("-Dspring.profiles.active=dev")
}
Expand Down