Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Permissions definition in rockcraft schema to top scope #460

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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