Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vicradon/csv-parser-api
An API for parsing CSV and returning a JSON object
https://github.com/vicradon/csv-parser-api
Last synced: 27 days ago
JSON representation
An API for parsing CSV and returning a JSON object
- Host: GitHub
- URL: https://github.com/vicradon/csv-parser-api
- Owner: vicradon
- Created: 2021-02-08T17:52:06.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-16T09:15:44.000Z (almost 4 years ago)
- Last Synced: 2024-04-28T06:35:52.480Z (8 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Osinachi Chukwujama Take Home Documentation
This is a web service which converts CSV to JSON and returns the required JSON fields.
It comes with this documentation and unit tests using Jest and supertest.## Routes
1. `POST /`
### `POST /`
#### Parameters
1. csv: required (JSON object)
1. url: required (string)
2. select_fields: optional (string[])#### Example request body
```json
{
"csv": {
"url": "https://linktocsv",
"select_fields": ["First Name", "Last Name", "Age"]
}
}
```#### Example response object
```json
{
"conversion_key": "ZEMAHBb54vkFXPHA9jHY6Xp3gMnMAKYg",
"json": [
{
"First Name":"Ade",
"Last Name":"Stark",
"Age": 21
},
{
"First Name":"Ade",
"Last Name":"Stark",
"Age": 21
}
]
}
```## Running tests
To run tests, run this command
```bash
npm test
```## Test suites covered
1. Testing the Post endpoint
### Testing the Post endpoint
1. Testing that it returns the correct status code
2. Testing that the returned JSON is of the required schema