Skip to content

Enums occasionally have extra values, but this client's serialisation won't handle that #29

@robfe

Description

@robfe

Enums like Job.Status

public JobStatusEnum? Status { get; init; }
can occasionally have the ATS's raw value passed through if the value isn't mapped

Yash Gogri at Merge helped me understand this in a prior email conversation:
image

In the situations where there may be custom values set up by the end-user, Merge will not have those enums mapped (since they aren't standard). In those situations, we will return the raw value from the API. While our Platform team aims to map as much values into the enums as possible, it's always possible a new customer can have a custom set-up where their status values don't fall into what's been already mapped. 
Screenshot 2023-12-11 at 11.11.33 AM.png

Due to this, we do recommend keeping additional checks / leniency around enum values. Many of our customers implement fuzzy matching on top of our enums whenever a raw value gets returned. Some customers actually during their onboarding process directly ask their customers what Status Values they use in their system and how they'd like that reflected in the product. From there, they'll use our show_enum_origins parameter to always return the raw value and map those accordingly based on the customer's ask. 

Is it possible to implement such leniency in this client, perhaps Job.Status should be a OneOf string / JobStatus enum?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions