Skip to content

[ENG-11256] Improve models structure#998

Open
nsemets wants to merge 6 commits into
CenterForOpenScience:feature/pbs-26-9from
nsemets:refactor/ENG-11256
Open

[ENG-11256] Improve models structure#998
nsemets wants to merge 6 commits into
CenterForOpenScience:feature/pbs-26-9from
nsemets:refactor/ENG-11256

Conversation

@nsemets
Copy link
Copy Markdown
Collaborator

@nsemets nsemets commented May 27, 2026

Summary of Changes

  1. Updated JSON:API models.
  2. Created reusable models.
  3. Split models for better readability.
  4. Update unit tests.

@nsemets nsemets requested a review from brianjgeiger May 27, 2026 14:43
Comment on lines -25 to +27
provider: response.embeds?.provider?.data.id,
provider: response.relationships?.provider?.data?.id,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If the OSF API still returns provider inside embeds (not relationships), this will silently return undefined at runtime without a type error. This is a behavioral change that needs explicit confirmation the API contract was updated, or a note about why this was safe to change.

Comment on lines +52 to +55
interface MetadataEmbedsJsonApi {
identifiers: IdentifiersResponseJsonApi;
license: Embed<LicenseDataJsonApi>;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The old embed interface included affiliated_institutions: InstitutionsJsonApiResponse The new one only has identifiers and license. If any mapper or component reads embeds.affiliated_institutions, it will break silently. Worth searching for usages before merging.

}

interface MetadataEmbedsJsonApi {
affiliated_institutions: InstitutionsJsonApiResponse;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

affiliated_institutions has been removed from MetadataEmbedsJsonApi. The old interface included affiliated_institutions: InstitutionsJsonApiResponse. If any mapper or component reads embeds.affiliated_institutions anywhere, it will now break silently at runtime. Please confirm there are no remaining usages before merging.

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.

2 participants