Skip to content

Incorrect validation for disableStartTls when creating SMTP credentials via API #15759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
untitledds opened this issue May 27, 2025 · 1 comment
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@untitledds
Copy link

Bug Description

When creating an SMTP credential via the n8n API at POST {{baseUrl}}/credentials, the request body includes disableStartTls: true along with secure: false. However, the API returns an error indicating that the data is of a prohibited type (object Object). This seems to be due to schema validation issues, especially around the disableStartTls field.
request.body.data does not match allOf schema [subschema 0] with 2 error[s]:,request.body.data does not match allOf schema [subschema 0] with 1 error[s]:,request.body.data is of prohibited type [object Object]
When request In UI the error same

To Reproduce

  1. Send a POST request to {{baseUrl}}/credentials with the following JSON body:
    application/json
    {
    "name": "smtp_server",
    "type": "smtp",
    "data": {
    "user": "exampleUser",
    "password": "examplePassword",
    "host": "example.com",
    "port": 443,
    "hostName": "exampleHostName",
    "secure": false,
    "disableStartTls": true
    }
    }
  2. Observe the response from the API.

Expected behavior

The SMTP credential should be created successfully. The disableStartTls flag should be allowed when secure is set to false, as per the logic defined in the schema. Additionally, the API should not reject the request due to a type mismatch or schema validation error.

Operating System

n8nio/n8n

n8n Version

1.88.0

Node.js Version

v20.19.0

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented May 27, 2025

Hey @untitledds,

We have created an internal ticket to look into this which we will be tracking as "GHC-2198"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants