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

Adding generic version entities for SFS API Responses #91

Merged

Conversation

arthuraraujo-msft
Copy link
Contributor

Helps #50

For the same APIs, SFS will start sending different fields in the response. which may or not be present. While an offline discussion goes on about how the client should specify which entity it wants, we must be able to parse the different responses to be ready for the App version changes.

For example:

Generic Version Entity:

{
  "ContentId": {
    "Namespace": "default",
    "Name": "<name>",
    "Version": "<version>"
  }
}

App Version Entity:

{
  "ContentId": {
    "Namespace": "default",
    "Name": "<app name>",
    "Version": "<version>"
  },
  "UpdateId": "<id>",
  "Prerequisites": [
    {
      "Namespace": "default",
      "Name": "<prereq name>",
      "Version": "<version>"
    }
  ]
}

In order to avoid creating one implementation for each entity, I'm switching the 1:1 APIs to return more generic entities that can be mapped to a single entity. The API implementations won't be aware of the types, that will only be taken care of during parsing from the server, and during transformation in the final step.

For this PR I'm adding a Generic entity, which is the current response schema of SFS. The App version entity should be coming next.

@arthuraraujo-msft arthuraraujo-msft requested a review from a team as a code owner February 28, 2024 18:58
client/src/SFSClient.cpp Show resolved Hide resolved
client/src/SFSClient.cpp Show resolved Hide resolved
client/src/SFSClient.cpp Show resolved Hide resolved
client/src/SFSClient.cpp Outdated Show resolved Hide resolved
client/src/details/SFSClientImpl.cpp Show resolved Hide resolved
client/src/details/SFSClientImpl.cpp Show resolved Hide resolved
client/src/details/SFSClientImpl.cpp Show resolved Hide resolved
client/src/details/SFSClientImpl.cpp Outdated Show resolved Hide resolved
client/src/details/SFSClientImpl.cpp Show resolved Hide resolved
client/src/details/SFSClientImpl.cpp Show resolved Hide resolved
client/src/SFSClient.cpp Show resolved Hide resolved
@arthuraraujo-msft arthuraraujo-msft force-pushed the user/arthuraraujo/adding-response-interfaces branch from 3d0e3a7 to 5b5899b Compare March 7, 2024 11:30
@arthuraraujo-msft arthuraraujo-msft merged commit e89d0ad into main Mar 7, 2024
3 checks passed
@arthuraraujo-msft arthuraraujo-msft deleted the user/arthuraraujo/adding-response-interfaces branch March 7, 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.

4 participants