Skip to content

Add pattern to all keys with string or integer values #13

Description

@talkingmoose

Jamf manifests support the pattern keyword to provide regular expression (regex) pattern matching for verification. This is useful for validating a value.

Here’s a basic property:

{
    "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": {
        "epochDate": {
            "title": "Start Date",
            "description": "Date (in YYYY-MM-DD format) of drive installation.",
            "property_order": 45,
            "type": "string"
        }
    }
}

Here’s the same property with the pattern keyword.

{
    "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": {
        "epochDate": {
            "title": "Start Date",
            "description": "Date (in YYYY-MM-DD format) of drive installation.",
            "property_order": 45,
            "type": "string",
            "pattern": "^20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$"
        }
    }
}

This change applies to all property string and integer property types.

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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