Skip to content

Conversation

realtyem
Copy link
Contributor

@realtyem realtyem commented Aug 29, 2025

While exploring bring up of using orjson, exposed an interesting flaw. The stdlib json encoder seems to be ok with coercing a str from an Enum(specifically, a Class[str, Enum]). The orjson encoder does not like that this is a class and not a proper str per spec. Using the .value of the enum as the key for the dict produced while answering a GET admin request for experimental features seems to fix this.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@realtyem realtyem requested a review from a team as a code owner August 29, 2025 14:07
@realtyem realtyem changed the title fix: Use the Enum 'value' to set the key for the dict fix: Use the Enum's value for the dictionary key when responding to an admin request for experimental features Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant