Skip to content

Adds types.MismatchedFieldsParams + mismatched_fields_parser.go#11

Merged
ekartsev merged 1 commit intomainfrom
adds-mismatched-fields-parser
Dec 10, 2025
Merged

Adds types.MismatchedFieldsParams + mismatched_fields_parser.go#11
ekartsev merged 1 commit intomainfrom
adds-mismatched-fields-parser

Conversation

@ekartsev
Copy link
Copy Markdown
Collaborator

@ekartsev ekartsev commented Dec 10, 2025

Notes

When customer attempts to send a request to one of the following Iterable API:

  • api/events/track
  • api/users/update

and one of the fields in the request has a wrong type,
the Iterable API responds with a 400 status code and the following body:

{
    "msg":"Project xxxx: The request does not have the same data types as the data previously submitted, or the input value is not within the correct range. Field 'my_project_etl:::soc_signup_at' already exists for type 'user' and has a data type of 'date' but possible types 'string, keyword' in the request.",
    "code":"RequestFieldsTypesMismatched",
    "params":{
      "validationErrors":{
        "my_project_etl:::soc_signup_at":{
          "incomingTypes":["string","keyword"],
          "expectedType":"date",
          "category":"user",
          "offendingValue":"2020-04-20 06:12:59.513",
          "_type":"UnexpectedType"
        }
      }
    }    
}

See:

NOTE: In the example above the offendingValue does look like a proper date type, but it doesn't follow the formate supported by Iterable, see: https://support.iterable.com/hc/en-us/articles/208183076-Field-Data-Types#date


This change adds a way for customers of this client library to get the validationErrors from the RequestFieldsTypesMismatched responses.

Tests

  • new unit tests

@ekartsev ekartsev marked this pull request as ready for review December 10, 2025 20:07
@ekartsev ekartsev merged commit 8a947c5 into main Dec 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant