Skip to content

Fields with default not always set in the resource config during discover  #1925

Open
@travjenkins

Description

@travjenkins

I could see how this might not be a bug... but kind of feels like one to me and also causes an issue in the UI.

The source-postgres connector has a resource config schema that contains this property:

    "mode": {
      "type": "string",
      "enum": [
        "",
        "Normal",
        "Precise",
        "Only Changes",
        "Without Primary Key"
      ],
      "title": "Backfill Mode",
      "description": "How the preexisting contents of the table should be backfilled. This should generally not be changed.",
      "default": ""
    }

However during discover this default is not set on any of the bindings.

"bindings": [
      {
          "resource": {
              "namespace": "public",
              "stream": "bigtables00"
          },
          "target": "acme/foo/public/bigtables00"
      },
      {
          "resource": {
              "namespace": "public",
              "stream": "bigtables01"
          },
          "target": "acme/foo/public/bigtables01"
      },
      ...

This can cause problems in the UI as our schema validation tool ajv is setup to insert defaults when a property is not there. We could look into turning this off only for the edit flow - but I first wanted to gauge people's thoughts.

I think that having the empty string being a value is okay but marking it as the default seems unnecessary since the user could just leave that prop off all together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions