Description
Return well-formed JSON responses for the following API endpoints using the GET HTTP request method:
- GET /
- Redirects to GET /instruments
- GET /instruments
- Shows the lists of all instruments as an HTML table.
- See "catalog" in Figma for the proposed design.
- GET /instrument/$slug
- Sanitize $slug. Fetch the details of the instrument with slug=$slug. If there is no instrument, then return an HTTP 404 Not Found response. Otherwise, show the details of an instrument.
- See "new instrument – modify" in Figma for the proposed design.
GET /instrument/createShows the HTML form to create an instrument (herein “the form”). Since the form is state-changing, a fresh double-submit cookie is sent with the response.See "new instrument – template" in Figma for the proposed design.
- GET /api/v1/instruments
- Shows the list of all instruments as a JSON-encoded list.
- This route does not require authentication or authorization.
Note: All routes require authentication and authorization except where noted otherwise.
Use Case
These JSON responses will be used by the frontend application aka Metrics Platform Instrument Configurator (MPIC) to retrieve data.
User Story/ies
As an engineer, I'd like to get well-formed JSON responses when hitting the MPIC API endpoints using GET HTTP methods so that the frontend UI can process requests.
Outcome
Submitting a GET HTTP request returns well-formed JSON per the data models outlined in the design document.
Acceptance Criteria
- All GET endpoints return properly formatted JSON
Required
- Unit/Integration tests
- Testing Instructions
- Documentation
- Passed QA
Technical Notes
TK
Dependencies
- We can stub responses during development - once the datastore is active, data should be fetched from there instead.