BIG-RAT / Managed-App-Schema-Builder

Creates JSON file that can be used to set application preferences
MIT License
95 stars 3 forks source link

Add ability to require a key #10

Open talkingmoose opened 1 year ago

talkingmoose commented 1 year ago

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

BIG-RAT commented 6 months ago

planned for next release