Skip to content

Commit

Permalink
fix(schema): move Permissions definition in rockcraft schema to top s…
Browse files Browse the repository at this point in the history
…cope (#460)

This is to fix an issue in Rockcraft's schema.json, because Permissions needs to moved to the top scope definitions instead of being located inside Part's definitions.
  • Loading branch information
linostar authored Jan 24, 2024
1 parent 2fce722 commit f20689a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
48 changes: 23 additions & 25 deletions schema/rockcraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,31 +617,29 @@
}
}
},
"additionalProperties": false,
"definitions": {
"Permissions": {
"title": "Permissions",
"description": "Description of the ownership and permission settings for a set of files.\n\nA ``Permissions`` object specifies that a given pattern-like ``path`` should\nbe owned by ``owner`` with a given ``group``, and have the read/write/execute\nbits defined by ``mode``.\n\nNotes\n-----\n- ``path`` is optional and defaults to \"everything\";\n- ``owner`` and ``group`` are optional if both are omitted - that is, if\n one of the pair is specified then both must be;\n- ``mode`` is a string containing an integer in base 8. For example, \"755\",\n \"0755\" and \"0o755\" are all accepted and are the equivalent of calling\n ``chmod 755 ...``.",
"type": "object",
"properties": {
"path": {
"title": "Path",
"default": "*",
"type": "string"
},
"owner": {
"title": "Owner",
"type": "integer"
},
"group": {
"title": "Group",
"type": "integer"
},
"mode": {
"title": "Mode",
"type": "string"
}
}
"additionalProperties": false
},
"Permissions": {
"title": "Permissions",
"description": "Description of the ownership and permission settings for a set of files.\n\nA ``Permissions`` object specifies that a given pattern-like ``path`` should\nbe owned by ``owner`` with a given ``group``, and have the read/write/execute\nbits defined by ``mode``.\n\nNotes\n-----\n- ``path`` is optional and defaults to \"everything\";\n- ``owner`` and ``group`` are optional if both are omitted - that is, if\n one of the pair is specified then both must be;\n- ``mode`` is a string containing an integer in base 8. For example, \"755\",\n \"0755\" and \"0o755\" are all accepted and are the equivalent of calling\n ``chmod 755 ...``.",
"type": "object",
"properties": {
"path": {
"title": "Path",
"default": "*",
"type": "string"
},
"owner": {
"title": "Owner",
"type": "integer"
},
"group": {
"title": "Group",
"type": "integer"
},
"mode": {
"title": "Mode",
"type": "string"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions tools/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def generate_project_schema() -> str:
"$ref": "#/definitions/Part"
}
project_schema["definitions"]["Part"] = part_schema
project_schema["definitions"]["Permissions"] = project_schema["definitions"][
"Part"
]["definitions"]["Permissions"]
del project_schema["definitions"]["Part"]["definitions"]

return json.dumps(project_schema, indent=2)

Expand Down

0 comments on commit f20689a

Please sign in to comment.