Managed-App-Schema-Builder icon indicating copy to clipboard operation
Managed-App-Schema-Builder copied to clipboard

Add ability to require a key

Open talkingmoose opened this issue 1 year ago • 1 comments

Jamf manifests support the required keyword to enforce a key be configured. This is useful for ensuring all necessary properties are configured.

Here’s a basic manifest with two keys:

{
    "title": "Disk Manager (com.company.diskmanager)",
    "description": "Preference settings for the fictitious Disk Manager application. This manifest demonstrates different ways to format the appearance or value of properties as well as include useful options like infoText. Jamf Pro supports many but not all elements and options here: https://github.com/json-editor/json-editor.",
    "properties": {
        "askForPassword": {
            "title": "Ask For Password",
            "description": "Set Disk Manager application to require a password.",
            "property_order": 25,
            "type": "boolean",
            "links": [
                {
                    "rel": "More information",
                    "href": "https://json-schema.org/understanding-json-schema/reference/type.html"
                }
            ]
        },
        "diskCacheSize": {
            "title": "Disk Cache Size",
            "description": "SSet disk cache size, in bytes.",
            "property_order": 30,
            "type": "integer"
        }
    }
}

Here’s the same manifest with the askForPassword key required.

{
    "title": "Disk Manager (com.company.diskmanager)",
    "description": "Preference settings for the fictitious Disk Manager application. This manifest demonstrates different ways to format the appearance or value of properties as well as include useful options like infoText. Jamf Pro supports many but not all elements and options here: https://github.com/json-editor/json-editor.",
    "properties": {
        "askForPassword": {
            "title": "Ask For Password",
            "description": "Set Disk Manager application to require a password.",
            "property_order": 25,
            "type": "boolean",
            "links": [
                {
                    "rel": "More information",
                    "href": "https://json-schema.org/understanding-json-schema/reference/type.html"
                }
            ]
        },
        "diskCacheSize": {
            "title": "Disk Cache Size",
            "description": "SSet disk cache size, in bytes.",
            "property_order": 30,
            "type": "integer"
        }
    },
    "required": ["askForPassword"]
}

This change applies to all property types not just boolean or integer.

image

talkingmoose avatar Sep 07 '23 16:09 talkingmoose

planned for next release

BIG-RAT avatar Mar 24 '24 20:03 BIG-RAT