mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[json] Provide pretty json schema node text in case the node is an object
Previously used asText() method always returns empty string for object nodes, which makes using the readChildNode(..) API inconvenient. Currently, we use pretty rendered string here GitOrigin-RevId: 4c22553db897e371d6013f8dd8a7be2aa782c431
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0040e3f019
commit
9dbc5b0a65
@@ -36,7 +36,7 @@ internal class InheritedJsonSchemaObjectView(
|
||||
}
|
||||
|
||||
override fun readChildNodeValue(vararg childNodeName: String): String? {
|
||||
return baseIfConditionOrOtherWithArgument(JsonSchemaObject::readChildNodeValue, childNodeName, Any?::isNotNull)
|
||||
return baseIfConditionOrOtherWithArgument(JsonSchemaObject::readChildNodeValue, childNodeName, String?::isNotBlank)
|
||||
}
|
||||
|
||||
override fun hasChildNode(vararg childNodeName: String): Boolean {
|
||||
|
||||
@@ -38,7 +38,7 @@ internal class MergedJsonSchemaObjectView(
|
||||
}
|
||||
|
||||
override fun readChildNodeValue(vararg childNodeName: String): String? {
|
||||
return baseIfConditionOrOtherWithArgument(JsonSchemaObject::readChildNodeValue, childNodeName, Any?::isNotNull)
|
||||
return baseIfConditionOrOtherWithArgument(JsonSchemaObject::readChildNodeValue, childNodeName, String?::isNotBlank)
|
||||
}
|
||||
|
||||
override fun hasChildNode(vararg childNodeName: String): Boolean {
|
||||
|
||||
@@ -38,7 +38,7 @@ internal object JacksonSchemaNodeAccessor : RawJsonSchemaNodeAccessor<JsonNode>
|
||||
if (!node.isObject) return null
|
||||
return getChild(node, *relativeChildPath)
|
||||
.takeIf { it !is MissingNode }
|
||||
?.asText()
|
||||
?.toPrettyString()
|
||||
}
|
||||
|
||||
override fun readTextNodeValue(node: JsonNode, vararg relativeChildPath: String): String? {
|
||||
|
||||
Reference in New Issue
Block a user