question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change enums to strings for *Type fields

See original GitHub issue

The 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 *Types to string (instead of enum), and storing the known values as consts 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
PlayerStatsSummaryType (Stats endpoint deprecation)
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:closed
  • Created 7 years ago
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

0reactions
BenFradetcommented, Jul 3, 2017

My bad I thought the converter was still there, closing 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found