@Test
    public void testAdditionalPropertyWithSubtype() throws JSONException, IOException {
        SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON);
        configBuilder.with(Option.MAP_VALUES_AS_ADDITIONAL_PROPERTIES, Option.DEFINITIONS_FOR_MEMBER_SUPERTYPES)
                .without(Option.SCHEMA_VERSION_INDICATOR)
                .forTypesInGeneral()
                .withSubtypeResolver((declaredType, context) -> declaredType.getErasedType() == B.class
                        ? Collections.singletonList(context.getTypeContext().resolve(BImpl.class))
                        : null);
        configBuilder.forFields()
                .withDescriptionResolver(field -> field.isFakeContainerItemScope()
                        ? Optional.ofNullable(field.getContainerItemAnnotation(ParamInfo.class)).map(ParamInfo::value).orElse(null)
                        : null);
        SchemaGenerator generator = new SchemaGenerator(configBuilder.build());
        JsonNode result = generator.generateSchema(A.class);
        TestUtils.assertGeneratedSchema(result, AdditionalPropertiesModuleTest.class, "additional-property-with-subtype.json");
    }
Test for the {@link AdditionalPropertiesModule} class.
jsonschema-generator/src/test/java/com/github/victools/jsonschema/generator/impl/module/AdditionalPropertiesModuleTest.java