Skip to content

As a user, I want to use the API client with its compliant server deployment #16

@tloubrieu-jpl

Description

@tloubrieu-jpl

💪 Motivation

...so that I can make the API work without refering to complex documentation or asking for support from ENG node.

📖 Additional Details

⚖️ Acceptance Criteria

Given a version X.Y.Z of the API client
When I perform when I deploy it and use it
Then I expect it to find its server compliant implementation

⚙️ Engineering Details

We want the following repositories:

NOTE: better repository names should be found

  • the pds-api-client repository independent from the API version, this should be the framework to publish a client package compliant with a given openapi specification (in pds-api repository), in a swagger file and push it to pypi automatically (with github action)
  • the registry-api-client repository is a wrapper of the pds-api-client in which:
  • the dependency to the pds-api-cliemt is given with version number (matching with the spec version)
  • the url of the reference implementation are hardcoded (or in configuration) so that when used the client directly connects to the proper implementation (unless overriden).
  • the wrapper repository code should also check in the API responses that the version is compliant with the server and raise warnings if not.

For api-client:
1 submodule for each application (e.g. registry, doi, ...)
For each submodule (eg products, doi) have:

  1. Default url
  2. Default version
    Override endpoints object, eg CollectionsApi
    With an object with default constructor with no param,
    using default url + version host configuration for it's API client
Import collectionApi

Orig_collection_api = collectionApi
Class CollectionApi(Orig_collection_api)
    __init__(api_client=None):
       If not api_clent:
           configuration = Configuration()
           configuration.host = 'http://pds-gamma.jpl.nasa.gov/api/' + version
           api_client = ApiClient(configuration)

           Super().__init__(api_client)

For endpoint in endpoints:
    <create all overriden classes>

Metadata

Metadata

Assignees

Type

No type

Projects

Status

ToDo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions