I'm implementing a new feature. During onboarding of new users, their SSN's validity…
- User
I'm implementing a new feature. During onboarding of new users, their SSN's validity should be checked, but only if they belong to certain departments. So the department ID is needed to determine if to validate the user ID at all or not. My dilemma is: Should I (a) change the API signature of creating and updating a user to include the department ID, which would be a breaking change? Or should I rather (b) add a separate API endpoint for validating the user data and have all clients call that validation endpoint beforehand?
Assistant
Here are a few factors to consider when deciding between these two options:
-
Impact on existing clients: A breaking change like option (a) may require existing clients to modify their code, which can be time-consuming and potentially disruptive. Option (b) would not require any changes to existing clients, as they would only need to call the new validation endpoint when necessary.
-
Performance considerations: Option (a) may be more efficient, as it would allow the department ID to be validated along with the other user data in a single API call. Option (b) would require an additional API call to validate the department ID, which could impact performance if the validation needs to be done frequently.
-
Future-proofing: Option (b) may be more flexible in the future, as it would allow for additional validation checks to be added without requiring clients to modify their code. Option (a) may be more limited in this regard, as any additional validation checks would require a breaking change to the API.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.