William Cheng 4ecb9f4186
[java][native] Fix urlQuery string method in oneOf (#14488)
* better tests, fix oneOf in urlquery string method

* update samples

* update
2023-01-20 01:57:32 +08:00

939 B

GmFruit

anyOf schemas

Example

// Import classes:
import org.openapitools.client.model.GmFruit;
import org.openapitools.client.model.Apple;
import org.openapitools.client.model.Banana;

public class Example {
    public static void main(String[] args) {
        GmFruit exampleGmFruit = new GmFruit();

        // create a new Apple
        Apple exampleApple = new Apple();
        // set GmFruit to Apple
        exampleGmFruit.setActualInstance(exampleApple);
        // to get back the Apple set earlier
        Apple testApple = (Apple) exampleGmFruit.getActualInstance();

        // create a new Banana
        Banana exampleBanana = new Banana();
        // set GmFruit to Banana
        exampleGmFruit.setActualInstance(exampleBanana);
        // to get back the Banana set earlier
        Banana testBanana = (Banana) exampleGmFruit.getActualInstance();
    }
}