Let our Json parser accept comments and trailing comma.
This commit is contained in:
parent
13775f4fbd
commit
61f074ddc1
2 changed files with 10 additions and 2 deletions
|
|
@ -23,6 +23,13 @@ fun interface JsonProvider {
|
|||
@ContributesBinding(AppScope::class)
|
||||
@SingleIn(AppScope::class)
|
||||
class DefaultJsonProvider : JsonProvider {
|
||||
private val json: Json by lazy { Json { ignoreUnknownKeys = true } }
|
||||
private val json: Json by lazy {
|
||||
Json {
|
||||
ignoreUnknownKeys = true
|
||||
allowComments = true
|
||||
allowTrailingComma = true
|
||||
}
|
||||
}
|
||||
|
||||
override fun invoke() = json
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ class DefaultSessionWellknownRetrieverTest {
|
|||
"registration_helper_url": "a_registration_url",
|
||||
"enforce_element_pro": true,
|
||||
"rageshake_url": "a_rageshake_url",
|
||||
"other": true
|
||||
// Note the trailing comma, and the comment!
|
||||
"other": true,
|
||||
}""".trimIndent().toByteArray()
|
||||
)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue