Skip to content

Upgrade API usage to v3 for Discovery - #174

Merged
SanderVeer merged 3 commits into
mainfrom
feature/discovery-v3-support
Jul 24, 2026
Merged

Upgrade API usage to v3 for Discovery#174
SanderVeer merged 3 commits into
mainfrom
feature/discovery-v3-support

Conversation

@SanderVeer

Copy link
Copy Markdown
Collaborator

Brings app up to parity with the apps for other platforms.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json to /v3/discovery.json.
  • Update discovery parsing from institutions to providers and bump the discovery content @SerialName to v3.
  • Replace name: Map<String,String> with name: List<LocalizedName> across Organization/Profile and 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 4c78c5f.

@SanderVeer
SanderVeer merged commit dfaffc3 into main Jul 24, 2026
1 check passed
@SanderVeer
SanderVeer deleted the feature/discovery-v3-support branch July 24, 2026 07:45
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