Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Settings: ignore keys in referenced schema #1600

Closed
jakubjezek001 opened this issue May 27, 2021 · 2 comments · Fixed by #1608
Closed

Settings: ignore keys in referenced schema #1600

jakubjezek001 opened this issue May 27, 2021 · 2 comments · Fixed by #1608
Assignees
Labels
type: enhancement Enhancements to existing functionality

Comments

@jakubjezek001
Copy link
Member

jakubjezek001 commented May 27, 2021

Description

As referencing of other shema is used and not always there is necessary to use all keys from the referenced schema, it would be great to have ignore_keys attribute with list of keys which should be ignored. It means those will not be added into gui and not collected into settings data.

There is several instance where would this feature come handful.

Example of usage:

In this example only argument_1 will be used.

Referencing of schema:

{
    "type": "schema",
    "name": "some_referenced_shema",
    "ignore_keys": ["argument_1"]
}

Referenced schema content some_referenced_shema.json:

{
    "type": "dict",
    "key": "category",
    "children": [
        {
            "type": "dict",
            "key": "argument_1",
            "children": [
                {
                    "type": "boolean",
                    "key": "sub_argument_1",
                }
            ]
        },
        {
            "type": "dict",
            "key": "argument_2",
            "children": [
                {
                    "type": "boolean",
                    "key": "sub_argument_2",
                }
            ]
        }
    ]
}
@jakubjezek001 jakubjezek001 added the type: enhancement Enhancements to existing functionality label May 27, 2021
@mkolar mkolar added the MEDIUM label May 27, 2021
@mkolar
Copy link
Member

mkolar commented May 27, 2021

Very good idea. We had a brief chat about it with @iLLiCiTiT and came to two tweaks with the proposal.

  1. This feature should work for templates, rather than schemas. Schemas should stay purely for simplifying the structure, while templates are for usage in multiple places and already can carry some metadata that modify their behaviour
  2. the ignored keys will need to be specified as a full relative path to the key so we can ignore keys that are deeper in the hierarchy. for example plugins/publish/key1

@iLLiCiTiT iLLiCiTiT self-assigned this May 28, 2021
@create-issue-branch
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants