mapbox / mapbox/mapbox-sdk-js

Update allowed annotations for getDirections() method

Open Beginner friendly
#435 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.