William Cheng b061bd2146
[Java][Okhttp] Add oneOf support (#10875)
* add custom gson deserializer

* add check for additional fields, required fields

* add tests for custom deserializer

* add custom adapter

* add custom adapter

* register type adapter factory

* comment out custom deserializer and use adapter instead

* add okhttp-gson-nextgen

* add new files

* restore okhttp-gson

* switch to adapter

* remove custom de/serializer

* add comment

* update tests

* test nextgen in ci

* update doc

* use full model name in JSON.java

* undo changes

* add oneof discriminator support

* fix anyOf

* remove mappings

* add more tests

* fix oneof deserialization, add more tests

* add error body and type to api exception class

* JSON to use instance variables/methods

* Revert "add error body and type to api exception class"

This reverts commit 07f34e2c450ad9f808b728173018b1e4d8fed458.
2021-11-30 15:33:42 +08:00

1.3 KiB

EnumTest

Properties

Name Type Description Notes
enumString EnumStringEnum [optional]
enumStringRequired EnumStringRequiredEnum
enumInteger EnumIntegerEnum [optional]
enumIntegerOnly EnumIntegerOnlyEnum [optional]
enumNumber EnumNumberEnum [optional]
outerEnum OuterEnum [optional]
outerEnumInteger OuterEnumInteger [optional]
outerEnumDefaultValue OuterEnumDefaultValue [optional]
outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue [optional]

Enum: EnumStringEnum

Name Value
UPPER "UPPER"
LOWER "lower"
EMPTY ""

Enum: EnumStringRequiredEnum

Name Value
UPPER "UPPER"
LOWER "lower"
EMPTY ""

Enum: EnumIntegerEnum

Name Value
NUMBER_1 1
NUMBER_MINUS_1 -1

Enum: EnumIntegerOnlyEnum

Name Value
NUMBER_2 2
NUMBER_MINUS_2 -2

Enum: EnumNumberEnum

Name Value
NUMBER_1_DOT_1 1.1
NUMBER_MINUS_1_DOT_2 -1.2