Skip to content

Add ability to require a key #10

@talkingmoose

Description

@talkingmoose

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions