googlemaps / googlemaps/openapi-specification

GoogleApi OpenAPI 3 YAML Specification

Offen
#375 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @wangela Auf GitHub ansehen
triage me type: bug
Vorherrschende Sprache
Keine Sprachdaten
Sterne
119
Forks
95
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

#### Issue
When making a request to the Google Autocomplete API A 500 internal error is being thrown by the when the JSON object is being deserialized. The following properties are required in the PlaceAutocompleteStructuredFormat object:
- secondary_text
- main_text_matched_substrings
However Google Autocomple API does not always return these properties in the json model, which is causing the 500 internal error.

#### Environment details
- OpenApi version: 1.17.17
- PlaceAutocompleteStructuredFormat

#### Language and framework
- Dotnet c#

#### Steps to reproduce
1. Request to Google API Autocomplete
2. Google Autocomple API does not always return a secondary_text or main_text_matched_substrings in the JSON response
3. When the JSON response is being deserialized a 500 status code error is being thrown

#### Code example
`
try
{
return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
}
catch (Exception e)
{
throw new ApiException(500, e.Message);
}
}
`

#### Stack trace

![Screenshot 2022-09-09 113918](https://user-images.githubusercontent.com/107129924/189324033-ac69a84f-a065-4372-82fe-09a230307508.png)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.