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

Webapp: support only const in OneOf as default value #6384

Closed
marcosmarxm opened this issue Sep 22, 2021 · 4 comments
Closed

Webapp: support only const in OneOf as default value #6384

marcosmarxm opened this issue Sep 22, 2021 · 4 comments
Assignees
Labels
priority/low Low priority type/bug Something isn't working

Comments

@marcosmarxm
Copy link
Member

Tell us about the problem you're trying to solve

The Webapp doesnt support to use only const in the spec.json to create a new connector.

See example from Google Search Console:

"authorization": {
"type": "object",
"oneOf": [
{
"type": "object",
"required": [
"auth_type",
"client_id",
"client_secret",
"refresh_token"
],
"properties": {
"auth_type": {
"type": "string",
"const": "Client"
},
"client_id": {
"type": "string",
"description": "Input this field if you want authorize through personal account",
"airbyte_secret": true
},
"client_secret": {
"type": "string",
"description": "Input this field if you want authorize through personal account",
"airbyte_secret": true
},
"refresh_token": {
"type": "string",
"description": "Input this field if you want authorize through personal account",
"airbyte_secret": true
}
}
},
{
"type": "object",
"required": ["auth_type", "service_account_info"],
"properties": {
"auth_type": {
"type": "string",
"const": "Service"
},
"service_account_info": {
"type": "string",
"description": "Input this field if you want authorize through service account",
"examples": [
"{ \"type\": \"service_account\", \"project_id\": YOUR_PROJECT_ID, \"private_key_id\": YOUR_PRIVATE_KEY, ... }"
]
}
}
}
]
}
}

image

For more context check issue #6221 and PR #6222

Describe the solution you’d like

Should use only const in OneOf fields

Describe the alternative you’ve considered or used

A clear and concise description of any alternative solutions or features you've considered or are using today.

Additional context

Add any other context or screenshots about the feature request here.

Are you willing to submit a PR?

Remove this with your answer :-)

@marcosmarxm marcosmarxm added type/bug Something isn't working area/frontend labels Sep 22, 2021
@marcosmarxm
Copy link
Member Author

@jamakase fyi

@jrhizor jrhizor added the priority/low Low priority label Sep 22, 2021
@keu
Copy link
Contributor

keu commented Jan 28, 2022

@marcosmarxm is this only related to the list of objects?
let's say I have a drop-down of possible values or a list of values, where each can be one of the choices.
The current limitation of web app looks unjustified, IMO connectors shouldn't depend on low layer (UI 3rd party).

I checked the docs here (https://docs.airbyte.com/connector-development/connector-specification-reference), but it doesn't have any details.

@grubberr grubberr self-assigned this Apr 6, 2022
@grubberr
Copy link
Contributor

grubberr commented Apr 7, 2022

"oneOf": [
          { 
            "type": "object",
            "title": "Authenticate via GitHub (OAuth)",
            "properties": {
              "option_title": {
                "type": "string",
                "const": "OAuth Credentials"
              }
            }
          },
          { 
            "type": "object",
            "title": "Authenticate with Personal Access Token",
            "properties": {
              "option_title": {
                "type": "string",
                "const": "PAT Credentials"
              }
            }
          }

Screenshot 2022-04-07 at 11 13 14

@grubberr
Copy link
Contributor

grubberr commented Apr 7, 2022

I have checked - all works with const only keyword now

there is also closed issue with improved SAT test #11703 which checks const only keyword in common properties

@marcosmarxm I think we can close this issue now

@grubberr grubberr moved this to Done in GL Roadmap Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/low Low priority type/bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants