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 #1608

Merged

Conversation

create-issue-branch[bot]
Copy link

@create-issue-branch create-issue-branch bot commented May 28, 2021

Changes

  • it is possible to use both "schema_template" and "template" as type in schemas

  • added ability to skip key item with entered path using key "skip_paths" in template item definition

    • value can be list of paths or single path
    • Example template
      {
          "type": "template",
          "name": "my_template",
          "skip_paths": "this/will/be/skipped",
          "template_data": {
                  "key": "replacement_key"
          }
      }
      
  • path can define only static hierarchy (it is not possible to skip item in list or modifiable dict)

    • "path/to/template/key" - valid
    • "path/to/list/item/0" - invalid
  • if one of keys is filled dynamically (with template_data) path must contain the formatting key

    • "{key}/enabled" - valid
    • "replacement_key/enabled" - invalid
  • template item can have curly brackets in label using double curly bracket "{{root[work]}}"

    • this is inconsisten with schema where curly brackets stay unchanged so it would be nice to make it consistent in future
  • all of this filtering happens on template dictionary level it would require changing how schemas are loaded for more advanced feature or behavior

closes #1600

@iLLiCiTiT iLLiCiTiT self-assigned this May 28, 2021
@iLLiCiTiT iLLiCiTiT added backend type: enhancement Enhancements to existing functionality labels May 28, 2021
@iLLiCiTiT iLLiCiTiT requested a review from a team May 28, 2021 16:55
@iLLiCiTiT iLLiCiTiT marked this pull request as ready for review May 28, 2021 17:10
Copy link
Member

@mkolar mkolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add an example for this to the example schema?

@jakubjezek001
Copy link
Member

In an example "skip_paths": "this/will/be/skipped", is used and as the plural of paths is used I wonder if string and list value is possible?

@mkolar mkolar merged commit 742260e into develop Jun 1, 2021
@mkolar mkolar deleted the feature/1600-settings-ignore-keys-in-referenced-schema branch June 1, 2021 07:37
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 this pull request may close these issues.

Settings: ignore keys in referenced schema
3 participants