[kotlin] Enum should match spec (#18062)

* [kotlin] Enum should match spec

Adjust the enum generation to match what is in the spec, rather than
camel-casing it.
Add tests for capitalization scenarios, including for kotlin keywords

* [kotlin] export docs generators for enum change

* [kotlin] export docs generators for enum change

* fix conflicts

---------

Co-authored-by: Tyler B. Thrailkill <tylerbthrailkill@gmail.com>
Co-authored-by: Jari Nystedt <jari.nystedt@tietoevry.com>
This commit is contained in:
William Cheng
2024-03-09 17:42:33 +08:00
committed by GitHub
parent 81e33ede6e
commit 494fc7d182
40 changed files with 336 additions and 117 deletions

View File

@@ -57,13 +57,13 @@ data class Order (
/**
* Order Status
*
* Values: placed,approved,delivered,unknownDefaultOpenApi
* Values: placed,approved,delivered,unknown_default_open_api
*/
enum class Status(val value: kotlin.String) {
@JsonProperty(value = "placed") placed("placed"),
@JsonProperty(value = "approved") approved("approved"),
@JsonProperty(value = "delivered") delivered("delivered"),
@JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknownDefaultOpenApi("unknown_default_open_api");
@JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api");
}
}

View File

@@ -60,13 +60,13 @@ data class Pet (
/**
* pet status in the store
*
* Values: available,pending,sold,unknownDefaultOpenApi
* Values: available,pending,sold,unknown_default_open_api
*/
enum class Status(val value: kotlin.String) {
@JsonProperty(value = "available") available("available"),
@JsonProperty(value = "pending") pending("pending"),
@JsonProperty(value = "sold") sold("sold"),
@JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknownDefaultOpenApi("unknown_default_open_api");
@JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api");
}
}