Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Implement basic manifest API #499

Open
ekigamba opened this issue Aug 6, 2019 · 0 comments
Open

Implement basic manifest API #499

ekigamba opened this issue Aug 6, 2019 · 0 comments
Assignees

Comments

@ekigamba
Copy link

ekigamba commented Aug 6, 2019

The Manifest API will have the following endpoints:

  • Search
  • Add/Edit

Add endpoint

This endpoint enables you to publish a new manifest. This endpoint is accessible by admins authenticated via basic auth. The folllowing params should be passed to the add endpoint:

This is a POST request where you just pass the Json Object

JSON Property Data type Mandatory Description
app_version String Yes This is the semantic version of the client app
data_model_version String Yes This is the semantic version of the data model of the client app
migration_scripts_version String Yes This is the semantic version of the migration scripts on the client app
forms_version String Yes This is the semantic version of the forms on the client app

The endpoint will return a 201 in case the operation was a success
The endpoint will return a 400 in case the operation failed and a message in the body

The add endpoint will return a 400 if:

  • Either of the manifest is not provided OR empty
  • Either of the mandatory properties of the JSON is not provided or of the wrong data type
  • The app_version property does not follow semantic versioning
  • The forms_version property does not follow semantic versioning
  • The data_model_version property does not following semantic versioning
  • The migration_scripts_version property does not follow semantic versioning

Search endpoint

The search endpoint enables the client app to check if there is a newer client app configuration published for it's app_version.

This is a GET request

PARAM NAME Data type Mandatory Description
app_version String Yes This is client app version
form_version String Yes This is the client app's current form version being used
data_model_version String Yes This is the client app's current version of the data model being used
migration_scripts_version String Yes This is the client app's current version of migration scripts

The endpoint will return a 200 and:

  • the latest manifest for the app_version as JSON with the header Content-Type holding application/json - if the form_version in the latest manifest is higher than the one sent by the client_app
  • Empty body meaning that the client app has the latest configuration

The add endpoint will return a 400 if:

  • Either of the mandatory params is not provided, empty or provided in the wrong format(500 error in case we do not catch this)
  • The app_version does not follow semantic versioning
  • The forms_version does not follow semantic versioning
  • The data_model_version does not following semantic versioning
  • The migration_scripts_version does not follow semantic versioning
@ekigamba ekigamba assigned ekigamba and paulinembabu and unassigned ekigamba Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants