Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2. Get One Market #2

Closed
JorjaF opened this issue Aug 28, 2023 · 0 comments
Closed

2. Get One Market #2

JorjaF opened this issue Aug 28, 2023 · 0 comments

Comments

@JorjaF
Copy link
Owner

JorjaF commented Aug 28, 2023

Details:
This endpoint should follow the pattern of GET /api/v0/markets/:id.
If a valid market id is passed in, all market attributes, as well as a vendor_count should be returned.
If an invalid market id is passed in, a 404 status as well as a descriptive error message should be sent back in the response.

example 1
Request:

 GET /api/v0/markets/322458
 Content-Type: application/json
 Accept: application/json

Response: status: 200

{
"data": {
"id": "322458",
"type": "market",
"attributes": {
"name": "14&U Farmers' Market",
"street": "1400 U Street NW ",
"city": "Washington",
"county": "District of Columbia",
"state": "District of Columbia",
"zip": "20009",
"lat": "38.9169984",
"lon": "-77.0320505",
"vendor_count": 1
}
}
}

Example #2 😭
Request:

 GET /api/v0/markets/123123123123 (where `123123123123` is an invalid Market id)
 Content-Type: application/json
 Accept: application/json

Response: status: 404

{
"errors": [
{
"detail": "Couldn't find Market with 'id'=123123123123"
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant