# Supply Pretty Name for API Enumeration Type

**URL:** <https://forum.inductiveautomation.com/t/supply-pretty-name-for-api-enumeration-type/110893>\
**Category:** Module Development\
**Tags:** ignition83\
**Created:** [September 23, 2025, 3:14pm UTC](https://forum.inductiveautomation.com/t/supply-pretty-name-for-api-enumeration-type/110893 "2025-09-23T15:14:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [September 23, 2025, 3:14pm UTC](https://forum.inductiveautomation.com/t/supply-pretty-name-for-api-enumeration-type/110893/1 "2025-09-23T15:14:23Z")

</div>

I'd like to provide a pretty name for an enumeration used in my extension point config.

Overriding `toString` will show my pretty name in the UI and allow for selection + save, but the dropdown box doesn't load the current value correctly. I think this is because the list of options is derived from the string values which are different than the values stored in the `config.json`. For example, selecting `SHA-256` will store `SHA256` into the `config.json`.

Should I be doing something smarter with my `Enumeration.Provider`?

```kotlin
    @FormCategoryKey("Snmp.config.category.Authentication")
    @Label("Authentication Protocol *")
    @DescriptionKey("Snmp.config.Authentication.AuthProtocol.Description")
    @FormField(FormFieldType.SELECT)
    @Enumeration(AuthenticationProtocol.Provider::class)
    @Required
    val protocol: AuthenticationProtocol,

```

```python
enum class AuthenticationProtocol(val mappedProtocol: AuthGeneric?, val prettyName: String) {
    NONE(null, "None"),
    MD5(AuthMD5(), "MD-5"),
    SHA1(AuthSHA(), "SHA-1"),
    SHA224(AuthHMAC128SHA224(), "SHA-224"),
    SHA256(AuthHMAC192SHA256(), "SHA-256"),
    SHA384(AuthHMAC256SHA384(), "SHA-384"),
    SHA512(AuthHMAC384SHA512(), "SHA-512");

    override fun toString(): String {
        return prettyName
    }

    class Provider : Enumeration.Provider {
        override fun values(): Array<out Any> {
            return AuthenticationProtocol.entries.toTypedArray()
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 23, 2025, 3:38pm UTC](https://forum.inductiveautomation.com/t/supply-pretty-name-for-api-enumeration-type/110893/2 "2025-09-23T15:38:42Z")

</div>

I suspect this is only used somehow by the openapi / schema generation, and not by these config pages, and that it may simply not work at all right now if you try to override toString(). There are no usages of this in any of our config classes that I can see.

There's a lot of annotations in the `openapi.annotations` package and I think only a subset of them have any effect on the extension point config pages.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 23, 2025, 3:47pm UTC](https://forum.inductiveautomation.com/t/supply-pretty-name-for-api-enumeration-type/110893/3 "2025-09-23T15:47:11Z")

</div>

The `Enumeration.Provider` interface seems to be used to do a dynamic lookup of something that may vary at runtime but is being represented as an enumeration in the openapi schema.

Its only use right now seems to be enumerating the ContactTypes that are currently available.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [September 23, 2025, 4:01pm UTC](https://forum.inductiveautomation.com/t/supply-pretty-name-for-api-enumeration-type/110893/4 "2025-09-23T16:01:58Z")

</div>

> [@Kevin.Herron](#):
>
> There's a lot of annotations in the `openapi.annotations` package and I think only a subset of them have any effect on the extension point config pages.

Yeah I'm figuring that out through trial and error 😆.

It looks like you can do this using [FormChoices](https://files.inductiveautomation.com/sdk/javadoc/ignition83/8.3.0/com/inductiveautomation/ignition/gateway/dataroutes/openapi/annotations/FormChoices.html) with:

- `ids` = the name of the enum entry
- `labels` = the `toString()` value of the entry

```python
    @FormCategoryKey("Snmp.config.category.Authentication")
    @Label("Authentication Protocol *")
    @DescriptionKey("Snmp.config.Authentication.AuthProtocol.Description")
    @FormField(FormFieldType.SELECT)
    @FormChoices(
        ids = ["NONE", "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512"],
        labels = ["None", "MD-5", "SHA-1", "SHA-224", "SHA-256", "SHA-384", "SHA-512"],
    )
    @Required
    val protocol: AuthenticationProtocol,

```
