Skip to content
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

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

Closed
EiffelFly opened this issue Jul 1, 2022 · 1 comment · Fixed by #105

Comments

@EiffelFly
Copy link
Member

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

  • The keyword like oneOf, additionalProperties are camelCase, but in the current object, they are snake_case

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

@felixcorleone felixcorleone closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants