GLYCAM-Web / GLYCAM-Web/website

JSON API: the Marco and ListEntities services do not conform to schema

Open
#150 4 comments 0 reactions 4 assignees Claimed by @danwentworthart View on GitHub
Dominant language
HTML
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**Tools:**
This is a docs issue as well as a behavior issue. Both are small, but we can split into two bugs as needed.

- API via all access points (via website, via GEMS, etc.).
- Relevant buggy documentation: [https://github.com/GLYCAM-Web/website/blob/7b9db249555017e721249f64d6fb56c741a9cec2/Examples/JsonApi/README.md](https://github.com/GLYCAM-Web/website/blob/7b9db249555017e721249f64d6fb56c741a9cec2/Examples/JsonApi/README.md)

**Bug Description:**
This bug affects two very early tools, _Marco_ and _ListEntities_.

***Marco***
The [request variants](https://github.com/GLYCAM-Web/website/blob/7b9db249555017e721249f64d6fb56c741a9cec2/Examples/JsonApi/marco.json) have always been made correctly. The [JSON responses](https://github.com/GLYCAM-Web/website/blob/7b9db249555017e721249f64d6fb56c741a9cec2/Examples/JsonApi/Example-OUTPUT.marco.json.Response.json), however, break schema by placing the _responses_ object at the top level, equal to _entity_ , _project_, etc.

Also, the _responses_ object should be a dictionary not a list. See also the _services_ complaint under ListEntities, just below.

***ListEntities***
This might only ever be used as a test in our internal development platform, but it should be fixed. In this, the JSON request that has been passing in the tests contains a _services_ object that is a list. It should be a dictionary. Any responses should be made to conform as well.

**Expected behavior**
Requests that do not conform to schema should receive an error response. All responses should be validated against the schema before being returned.

**Additional context**
These two services were written while we were still working out design details. With the new design, we are adhering better to protocols, and these behaviors are (rightly) throwing exceptions.

We don't think many people are using these features widely. If you are, and we broke your workflows, please let us know in the comments and please accept our apologies.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.