mapbox / mapbox/mapbox-sdk-js

createUpload returns 422 response from API with `The request body contains the invalid property "private"`

Open
#392 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

upstream
Dominant language
JavaScript
Stars
768
Forks
191
PR merge metrics
No merged PRs in 30d

Description

I am getting this error when calling the createUpload method. Version "mapbox": "^1.0.0-beta9". I didn't know if this was the right place to put this comment.

` await uploadsClient
.createUpload({
mapId: ${userName}.${sources[0].tilesetName},
url: s3Creds.url,
tilesetName: sources[0].fileName
})
.send();`

`MapiError {
message: 'The request body contains the invalid property "private".',
type: 'HttpError',
statusCode: 422,
request:
MapiRequest {
id: 34,
_options:
{ method: 'POST',
path: '/uploads/v1/:ownerId',
body:
{ url:
'https://tilestream-tilesets-production.s3.amazonaws.com/',
tileset: '',
name: '',
private: true } },
emitter: EventEmitter { _events: {}, _eventsCount: 0 },
client:
NodeClient {
accessToken:
'',
origin: 'https://api.mapbox.com' },
response: null,
error: [Circular],
sent: true,
aborted: false,
path: '/uploads/v1/:ownerId',
method: 'POST',
origin: 'https://api.mapbox.com',
query: {},
params: {},
body:
{ url:
'https://tilestream-tilesets-production.s3.amazonaws.com/',
tileset: '',
name: '',
private: true },
file: null,
encoding: 'utf8',
sendFileAs: null,
headers: { 'content-type': 'application/json' } },
body:
{ message: 'The request body contains the invalid property "private".' }
}`

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 with the provided uploadsClient.createUpload reproduction and inspect the generated POST request body for the private property. Check the SDK's upload request handling against the API's accepted properties; done means the documented call no longer receives the 422 invalid-property response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.