Skip to content

Commit

Permalink
Remove unused json field from blueprint parser
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNatan committed Jan 22, 2023
1 parent a5da4cd commit b2d5fb2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import kotlin.reflect.KClass
// TODO detailed error diagnostics
internal class BlueprintParser(private val supportedProperties: List<Property> = AllSupportedProperties) {

private val json: Json = Json {
ignoreUnknownKeys = false
isLenient = true
}
private val parseOptions = ConfigParseOptions.defaults().setSyntax(ConfigSyntax.CONF)
private val requiredProperties: List<Property> = supportedProperties.filter { property ->
property.constraints.any { constraint -> constraint is RequiredPropertyConstraint }
Expand All @@ -40,6 +36,8 @@ internal class BlueprintParser(private val supportedProperties: List<Property> =
try {
val config = ConfigFactory.parseString(input, parseOptions)

// TODO remove this and iterate over supported properties building a qualified name
// allowing RequiredPropertyConstraint work properly :)
for (requiredProperty in requiredProperties) {
if (config.hasPathOrNull(requiredProperty.qualifiedName)) {
continue
Expand Down

0 comments on commit b2d5fb2

Please sign in to comment.