https://github.com/apideck-libraries/connector-test
https://github.com/apideck-libraries/connector-test
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/apideck-libraries/connector-test
- Owner: apideck-libraries
- Created: 2022-07-14T11:13:49.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-15T06:15:45.000Z (12 months ago)
- Last Synced: 2025-03-22T06:27:11.157Z (3 months ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 1
- Watchers: 6
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Assignment
## Description
Today we are mapping a SpaceX rocket to a unified model.
This application represents a [Unified API](https://blog.apideck.com/what-is-a-unified-api) with two configured endpoints:
- GET `/hello`
- GET `/space/rockets/{rocket-id}`If you try out the current app locally using cURL, Postman or another API Client, you'll see that only one is implemented. It's your task to implement the other endpoint.
## Steps to take:
1. Find a working SpaceX API, it's publicly available.
2. Add an [OpenAPI spec](https://swagger.io/specification/) of the SpaceX API that contains all the needed info to connect to it. This spec should be added to the `/src/services/spaceX` folder. Only add the needed info, the full spec is not needed. As our own API is also based on OpenAPI, you can use that as a reference.
3. Add the `rocketsOne` operation to the code base and implement the logic to execute the SpaceX request. Try to use your newly created spaceX spec for this, you can use one or more functions in the utils folder to use this spec.
4. Map the incoming SpaceX response to the Unified model described in theJSON schema you find in the `/unify` folderIn the end, we should be able to execute a GET call to retrieve the needed rocket information in the correct format.
Also make sure the company property is always uppercase.
## Requirements:
- Avoid the use of `any`
- Write tests
- Introduce proper error handling
- Ensure the API interaction is secure and efficiently handles possible errors or data inconsistencies.
- Document the setup and usage instructions clearlyBONUS: Test the implementation locally using tools like [Portman](https://github.com/apideck-libraries/portman).
In the end, this is a simple test, so focus on code quality and don't hold back from going the extra mile.
Good luck!