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

Spec.json UI rendering bugs. #2730

Closed
davinchia opened this issue Apr 5, 2021 · 5 comments
Closed

Spec.json UI rendering bugs. #2730

davinchia opened this issue Apr 5, 2021 · 5 comments
Labels
type/bug Something isn't working

Comments

@davinchia
Copy link
Contributor

davinchia commented Apr 5, 2021

Expected Behavior

When modifying a spec.json file I expect rendering matching the json schema.

Stumbled upon these while trying to implement the Redshift Copy Strategy.

Current Behavior

Spec 1

This schema is of an object that is optional, but has 4 required fields. i.e. All four fields are required if any one is filled up. None are required if there are all empty.

 "s3_configuration": {
        "title": "S3 Configuration",
        "type": "object",
        "required": ["s3_bucket_name", "s3_bucket_region", "access_key_id", "secret_access_key"],
        "properties": {
          "s3_bucket_name" : {
            "title": "S3 Bucket Name",
            "type": "string",
            "description": "The name of the staging S3 bucket to use if utilising a copy strategy.",
            "examples": ["airbyte.staging"]
          },
          "s3_bucket_region": {
            "title": "S3 Bucket Region",
            "type": "string",
            "default": "",
            "description": "The region of the S3 staging bucket to use if utilising a copy strategy.",
            "enum": ["","us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-west-1", "eu-west-2", "eu-west-3","eu-south-1", "eu-north-1", "sa-east-1", "me-south-1"]
          },
          "access_key_id": {
            "type": "string",
            "title": "S3 Key Id"
          },
          "secret_access_key": {
            "type": "string",
            "title": "S3 Access Key"
          }
        }
      }

I'd expect:

  1. The object's field to not be flattened and be grouped within a parent object in the UI.
  2. Instead of requiring all 4 field if one is filled, the UI always expects all fields to be filled.

Spec 2

This schema is of an object with a oneOf with one option.

 "s3_configuration": {
        "title": "S3 Configuration",
        "type": "object",
        "oneOf":
        [
          {
            "title": "S3 Configuration",
            "required": ["s3_bucket_name", "s3_bucket_region", "access_key_id", "secret_access_key"],
            "properties": {
              "s3_bucket_name" : {
                "title": "S3 Bucket Name",
                "type": "string",
                "description": "The name of the staging S3 bucket to use if utilising a copy strategy.",
                "examples": ["airbyte.staging"]
              },
              "s3_bucket_region": {
                "title": "S3 Bucket Region",
                "type": "string",
                "description": "The region of the S3 staging bucket to use if utilising a copy strategy.",
                "enum": ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-west-1", "eu-west-2", "eu-west-3","eu-south-1", "eu-north-1", "sa-east-1", "me-south-1"]
              },
              "access_key_id": {
                "type": "string",
                "title": "S3 Key Id"
              },
              "secret_access_key": {
                "type": "string",
                "title": "S3 Access Key"
              }
            }
          }
        ]
      }

Although this renders correctly, I am unable to click the Test Destination button even if all the fields in the oneOf struct are filled.

Steps to Reproduce

For each one of the above json schemas,

  1. Add the object to an existing schema's property block.
  2. Rebuild the connector's image. Navigate to admin to use the new image's tag.
  3. Try to set up a new connector using the new spec.json.

Severity of the bug for you

Low - I don't expect many people to submit complex json schemas.

Airbyte Version

0.17.2 was when I encountered this on.

┆Issue is synchronized with this Asana task by Unito

@davinchia davinchia added type/bug Something isn't working area/frontend labels Apr 5, 2021
@jrhizor
Copy link
Contributor

jrhizor commented Apr 5, 2021

We have grouping for oneOf which is what I imagine we would want this would look like.

@jrhizor
Copy link
Contributor

jrhizor commented Apr 5, 2021

Also, is s3_configuration marked as required?

@davinchia
Copy link
Contributor Author

davinchia commented Apr 5, 2021

Also, is s3_configuration marked as required?

Not marked as required.

We have grouping for oneOf which is what I imagine we would want this would look like.

Is this different from schema 2 listed in the ticket?

@michel-tricot
Copy link
Contributor

The way the schema 2 is structured make is a bit unclean.

could we have something more like that:

redshift configuration
load mode: (can only be one of the following options)
- insert (this one has no options) 
- copy
  - s3 configuration

@davinchia
Copy link
Contributor Author

The way the schema 2 is structured make is a bit unclean.

could we have something more like that:

redshift configuration
load mode: (can only be one of the following options)
- insert (this one has no options) 
- copy
  - s3 configuration

Good suggestion. Just tested this and this seems okay. Will make the change later today.

Going to leave this ticket up here still in case others run into this.

@jrhizor jrhizor closed this as completed Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants