Change enums to strings for *Type fields
See original GitHub issueThe enum types, QueueType
, GameType
, etc, cause a lot of stability issues because Riot changes the strings returned by the API relatively frequently and without prior notice.
I propose changing the representation of *Type
s to string
(instead of enum), and storing the known values as const
s in static helper classes.
Hijacking the top post for the table - Ben
Desired type | Current enum |
---|---|
String | ✔️GameQueueType ✔️GameSubType ✔️QueueType Season ✔️ Queue ✔️ GameMode Platform ✔️ Slug ✔️ParTypeStatic |
Enum | Tier every enum in the MatchEndpoint except QueueType and Season GameType Lane MapType Region Role Language TagStatic everything in the tournament endpoint |
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (17 by maintainers)
Top Results From Across the Web
Associating enums with strings in C# - Stack Overflow
String oemString = Enum.GetName(typeof(GroupTypes), GroupTypes.OEM);. I've used this method successfully in the past, and I' ...
Read more >String Enums in C#: Everything You Need to Know
To declare an enumeration type, use the enum keyword and specify the names of enum members. C#. public enum Country { UnitedStates, Canada...
Read more >Enum.ToString Method (System)
Examples. The following example demonstrates converting an enumerated value to a string. type Colors = | Red = 1 | Blue = 2...
Read more >How to Serialize Enum to a String in C# - Code Maze
In this article, we will demonstrate different ways of how to serialize enum to string in C# with detailed explanation and examples.
Read more >How to Get an Enum Member as a String in C# - Code Maze
All we need to do is to get its type and the desired member's underlying integer value.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s what I’ve compiled:
GameSubType
QueueType
Season
✔️ Queue
✔️ GameMode
Platform
✔️ Slug
✔️ParTypeStatic
PlayerStatsSummaryType
every enum in the MatchEndpoint except QueueType and Season
GameType
Lane
MapType
Region
Role
Language
TagStatic
everything in the tournament endpoint
Do you guys agree?
My bad I thought the converter was still there, closing 👍