Skip to content

Instantly share code, notes, and snippets.

@lewxdev
Created June 30, 2025 16:09
Show Gist options
  • Select an option

  • Save lewxdev/7ac614a4e6eecc4a99ec447af7b624b2 to your computer and use it in GitHub Desktop.

Select an option

Save lewxdev/7ac614a4e6eecc4a99ec447af7b624b2 to your computer and use it in GitHub Desktop.
{
"type": "object",
"additionalProperties": false,
"required": ["patches"],
"properties": {
"patches": {
// PatchSet
// see: https://github.com/itzg/mc-image-helper#patchset
"type": "array",
"additionalItems": false,
"items": {
// PatchDefinition
// see: https://github.com/itzg/mc-image-helper#patchdefinition
"type": "object",
"additionalProperties": false,
"required": ["file", "ops"],
"properties": {
"file": {
"description": "Path to the file to patch",
"type": "string"
},
"file-format": {
"description": "**optional** If non-null, declares a specifically supported format name: json, yaml. Otherwise, the file format is detected by the file's suffix.",
"enum": ["json", "yaml"]
},
"ops": {
"type": "array",
"additionalItems": false,
"items": {
// PatchOperation
// see: https://github.com/itzg/mc-image-helper#patchoperation
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": ["$set"],
"properties": {
"$set": {
"type": "object",
"additionalProperties": false,
"required": ["path", "value"],
"properties": {
"path": {
"description": "The [JSON path](https://github.com/json-path/JsonPath) to the field to set",
"type": "string"
},
"value": {
"description": "The value to set. If the given value is a string, variable placeholders of the form `${...}` will be replaced from the environment variables and the resulting string can be converted by setting value-type."
},
"value-type": {
"description": "**optional** [see ValueType](https://github.com/itzg/mc-image-helper#valuetype)",
"enum": [
"int",
"float",
"bool",
"auto",
"list of int",
"list of float",
"list of bool",
"list of auto"
]
}
}
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["$put"],
"properties": {
"$put": {
"type": "object",
"additionalProperties": false,
"required": ["path", "key", "value"],
"properties": {
"path": {
"description": "The [JSON path](https://github.com/json-path/JsonPath) to the object containing key to set",
"type": "string"
},
"key": {
"description": "The key to set",
"type": "string"
},
"value": {
"description": "The value to set. If the given value is a string, variable placeholders of the form `${...}` will be replaced from the environment variables and the resulting string can be converted by setting value-type."
},
"value-type": {
"description": "**optional** [see ValueType](https://github.com/itzg/mc-image-helper#valuetype)",
"enum": [
"int",
"float",
"bool",
"auto",
"list of int",
"list of float",
"list of bool",
"list of auto"
]
}
}
}
}
}
]
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment