instill-ai / instill-core

🔮 Instill Core is a full-stack AI infrastructure tool for data, model and pipeline orchestration, designed to streamline every aspect of building versatile AI-first applications
https://www.instill.tech
Other
2.1k stars 100 forks source link

bug: the schema comes from connector-backend has not aligned with the JSON Schema protocol #960

Closed EiffelFly closed 2 years ago

EiffelFly commented 2 years ago

Context

This is the schema I got from current connector-backend.

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additional_properties": true,
    "properties": {
        "database": {
            "description": "Name of the database.",
            "order": 2,
            "title": "Database",
            "type": "string"
        },
        "host": {
            "description": "The Hostname of the database.",
            "order": 0,
            "title": "Host",
            "type": "string"
        },
        "password": {
            "airbyte_secret": true,
            "description": "The Password associated with the username.",
            "order": 4,
            "title": "Password",
            "type": "string"
        },
        "port": {
            "default": 3306,
            "description": "The Port of the database.",
            "examples": [
                "3306"
            ],
            "maximum": 65536,
            "minimum": 0,
            "order": 1,
            "title": "Port",
            "type": "integer"
        },
        "tunnel_method": {
            "description": "Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.",
            "one_of": [
                {
                    "properties": {
                        "tunnel_method": {
                            "const": "NO_TUNNEL",
                            "description": "No ssh tunnel needed to connect to database",
                            "order": 0,
                            "type": "string"
                        }
                    },
                    "required": [
                        "tunnel_method"
                    ],
                    "title": "No Tunnel"
                },
                {
                    "properties": {
                        "ssh_key": {
                            "airbyte_secret": true,
                            "description": "OS-level user account ssh key credentials in RSA PEM format ( created with ssh-keygen -t rsa -m PEM -f myuser_rsa )",
                            "multiline": true,
                            "order": 4,
                            "title": "SSH Private Key",
                            "type": "string"
                        },
                        "tunnel_host": {
                            "description": "Hostname of the jump server host that allows inbound ssh tunnel.",
                            "order": 1,
                            "title": "SSH Tunnel Jump Server Host",
                            "type": "string"
                        },
                        "tunnel_method": {
                            "const": "SSH_KEY_AUTH",
                            "description": "Connect through a jump server tunnel host using username and ssh key",
                            "order": 0,
                            "type": "string"
                        },
                        "tunnel_port": {
                            "default": 22,
                            "description": "Port on the proxy/jump server that accepts inbound ssh connections.",
                            "examples": [
                                "22"
                            ],
                            "maximum": 65536,
                            "minimum": 0,
                            "order": 2,
                            "title": "SSH Connection Port",
                            "type": "integer"
                        },
                        "tunnel_user": {
                            "description": "OS-level username for logging into the jump server host.",
                            "order": 3,
                            "title": "SSH Login Username",
                            "type": "string"
                        }
                    },
                    "required": [
                        "tunnel_method",
                        "tunnel_host",
                        "tunnel_port",
                        "tunnel_user",
                        "ssh_key"
                    ],
                    "title": "SSH Key Authentication"
                },
                {
                    "properties": {
                        "tunnel_host": {
                            "description": "Hostname of the jump server host that allows inbound ssh tunnel.",
                            "order": 1,
                            "title": "SSH Tunnel Jump Server Host",
                            "type": "string"
                        },
                        "tunnel_method": {
                            "const": "SSH_PASSWORD_AUTH",
                            "description": "Connect through a jump server tunnel host using username and password authentication",
                            "order": 0,
                            "type": "string"
                        },
                        "tunnel_port": {
                            "default": 22,
                            "description": "Port on the proxy/jump server that accepts inbound ssh connections.",
                            "examples": [
                                "22"
                            ],
                            "maximum": 65536,
                            "minimum": 0,
                            "order": 2,
                            "title": "SSH Connection Port",
                            "type": "integer"
                        },
                        "tunnel_user": {
                            "description": "OS-level username for logging into the jump server host",
                            "order": 3,
                            "title": "SSH Login Username",
                            "type": "string"
                        },
                        "tunnel_user_password": {
                            "airbyte_secret": true,
                            "description": "OS-level password for logging into the jump server host",
                            "order": 4,
                            "title": "Password",
                            "type": "string"
                        }
                    },
                    "required": [
                        "tunnel_method",
                        "tunnel_host",
                        "tunnel_port",
                        "tunnel_user",
                        "tunnel_user_password"
                    ],
                    "title": "Password Authentication"
                }
            ],
            "title": "SSH Tunnel Method",
            "type": "object"
        },
        "username": {
            "description": "The Username which is used to access the database.",
            "order": 3,
            "title": "Username",
            "type": "string"
        }
    },
    "required": [
        "host",
        "port",
        "username",
        "database"
    ],
    "title": "MariaDB Columnstore Destination Spec",
    "type": "object"
}

Here are the key points that this object has not aligned with the official JSON schema

Airbyte's protocol and the implementation we copied from them all use camelCase too.

linear[bot] commented 5 months ago

INS-4634 bug: the schema comes from connector-backend has not aligned with the JSON Schema protocol