Consider accepting (and preferring) JSON schema for plugin 'settings' definitions #6237
Replies: 2 comments 4 replies
-
Coming back to this after a few months... What if we just add a feature to allow JSON schema for plugin settings definitions? I'll list a few options, but probably there are lots more Essentially if a plugin has plugins:
- name: my-plugin:
settings: ... # Settings will be ignored if `config_jsonschema` is defined.
config_jsonschema:
# Follows is valid JSON Schema, would be grafted into a `properties` declaration:
username:
type: string
description: The user name.
password:
type: string
secret: True # or writeOnly: True
description: The user password.
group_ids:
type: array
items: "string" Meltano might do some light grooming, cleanup, or verification of the JSON Schema, but in general, we'd rely on the JSON Schema spec for it's own native expression. Note: Above is in yaml for readability, but users/developers would also have the option to simply copy-base JSON Schema in json format. |
Beta Was this translation helpful? Give feedback.
-
This discussion came up in #6916 along with a few other links out to meltano/hub#24 (comment) and meltano/hub#22. @aaronsteers I like this the proposal! We can keep using the settings definition as they are today but if theres more complex settings we can choose to implement a |
Beta Was this translation helpful? Give feedback.
-
Proposal comment: #6237 (reply in thread)
schema
entry which would provide a JSON Schema definition for the setting.schema
is provided, ignorekind
- unlesskind: password
, and then apply the normal secret protections.secret: true
orwriteOnly: true
. (Either of these would cause Meltano to perform as ifkind: password
was set.)schema
object can fully describe all child config nodes.settings
list, versus ignoring them, versus attempting to 'merge'.Original discussion and background.
While comparing the SDK
json
format with our existing Meltano plugin files and the API / lock file format, the difference insettings
definitions seemed worth calling out for further discussions.One path forward would be to build JSON Schema compatibility into Meltano. We could do this in a way that existing settings definitions still work but we would suggest new definitions be documented using the standard JSON Schema.
settings_group_validation
required
label
title
annotationkind:password
{"type": "string", "format": "password"}
value
default
We could detect whether the format is old-style or new-style based on whether
settings
is a list or an object/map.Beta Was this translation helpful? Give feedback.
All reactions