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

Provide possible suggestions for unknown fields #1106

Merged
merged 2 commits into from
Jun 23, 2020

Commits on Jun 20, 2020

  1. Provide possible suggestions for unknown fields

    I've updated the deserialization to provide a list of suggestions for unknown field names. This uses the Fastenshtein library to calculate the edit distance between the field name entered by a user and the possible fields.
    
    I've chosen to return fields if they have an edit distance less than 3. This is fairly arbitrary and just based on some simple testing. I wanted to provide suggestions, but not provide ones that were completely different to the name entered.
    
    Also:
    
    - Updated the V1Deserializer to use the `Map()` syntax for mapping rather than doing everything manually. The main reason for this was so that the fields are added as suggestions, although it also removes some unnecessary code.
    - Altered MetricsDeclarationProvider to not set the defaults if validating the metrics fails. The reason I've done this is that if the metric defaults couldn't be deserialized, we end up with a NullReferenceException.
    
    Fixes tomkerkhove#1105
    adamconnelly committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    b877cf8 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2020

  1. Configuration menu
    Copy the full SHA
    7e799e6 View commit details
    Browse the repository at this point in the history