Update allowed annotations for getDirections() method
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 768
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
According to the [API specification](https://docs.mapbox.com/api/navigation/directions/#optional-parameters) the `getDirections()` request should allow the following, additional, `annotations`:
- `congestion_numeric`
- `maxspeed` (beta)
- `closure`
Doing so will currently throw the following exception in SDK version 0.13.3:
```plaintext
Uncaught (in promise) Error: Item at position annotations.0 must be "duration", "distance", "speed", or "congestion".
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the getDirections() request validation that restricts annotations, then compare its allowed values with the linked Directions API specification. Update the accepted annotations to include congestion_numeric, maxspeed, and closure, and verify that requests using them no longer raise the reported validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100