Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enums parsing #2600

Open
portuu3 opened this issue Oct 7, 2024 · 0 comments
Open

Enums parsing #2600

portuu3 opened this issue Oct 7, 2024 · 0 comments
Assignees

Comments

@portuu3
Copy link
Collaborator

portuu3 commented Oct 7, 2024

Description
We need to modify the API to parse enum values in incoming payloads, allowing them to be accepted in both lowercase and uppercase formats. This will ensure that the API is more flexible and tolerant to input variations, improving the user experience and reducing potential errors from case mismatches.

Motivation
Currently, our API only accepts enum values in a specific case format (either upper or lowercase, depending on the enum). By supporting both lowercase and uppercase inputs for enums, we can:

  • Improve compatibility.
  • Reduce the likelihood of payload rejection due to simple case mismatches.
  • Make the API more user-friendly, especially when integrating with third-party services that may not enforce strict casing rules.

Implementation details

  • Apply it for Job Launcher, Fortune Exchange Oracle, Fortune Recording Oracle, Reputation Oracle, HUMAN App backend.
  • Modify the enum parsing logic in the request handler to be case-insensitive.
  • Ensure that all enum values are normalized internally (converted to lowercase for consistent processing).
  • Add unit tests to verify that enum values in both uppercase and lowercase are accepted.
  • Ensure backward compatibility with existing functionality to avoid breaking any current integrations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

No branches or pull requests

2 participants