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

Change schemas to favor objects over JSON strings #365

Closed
martinflemingdev opened this issue Aug 17, 2023 · 2 comments
Closed

Change schemas to favor objects over JSON strings #365

martinflemingdev opened this issue Aug 17, 2023 · 2 comments

Comments

@martinflemingdev
Copy link

This is a problem throughout all the Upbound providers, here's the same issue raised in the Upbound AWS provider.
crossplane-contrib/provider-upjet-aws#625

Patching a giant JSON string is not ideal for creating efficient Compositions.

2 Examples in the Data services for Upbound GCP Provider

CRD:

Problem:

  • spec.forProvider.schema expects a stringified version of an array of objects instead of actual datatypes

Example:

apiVersion: bigquery.gcp.upbound.io/v1beta1
kind: Table
metadata:
  name: example
spec:
  forProvider:
    schema: |
      [ 
        {
          "name": "permalink",
          "type": "STRING",
          "mode": "NULLABLE",
          "description": "The Permalink"
        },
        {
          "name": "state",
          "type": "STRING",
          "mode": "NULLABLE",
          "description": "State where the head office is located"
        }
      ]

Possible Solution:

  • Amend CRD to have schema type be an array of objects and not string

CRD:

Problem:

  • spec.forProvider.schema expects a json string instead of actual datatypes

Example:

  schema: |
    {
      "columns": [
        {
          "column": "id",
          "type": "INT64",
          "description": "Unique identifier",
          "mode": "REQUIRED"
        },
        {
          "column": "name",
          "type": "STRING",
          "description": "Name of the individual",
          "mode": "NULLABLE"
        },
        {
          "column": "email",
          "type": "STRING",
          "description": "Email address",
          "mode": "NULLABLE"
        }
      ]
    }

Possible Solution:

  • Amend CRD to have schema type be an object and not a string
Copy link

github-actions bot commented Apr 3, 2024

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

@github-actions github-actions bot added the stale label Apr 3, 2024
Copy link

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant