// Path: src/main/java/com/github/hgwood/fanfaron/utils/vendorextensions/DynamicObjectWithVendorExtensions.java
// public class DynamicObjectWithVendorExtensions<T> extends DynamicObject<T> {
//     @JsonIgnore public VendorExtensions vendorExtensions = new VendorExtensions();
// 
//     @JsonCreator public DynamicObjectWithVendorExtensions(Map<String, ?> properties) {
//         for (Map.Entry<String, ?> property : properties.entrySet()) {
//             if (VendorExtensions.isVendorExtension(property.getKey())) vendorExtensions.put(property.getKey(), property.getValue());
//             else super.put(property.getKey(), (T)property.getValue());
//         }
//     }
// 
//     public DynamicObjectWithVendorExtensions() {
//         this(new HashMap<String, Object>());
//     }
// }
// 
// Path: src/main/java/com/github/hgwood/fanfaron/utils/vendorextensions/WithVendorExtensions.java
// public class WithVendorExtensions {
//     @JsonIgnore public VendorExtensions vendorExtensions = new VendorExtensions();
// 
//     @JsonAnySetter private void addVendorExtension(String key, Object value) {
//         vendorExtensions.put(key, value);
//     }
// 
//     @JsonAnyGetter private Map<String, Object> getVendorExtensions() {
//         return vendorExtensions;
//     }
// }


import com.github.hgwood.fanfaron.utils.vendorextensions.DynamicObjectWithVendorExtensions;
import com.github.hgwood.fanfaron.utils.vendorextensions.WithVendorExtensions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.List;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
package com.github.hgwood.fanfaron;




@RunWith(Parameterized.class)
public class VendorExtensionsTest {

    @Parameterized.Parameter public Class<?> classSupportingVendorExtensions;

    @Parameters(name = "{0}")
    public static List<Object[]> classes_which_support_vendor_extensions() {
        return asList(new Object[][] {
            {Contact.class},
            {ExternalDocumentation.class},
            {Info.class},
            {Items.class},
            {License.class},
            {Operation.class},
            {Parameter.class},
            {PathItem.class},
            {Paths.class},
            {Response.class},
            {Responses.class},
            {Scopes.class},
            {SecurityScheme.class},
            {Swagger.class},
            {Tag.class},
            {Xml.class}
        });
    }

    @Test public void supports_vendor_extensions() {
        Object instance =
            TestUtils.deserialize(getClass(), "vendorExtensions.json", classSupportingVendorExtensions);
        if (instance instanceof WithVendorExtensions) {
            assertEquals("extension", ((WithVendorExtensions)instance).vendorExtensions.get("x-extension"));
// Path: src/main/java/com/github/hgwood/fanfaron/utils/vendorextensions/DynamicObjectWithVendorExtensions.java
// public class DynamicObjectWithVendorExtensions<T> extends DynamicObject<T> {
//     @JsonIgnore public VendorExtensions vendorExtensions = new VendorExtensions();
// 
//     @JsonCreator public DynamicObjectWithVendorExtensions(Map<String, ?> properties) {
//         for (Map.Entry<String, ?> property : properties.entrySet()) {
//             if (VendorExtensions.isVendorExtension(property.getKey())) vendorExtensions.put(property.getKey(), property.getValue());
//             else super.put(property.getKey(), (T)property.getValue());
//         }
//     }
// 
//     public DynamicObjectWithVendorExtensions() {
//         this(new HashMap<String, Object>());
//     }
// }
// 
// Path: src/main/java/com/github/hgwood/fanfaron/utils/vendorextensions/WithVendorExtensions.java
// public class WithVendorExtensions {
//     @JsonIgnore public VendorExtensions vendorExtensions = new VendorExtensions();
// 
//     @JsonAnySetter private void addVendorExtension(String key, Object value) {
//         vendorExtensions.put(key, value);
//     }
// 
//     @JsonAnyGetter private Map<String, Object> getVendorExtensions() {
//         return vendorExtensions;
//     }
// }


// Path: src/test/java/com/github/hgwood/fanfaron/VendorExtensionsTest.java
import com.github.hgwood.fanfaron.utils.vendorextensions.DynamicObjectWithVendorExtensions;
import com.github.hgwood.fanfaron.utils.vendorextensions.WithVendorExtensions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.List;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

package com.github.hgwood.fanfaron;




@RunWith(Parameterized.class)
public class VendorExtensionsTest {

    @Parameterized.Parameter public Class<?> classSupportingVendorExtensions;

    @Parameters(name = "{0}")
    public static List<Object[]> classes_which_support_vendor_extensions() {
        return asList(new Object[][] {
            {Contact.class},
            {ExternalDocumentation.class},
            {Info.class},
            {Items.class},
            {License.class},
            {Operation.class},
            {Parameter.class},
            {PathItem.class},
            {Paths.class},
            {Response.class},
            {Responses.class},
            {Scopes.class},
            {SecurityScheme.class},
            {Swagger.class},
            {Tag.class},
            {Xml.class}
        });
    }

    @Test public void supports_vendor_extensions() {
        Object instance =
            TestUtils.deserialize(getClass(), "vendorExtensions.json", classSupportingVendorExtensions);
        if (instance instanceof WithVendorExtensions) {
            assertEquals("extension", ((WithVendorExtensions)instance).vendorExtensions.get("x-extension"));
        } else if (instance instanceof DynamicObjectWithVendorExtensions) {