microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

[Auto-Complete] Investigate the validation of URL using ABNF syntax

Open RabebOthmani opened this issue 3 years ago • 6 comments

Currently, our only validate white spaces in URLs ( to be confirmed with developers). The aim is to have a full on validation using the ABNF syntax

RabebOthmani avatar May 31 '22 13:05 RabebOthmani

Yes. We currently only raise invalid whitespace error. What kind of extra validation are we looking at @RabebOthmani? ABNF is a bit general

Onokaev avatar Jun 10 '22 14:06 Onokaev

@Onokaev ABNF itself is generic, but this ABNF description https://github.com/oasis-tcs/odata-abnf/blob/main/abnf/odata-abnf-construction-rules.txt is specific to validating OData. It contains specific syntax rules for OData URLs including validating query parameter values.

darrelmiller avatar Jun 17 '22 03:06 darrelmiller

@Onokaev Do you feel like you have clarity on the task with the link provided by Darrel? Let me know if you need further details

RabebOthmani avatar Jun 23 '22 14:06 RabebOthmani

Hey @RabebOthmani, @thewahome picked this up since he is already working on autocomplete.

Onokaev avatar Jun 27 '22 06:06 Onokaev

@darrelmiller @RabebOthmani I do not yet know how the ABNF syntax is going to help us with validation. Calling this out as something that will slow down this task

thewahome avatar Jul 14 '22 08:07 thewahome

@thewahome Libraries like apg-js are designed to create parsers from ABNF syntax. Here is an example of using the OData abnf to parse any part of an OData request https://github.com/ldthomas/apg-js-examples/tree/main/src/odata We only care about the parsing of the URL. With a library like this and the ABNF we can accurately parse an OData URL without having to do any of the work and it will accurately handle complex things like nested expands and filter expressions.

darrelmiller avatar Jul 14 '22 12:07 darrelmiller

I am closing this since the investigation was successful and documented in a technical document.

A PR exists that attempts to implement the findings for this under #2044

thewahome avatar Sep 27 '22 11:09 thewahome