-
Notifications
You must be signed in to change notification settings - Fork 39
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
SearchWithQ(* string) returns err: 'uritemplate:55:invalid literals' #114
Comments
Hi @mkanderson, |
Ok, thanks. I've commented in the library issue. |
Hi guys, just trying to understand the current status of this as we're really keen to use this library if possible... Is there an alternative to this library given this issue prevents it being used and hasn't moved since December? Understand the aforementioned issue is in a remote dependency, but couldn't this be easily be replaced if the author isn't responsive? Is it a case that MS aren't fussed about golang, or is there anyone cause for the lack of time spent on this? Just keen to understand if we need to avoid Azure AD for the near future. Thanks 🙇 🙏 |
Our experience is currently that v0.18.0 uses reflection to determine the query parameters, but isn't prepending the "$" so throws the error:
Apologies if this is a new issue and not related to this ticket, but I think it might be the same issue even if a different cause in the latest code. Any help working around this would be greatly appreciated. |
hi @tommed
The author replied a while ago now. The issue is that the RFC6570 contradicts itself. We've reached out to the author of the RFC but no conclusive resolution has been reached yet. I'll try nudging the authors Sorry this is taking so long, it's a very specific issue. |
Sure, it happens for all the query parameters, not just those mentioned. search, expand etc. |
URL templating seems a pretty small piece of functionality to halt the entire sdk up for.. is there not just an alternative if you aren't getting responses. A library of this magnitude shouldn't be held hostage by a smaller dependency - imagine if the dependency has security issues and needs patching 😬 |
again, at this point we haven't established the library is defective but that the RFC is unclear on this very specific character
Right now the impact on the SDK itself it limited to OData functions with string/date parameters, which is probably less than 5% of the overall API surface. Now, I understand this impacts your ability to move forward, may I suggest the following workaround to unblock you for the time being? searchString := "foo"
requestBuilder := search.NewSearchWithQRequestBuilder("https://graph.microsoft.com/v1.0/drives/"+driveId+"/microsoft.graph.search(q=%27"+seachString+"%27)", requestAdapter)
drive, err := requestBuilder.Get(&search.SearchWithQRequestBuilderGetOptions{
Options: abstractions.RequestOption[]{&kiotahttp.ParametersNameDecodingOptions{
Enable: true,
ParametersToDecode: []byte{'-', '.', '~', '$', '\''},
},
})
// kiotahttp is an import of github.com/microsoft/kiota-http-go
// search is an import of microsoftgraph/msgraph-sdk-go/drives/item/searchwithq
// abstractions is an import of github.com/microsoft/kiota-abstractions-go |
update on the single quote issue, it took longer than expected because the actual RFC contained a mistake. After clearing this with the authors we're in the process of issuing an errata for the RFC and I've opened a PR on the uri template lib |
update, the URI template library PR has been merged. Put together #138 which will close this issue once merged. |
Calling the `SearchWithQ(* string) method so:
returns
'uritemplate:55:invalid literals'
It appears that the single quotes in
msgraph-sdk-go/drive/searchwithq/search_with_q_request_builder.go
Line 29 in e9f3586
are not recognized as valid characters by
https://github.com/yosida95/uritemplate/blob/3a84360807fa88737fe714e7ad55f7469ab8ecc9/parse.go#L45
The text was updated successfully, but these errors were encountered: