createUpload returns 422 response from API with `The request body contains the invalid property "private"`
Nobody has claimed this yet.
- 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
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 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