Skip to content

Conversation

@samuelpx
Copy link
Contributor

@samuelpx samuelpx commented Feb 4, 2025

Reason for PR:

While testing using a sandbox application, the following error was observed:

Exception in thread "main" com.squareup.moshi.JsonDataException: Expected one of [production, staging] but was sandbox at path $.data.environment
at com.squareup.moshi.StandardJsonAdapters$EnumJsonAdapter.fromJson(StandardJsonAdapters.java:296)
at com.squareup.moshi.StandardJsonAdapters$EnumJsonAdapter.fromJson(StandardJsonAdapters.java:264)
at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:58)
at com.nylas.NylasClient.executeRequest(NylasClient.kt:357)
at com.nylas.NylasClient.executeGet(NylasClient.kt:202)
at com.nylas.NylasClient.executeGet$default(NylasClient.kt:195)
at com.nylas.resources.Applications.getDetails(Applications.kt:31)
at com.nylas.resources.Applications.getDetails$default(Applications.kt:28)
at com.nylas.resources.Applications.getDetails(Applications.kt)
at com.example.NylasTest.main(NylasTest.java:8)

This PR should correct the error and make testing easier for new users

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.28%. Comparing base (2291e46) to head (7268ca1).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #264   +/-   ##
=========================================
  Coverage     81.28%   81.28%           
  Complexity      316      316           
=========================================
  Files            35       35           
  Lines           967      967           
  Branches         88       88           
=========================================
  Hits            786      786           
  Misses          129      129           
  Partials         52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samuelpx samuelpx merged commit 5d0a7fd into nylas:main Feb 4, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants