azure-sdk-for-ruby icon indicating copy to clipboard operation
azure-sdk-for-ruby copied to clipboard

Calling Azure::CognitiveServices::Autosuggest::V1_0::AutosuggestClient.auto_suggest raises exception

Open v-jaswel opened this issue 6 years ago • 3 comments

  • Package Name: https://github.com/Azure/azure-sdk-for-ruby/tree/master/data/azure_cognitiveservices_customsearch
  • Package Version: 0.17.1
  • Operating system: Windows 10 Enterprise 1803
  • Ruby version: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]

Describe the bug Calling Azure::CognitiveServices::Autosuggest::V1_0::AutosuggestClient.auto_suggest raises an exception. It seems related to deserializing the response.

Exception or Stack Trace

Traceback (most recent call last):
        22: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
        21: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
        20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
        19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
        18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
        17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
        16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'
        15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
        14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
        13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
        12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
        11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
        10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:533:in `block in on_fulfill'
         9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/azure_cognitiveservices_autosuggest-0.17.1/lib/1.0/generated/azure_cognitiveservices_autosuggest/autosuggest_client.rb:677:in `block in auto_suggest_async'
         8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:19:in `deserialize'
         7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:68:in `deserialize'
         6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:169:in `deserialize_composite_type'
         5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:169:in `each'
         4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:180:in `block in deserialize_composite_type'
         3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:68:in `deserialize'
         2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:158:in `deserialize_composite_type'
         1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:34:in `get_model'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:34:in `const_get': wrong constant name Azure::CognitiveServices::Autosuggest::V1_0::Models:: (NameError)
        23: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
        22: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
        21: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
        20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
        19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
        18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
        17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'
        16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
        15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
        14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
        13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
        12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
        11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:533:in `block in on_fulfill'
        10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/azure_cognitiveservices_autosuggest-0.17.1/lib/1.0/generated/azure_cognitiveservices_autosuggest/autosuggest_client.rb:677:in `block in auto_suggest_async'
         9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:19:in `deserialize'
         8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:68:in `deserialize'
         7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:169:in `deserialize_composite_type'
         6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:169:in `each'
         5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:180:in `block in deserialize_composite_type'
         4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:68:in `deserialize'
         3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:158:in `deserialize_composite_type'
         2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:32:in `get_model'
         1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:37:in `rescue in get_model'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:37:in `const_get': wrong constant name MsRestAzure:: (NameError)
        14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
        13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
        12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
        11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
        10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
         9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
         8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'
         7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
         6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
         5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
         4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
         3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
         2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:533:in `block in on_fulfill'
         1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/azure_cognitiveservices_autosuggest-0.17.1/lib/1.0/generated/azure_cognitiveservices_autosuggest/autosuggest_client.rb:674:in `block in auto_suggest_async'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/azure_cognitiveservices_autosuggest-0.17.1/lib/1.0/generated/azure_cognitiveservices_autosuggest/autosuggest_client.rb:679:in `rescue in block in auto_suggest_async': { (MsRest::DeserializationError)
  "exception_message": "wrong constant name MsRestAzure::",
  "message": "Error occurred in deserializing the response",
  "stacktrace": [
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:37:in `const_get'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:37:in `rescue in get_model'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:32:in `get_model'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:158:in `deserialize_composite_type'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:68:in `deserialize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:180:in `block in deserialize_composite_type'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:169:in `each'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:169:in `deserialize_composite_type'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:68:in `deserialize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest-0.7.4/lib/ms_rest/serialization.rb:19:in `deserialize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/azure_cognitiveservices_autosuggest-0.17.1/lib/1.0/generated/azure_cognitiveservices_autosuggest/autosuggest_client.rb:677:in `block in auto_suggest_async'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:533:in `block in on_fulfill'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'",
    "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'"
  ],
  "result": {
    "response": {
      "body": "{\"_type\": \"Suggestions\", \"queryContext\": {\"_type\": \"QueryContext\", \"originalQuery\": \"xb\"}, \"suggestionGroups\": [{\"_type\": \"Suggestions\\/SuggestionGroup\", \"name\": \"Web\", \"searchSuggestions\": [{\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox&FORM=USBAPI\", \"displayText\": \"xbox\", \"query\": \"xbox\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+game+pass&FORM=USBAPI\", \"displayText\": \"xbox game pass\", \"query\": \"xbox game pass\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+reddit&FORM=USBAPI\", \"displayText\": \"xbox reddit\", \"query\": \"xbox reddit\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+live&FORM=USBAPI\", \"displayText\": \"xbox live\", \"query\": \"xbox live\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+one+x&FORM=USBAPI\", \"displayText\": \"xbox one x\", \"query\": \"xbox one x\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+one&FORM=USBAPI\", \"displayText\": \"xbox one\", \"query\": \"xbox one\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+app&FORM=USBAPI\", \"displayText\": \"xbox app\", \"query\": \"xbox app\", \"searchKind\": \"WebSearch\"}, {\"_type\": \"SearchAction\", \"url\": \"https:\\/\\/www.bing.com\\/search?q=xbox+game+pass+ultimate&FORM=USBAPI\", \"displayText\": \"xbox game pass ultimate\", \"query\": \"xbox game pass ultimate\", \"searchKind\": \"WebSearch\"}]}]}",
      "headers": {
        "cache-control": "private, max-age=0",
        "transfer-encoding": "chunked",
        "content-type": "application/json; charset=utf-8",
        "expires": "Tue, 23 Jul 2019 23:22:38 GMT",
        "vary": "Accept-Encoding",
        "p3p": "CP=\"NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND\"",
        "bingapis-traceid": "E594626E599F49ACB4F1C5FC682CC2E6",
        "bingapis-sessionid": "7C7AD3AB7EB54D5AA3DB85E0EC8793A5",
        "x-msedge-clientid": "06BB442FB2E96A861C65498DB3A56B32",
        "x-msapi-userstate": "232b",
        "bingapis-market": "en-US",
        "x-search-responseinfo": "InternalResponseTime=37,MSDatacenter=CO4",
        "x-msedge-ref": "Ref A: E594626E599F49ACB4F1C5FC682CC2E6 Ref B: BY3EDGE0317 Ref C: 2019-07-23T23:23:38Z",
        "apim-request-id": "0822cbf6-7231-4f6a-8bf8-f91f8978c570",
        "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
        "x-content-type-options": "nosniff",
        "date": "Tue, 23 Jul 2019 23:23:38 GMT",
        "connection": "close"
      },
      "status": 200
    },
    "request": {
      "base_uri": "https://westus.api.cognitive.microsoft.com/bing/v7.0",
      "path_template": "Suggestions",
      "method": "get",
      "path_params": null,
      "skip_encoding_path_params": null,
      "query_params": {
        "cc": null,
        "mkt": "en-us",
        "q": "xb",
        "safeSearch": null,
        "setLang": null,
        "ResponseFormat": null
      },
      "skip_encoding_query_params": null,
      "headers": {
        "Content-Type": "application/json; charset=utf-8",
        "Accept": "application/json",
        "accept-language": "en-US",
        "x-ms-client-request-id": "d1d08f85-51da-41f3-b95a-a30292c91df7",
        "X-BingApis-SDK": "true"
      },
      "body": null,
      "middlewares": [
        [
          "MsRest::RetryPolicyMiddleware",
          {
            "times": 3,
            "retry": 0.02
          }
        ],
        [
          "cookie_jar"
        ]
      ],
      "log": null
    }
  }
}

To Reproduce

  1. Get a Bing Autosuggest subscription key.
  2. Set the environment variable AUTOSUGGEST_SUBSCRIPTION_KEY to your subscription key.
  3. Set the environment variable AUTOSUGGEST_ENDPOINT to the endpoint for your subscription key (example: https://westus.api.cognitive.microsoft.com).
  4. Run gem install azure_cognitiveservices_autosuggest.
  5. Copy the following code into a file named auto.rb.
  6. Run ruby auto.rb.

Code Snippet

# encoding: utf-8

require 'azure_cognitiveservices_autosuggest'

if (!ENV["AUTOSUGGEST_SUBSCRIPTION_KEY"])
	raise "Please set/export the following environment variable: AUTOSUGGEST_SUBSCRIPTION_KEY"
else
	subscription_key = ENV["AUTOSUGGEST_SUBSCRIPTION_KEY"]
end
if (!ENV["AUTOSUGGEST_ENDPOINT"])
	raise "Please set/export the following environment variable: AUTOSUGGEST_ENDPOINT"
else
	endpoint = ENV["AUTOSUGGEST_ENDPOINT"]
end

client = Azure::CognitiveServices::Autosuggest::V1_0::AutosuggestClient.new()
client.credentials = MsRestAzure::CognitiveServicesCredentials.new(subscription_key)
client.endpoint = endpoint

result = client.auto_suggest("xb")

# Do something with result

Expected behavior No error.

v-jaswel avatar Jul 24 '19 00:07 v-jaswel

@v-jaswel Hello. Thanks for opening this issue. I will check this issue.

mmyyrroonn avatar Jul 24 '19 02:07 mmyyrroonn

@v-jaswel Hello. I'm not sure whether I can get the Bing Autosuggest subscription key or not. I cannot debug the code for now. I checked the stack trace and checked the code. It seems that the value model_name is empty in the "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ms_rest_azure-0.11.1/lib/ms_rest_azure/serialization.rb:37:in rescue in get_model. Could you help me debug to confirm the value of that variable? This file ms_rest_azure/serialization.rb has not been changed for three years. So I think this issue deserve service attention.

mmyyrroonn avatar Jul 25 '19 06:07 mmyyrroonn

Hi @MyronFanQiu, apologies for the delayed response, we are trying to continue work on correcting bugs for this sample, so I can continue this process with you. I debugged and found the value for model_name, it is Suggestions. I know that is the last word added to the endpoint for the query, as observed in other languages implementing this exact sample. Does that mean anything to you? Thanks.

This is where I put the print statement, only the first one actually prints:

def get_model(model_name)
        begin
          Object.const_get(@context.class.to_s.split('::')[0...-1].join('::') + "::Models::#{model_name}")
          puts "DEBUG, DEBUG, DEBUG, DEBUG: " + model_name
        rescue NameError
          # Look into MsRestAzure namespace if model name not found in the ARM's models namespace
          puts "DEBUG DEBUG DEBUG: " + Object.const_get("MsRestAzure::#{model_name}")
        end
      end

wiazur avatar Dec 18 '19 21:12 wiazur

Thank you for your interest in Azure SDKs. As detailed in this retirement announcement, this repo is no longer supported as of December 31st 2021. Please find the up-to-date list of languages and services supported with Azure SDKs here: https://aka.ms/azsdk

kurtzeborn avatar Jan 11 '23 03:01 kurtzeborn