Upgrade API usage to v3 for Discovery - #174
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the app’s Discovery API integration to the v3 discovery endpoint and adapts the Android client models/UI to the updated discovery response shape (notably providers and localized names represented as structured items).
Changes:
- Switch discovery endpoint usage from
/v2/discovery.jsonto/v3/discovery.json. - Update discovery parsing from
institutionstoprovidersand bump the discovery content@SerialNameto v3. - Replace
name: Map<String,String>withname: List<LocalizedName>acrossOrganization/Profileand adjust call sites.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates documentation to reference the v3 discovery URL. |
| android/app/src/main/java/app/eduroam/geteduroam/di/api/GetEduroamApi.kt | Points Retrofit discovery call at v3/discovery.json. |
| android/app/src/main/java/app/eduroam/geteduroam/models/DiscoveryResult.kt | Updates serialized content key to discovery#v3. |
| android/app/src/main/java/app/eduroam/geteduroam/models/DiscoveryContent.kt | Renames discovery list field to providers. |
| android/app/src/main/java/app/eduroam/geteduroam/models/LocalizedName.kt | Introduces a Parcelable/Serializable localized name structure. |
| android/app/src/main/java/app/eduroam/geteduroam/models/Profile.kt | Migrates profile name storage to List<LocalizedName> and updates localization lookup. |
| android/app/src/main/java/app/eduroam/geteduroam/models/Organization.kt | Migrates organization name storage to List<LocalizedName> and updates search/localization helpers. |
| android/app/src/main/java/app/eduroam/geteduroam/organizations/SelectOrganizationViewModel.kt | Uses content.providers instead of content.institutions. |
| android/app/src/main/java/app/eduroam/geteduroam/organizations/SelectOrganizationScreen.kt | Updates construction of Organization.name to use LocalizedName. |
| android/app/src/main/java/app/eduroam/geteduroam/profile/SelectProfileViewModel.kt | Switches institution lookup to content.providers and updates custom-host profile name creation. |
| android/app/src/main/java/app/eduroam/geteduroam/profile/SelectProfileScreen.kt | Updates preview/demo profile objects to the new name representation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
42
to
46
| val userLanguage = Locale.getDefault().language.lowercase() | ||
| return name[userLanguage] ?: // 1st option: the name in the user's language | ||
| name[LANGUAGE_KEY_FALLBACK] ?: // 2nd option: the name in the fallback language (english) | ||
| name.values.firstOrNull() ?: // 3rd option: any name we can find | ||
| return name.find { it.lang == userLanguage }?.display ?: // 1st option: the name in the user's language | ||
| name.find { it.lang == null }?.display ?: // 2nd option: the name in the fallback language | ||
| name.firstOrNull()?.display ?: // 3rd option: any name we can find | ||
| id // 4th option: the ID, which is always set |
Comment on lines
26
to
30
| val userLanguage = Locale.getDefault().language.lowercase() | ||
| return name[userLanguage] ?: // 1st option: the name in the user's language | ||
| name[LANGUAGE_KEY_FALLBACK] ?: // 2nd option: the name in the fallback language (english) | ||
| name.values.firstOrNull() ?: // 3rd option: any name we can find | ||
| return name.find { it.lang == userLanguage }?.display ?: // 1st option: the name in the user's language | ||
| name.find { it.lang == null }?.display ?: // 2nd option: the name in the fallback language | ||
| name.firstOrNull()?.display ?: // 3rd option: any name we can find | ||
| id // 4th option: the ID, which is always set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings app up to parity with the apps for other platforms.