Open
Description
At compile-time we see the following when setting additionalPropertiesOption: strict
in the config:
Cannot check for instance of erased type: List<Bar.Foo>
For a schema containing an array of objects:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "bar.schema.json",
"properties": {
"foos": {
"type": "array",
"items": {
"id": "foo",
"type": "object"
}
}
}
}
The offending generated code in Bar.kt
:
if (cg_map.containsKey("foos"))
require(cg_map["foos"] is List<Foo>) { "foos is not the correct type, expecting List<Foo>?" }
This is a blocker for us, since our schema required pattern properties, thus iiuc we need to enable additionalPropertiesOption: strict
for the relevant code the generated.
Applying via json-kotlin-gradle plugin 0.102.
@pwall567 Do you have bandwidth to provide a fix? 🙏
Metadata
Metadata
Assignees
Labels
No labels