diff --git a/build.gradle.kts b/build.gradle.kts index 4f2b010a..592867e5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,7 +27,6 @@ subprojects { } repositories { - mavenLocal() mavenCentral() } @@ -123,7 +122,6 @@ allprojects { version = semVersion repositories { - mavenLocal() mavenCentral() } } diff --git a/service/src/main/kotlin/io/provenance/onboarding/domain/cee/InputParser.kt b/service/src/main/kotlin/io/provenance/onboarding/domain/cee/InputParser.kt index 6ac98e36..df046ae5 100644 --- a/service/src/main/kotlin/io/provenance/onboarding/domain/cee/InputParser.kt +++ b/service/src/main/kotlin/io/provenance/onboarding/domain/cee/InputParser.kt @@ -4,5 +4,6 @@ import com.google.protobuf.Message interface InputParser { val type: Class<*> + val default: Boolean fun parse(input: Any, type: Class<*>, includeTypes: List = emptyList()): Message } diff --git a/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/ContractParserService.kt b/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/ContractParserService.kt index 15f1fbec..551392ca 100644 --- a/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/ContractParserService.kt +++ b/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/ContractParserService.kt @@ -11,7 +11,7 @@ class ContractParserService( private val parsers: List ) : ContractParser { override fun parseInput(input: Any, type: Class<*>): Message = - parsers.firstOrNull { type.kotlin.isSubclassOf(it.type.kotlin) }?.parse(input, type) + parsers.firstOrNull { type.kotlin.isSubclassOf(it.type.kotlin) && it.default }?.parse(input, type) ?: throw IllegalStateException("Failed to find parser for contract input.") override fun getParser(name: String): InputParser? = diff --git a/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/JsonMessageParser.kt b/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/JsonMessageParser.kt index dfb06c27..5efe65e8 100644 --- a/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/JsonMessageParser.kt +++ b/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/JsonMessageParser.kt @@ -9,7 +9,9 @@ import io.provenance.onboarding.util.toPrettyJson import org.springframework.stereotype.Component @Component -class JsonMessageParser : InputParser { +class JsonMessageParser( + override val default: Boolean = false +) : InputParser { override val type: Class<*> = Message::class.java override fun parse(input: Any, type: Class<*>, includeTypes: List): Message { diff --git a/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/MessageParser.kt b/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/MessageParser.kt index 9bf98cfb..dae6b19a 100644 --- a/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/MessageParser.kt +++ b/service/src/main/kotlin/io/provenance/onboarding/frameworks/cee/parsers/MessageParser.kt @@ -9,7 +9,9 @@ import io.provenance.onboarding.util.toPrettyJson import org.springframework.stereotype.Component @Component -class MessageParser : InputParser { +class MessageParser( + override val default: Boolean = true +) : InputParser { override val type: Class<*> = Message::class.java override fun parse(input: Any, type: Class<*>, includeTypes: List): Message = ObjectMapper()