Skip to content

chore(deps): bump swagger-parser from 2.1.12 to 2.1.26 #1522

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion server/zally-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ dependencies {
kapt("com.google.auto.service:auto-service:1.0.1")

api(project(":zally-rule-api"))
api("io.swagger.parser.v3:swagger-parser:2.1.12")
api("io.swagger.parser.v3:swagger-parser:2.1.26")
api("io.github.config4k:config4k:0.5.0")
implementation("com.google.auto.service:auto-service:1.0.1")

implementation("javax.mail:javax.mail-api:1.6.2")
runtimeOnly("com.sun.mail:javax.mail:1.6.2")

testImplementation(project(":zally-test"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,25 @@ class ReverseAstBuilder<T : Any> internal constructor(root: T) {
val name = m.name
try {
m.invoke(obj)?.let { value ->
val nextNodePointer: JsonPointer
var skipNode = false

if (m.isAnnotationPresent(JsonAnyGetter::class.java)) {
// A `JsonAnyGetter` method is simply a wrapper for nested properties.
// We must not use the method name but re-use the current pointer.
nodes.push(Node(value, pointer, marker, /* skip */true))
nextNodePointer = pointer
skipNode = true
} else if (name in this.extensionMethodNames) {
// Extension methods return a Map of OpenAPI extensions.
// Assigning the parent's pointer here ensures the Map itself doesn't add a path segment,
// to avoid issues like '/parent//extension-key'
nextNodePointer = pointer
} else {
// Do not add extension names to the JsonNode path
val nextPath = m.name
.takeIf { it !in this.extensionMethodNames }
?.removePrefix("get")
?.replaceFirstChar({ it.lowercase() })
?: ""

nodes.push(Node(value, pointer + nextPath.toEscapedJsonPointer(), marker))
// Regular bean property: a new path segment is created from the property name.
val propertyName = name.removePrefix("get").replaceFirstChar { it.lowercase() }
nextNodePointer = pointer + propertyName.toEscapedJsonPointer()
}
nodes.push(Node(value, nextNodePointer, marker, skipNode))
}
} catch (e: ReflectiveOperationException) {
throw ReverseAstException("Error invoking $name on ${obj.javaClass.name} at path $pointer", e)
Expand Down