fuxingloh / airtable

A lightweight Java 8 Airtable API client for https://airtable.com/api with all features implemented.
Apache License 2.0
20 stars 2 forks source link

Fix fields method to follow airtable spec #6

Closed minorgod closed 2 years ago

minorgod commented 2 years ago

When adding fields[21] (more than 21 fields), airtable API throws an error such as:

{
    "error": {
        "type": "INVALID_REQUEST_UNKNOWN",
        "message": "Invalid request: parameter validation failed. Check your request data."
    }
}

Don't ask me why this breaks airtable, but according to the airtable api docs, the list of fields params should only include the brackets, not a number. Here's an example from their docs:

For example, to only return data from Event Name and Performers, send these two query parameters: fields%5B%5D=Fieldname1&fields%5B%5D=Fieldname2 Note: %5B%5D may be omitted when specifying multiple fields, but must always be included when specifying only a single field.

Submitting the requests without the numeric indexes in the fields[] works fine with 21 or more fields in the list.

minorgod commented 2 years ago

Hey, thanks for merging that! I was temporarily using Jitpack to substitute my fork and my team was complaining about it. I was worried you might not still be maintaining this lib. Glad to see you still are! Hope you can figure out how to publish to Maven so I can remove Jitpack from my build config before someone on my team rages on me. :)

fuxingloh commented 2 years ago

Hey thanks, it's published https://repo1.maven.org/maven2/dev/fuxing/airtable-api/0.3.2/