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

Add fuzzy string matching for identifying misspelled properties. #593

Open
jautor opened this issue Jul 13, 2024 · 3 comments
Open

Add fuzzy string matching for identifying misspelled properties. #593

jautor opened this issue Jul 13, 2024 · 3 comments

Comments

@jautor
Copy link
Member

jautor commented Jul 13, 2024

I've seen numerous instances in product testing where a property name was misspelled. Usually this is a capitalization error or a one-letter transposition. If the tool can be enhanced to attempt a fuzzy string match (check thefuzz python module and the process.extractOne function) when it finds an unknown property - it could replace the misspelled property (flagged as wrong of course) with the best match and attempt further validation.

That would allow any value errors to also be reported, instead of requiring the property names to be corrected prior to validating the value. This would be especially useful when navigation properties are misspelled, as that prevents the tool from traversing the tree (and therefore skips testing on entire resources).

@tomasg2012
Copy link
Contributor

I believe this is still a feature in the service validator with the function "get_fuzzy_property" but maybe it's not getting certain examples. It will adjust RedfishVersion from ReedfishVersion and redfishversion and report an error if it was incorrect (example, an int and not a string). It will always report it as "invalidNamedProperty"

@jautor
Copy link
Member Author

jautor commented Jul 15, 2024

Oh, good, I guess I haven't seen it "in action"... It doesn't seem to be working on @odata.id misspellings within navigation links. I'm guessing it's not being applied to annotations?

As in:

   "Chassis": {
         "@odata.Id": "/redfish/v1/Chassis"
   }

(the odata.id has a capital "I" in this example)

@tomasg2012
Copy link
Contributor

It isn't used in every place a property is looked for, usually odata is handled separately. Can preprocess a payload to catch missing odata early on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants