Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic implementation for include and fileds API params #3423

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

georgethebeatle
Copy link
Member

Is there a related GitHub Issue?

No

What is this change about?

Generic implementation for include and fileds API params

  • Includes and fields are very similar. In fact fields is a special case
    of include as we are only returning certain fields of the included
    resource
  • When parsing include and fields params we are combining them to a
    single set of include resource rules
  • There is a central include rule resolver component that fetches all
    the included resources and selects a subset of their fields if needed
  • Relationships are handled by a new relationships repository that looks
    into the resources relationships in order to fetch their related
    resources by guid. This repository delegates all heavy lifting to the
    existing repositories
  • In order to be able to work with collections of resources a new
    Resource interface is introduced that for now can merely fetch a
    resource's relationships. This interface needs to be implemented by
    all repository records for which we want to be able to resolve
    dependencies
  • Currently this is possible only for service_offering and
    service_broker type resources, but it is going to be easy to add new
    resouce types

Does this PR introduce a breaking change?

No

Tag your pair, your PM, and/or team

@danail-branekov

- Includes and fields are very similar. In fact fields is a special case
  of include as we are only returning certain fields of the included
  resource
- When parsing include and fields params we are combining them to a
  single set of include resource rules
- There is a central include rule resolver component that fetches all
  the included resources and selects a subset of their fields if needed
- Relationships are handled by a new relationships repository that looks
  into the resources relationships in order to fetch their related
  resources by guid. This repository delegates all heavy lifting to the
  existing repositories
- In order to be able to work with collections of resources a new
  Resource interface is introduced that for now can merely fetch a
  resource's relationships. This interface needs to be implemented by
  all repository records for which we want to be able to resolve
  dependencies
- Currently this is possible only for service_offering and
  service_broker type resources, but it is going to be easy to add new
  resouce types
@danail-branekov danail-branekov merged commit 79c4845 into main Aug 14, 2024
11 checks passed
@danail-branekov danail-branekov deleted the wip-includes branch August 14, 2024 12:07
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