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

Extend ValidationResult class to allow localization/formatting #157

Open
wmrutten opened this issue Jun 6, 2016 · 5 comments
Open

Extend ValidationResult class to allow localization/formatting #157

wmrutten opened this issue Jun 6, 2016 · 5 comments

Comments

@wmrutten
Copy link

wmrutten commented Jun 6, 2016

ValidationResult currently only exposes an ErrorMessage property. This prevents clients from localizing/formatting the error message.
Proposal:

  • Implement ValidationResult.ErrorId - uniquely identifies each error message
    The API should expose the available error identifiers as public constants

Advanced:

  • Provide access to dynamic error data, e.g. filenames, element names, position etc. so a client can manually format a user-friendly (localized) error message.

Maybe similar implementation to .NET exception classes?

  • Expose a generic Data collection that provides access to dynamic error properties
  • Implement error-specific subclasses with named properties for specific error properties
@brianpos
Copy link

Yes this really needs to be done, and a thorough going through all the error messages to make them more user friendly, not just developer friendly.
(Such as using the display property from the element definition instead of the path/slice name in the messages) and less intimidating words than instance, cardinality, etc

@mmsmits
Copy link
Member

mmsmits commented Aug 12, 2021

This issue is about dotnet attribute validation, not the profile validator, so I removed that label

@ewoutkramer
Copy link
Member

So, the ValidationResult @wmrutten talks about is this one from the .NET framework: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationresult?view=net-5.0

@marcovisserFurore marcovisserFurore transferred this issue from FirelyTeam/firely-net-sdk Aug 1, 2023
@mmsmits
Copy link
Member

mmsmits commented Feb 14, 2024

We have done this right? @ewoutkramer

@ewoutkramer
Copy link
Member

@brianpos and I had a proposal, but I am not sure if it went anywhere.

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

No branches or pull requests

4 participants