Skip to content

Commit a1bac39

Browse files
Update MTA schemas (SchemaStore#5149)
* Add new parameters to mtad.json * Reuse mtad parameters in mtaext and mta * Add XSA platform paratemers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ed42ee2 commit a1bac39

File tree

4 files changed

+460
-431
lines changed

4 files changed

+460
-431
lines changed

src/schema-validation.jsonc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,12 @@
10451045
"minecraft-texture-mcmeta.json": {
10461046
"externalSchema": ["partial-fusion-texture-metadata.json"]
10471047
},
1048+
"mta.json": {
1049+
"externalSchema": ["mtad.json"]
1050+
},
1051+
"mtaext.json": {
1052+
"externalSchema": ["mtad.json"]
1053+
},
10481054
"ninjs-1.4.json": {
10491055
"unknownKeywords": ["description_old"]
10501056
},

src/schemas/json/mta.json

Lines changed: 21 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,28 @@
1111
"type": "object"
1212
},
1313
"properties-metadata": {
14-
"type": "object",
15-
"properties": {
16-
"overwritable": {
17-
"type": "boolean",
18-
"default": true
19-
},
20-
"optional": {
21-
"type": "boolean",
22-
"default": false
23-
},
24-
"datatype": {
25-
"enum": ["str", "int", "float", "bool"],
26-
"type": "string",
27-
"default": "str"
28-
}
29-
}
14+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/properties-metadata"
3015
},
3116
"parameters": {
32-
"type": "object"
17+
"$ref": "https://json.schemastore.org/mtad.json#/properties/parameters"
3318
},
3419
"module-parameters": {
35-
"type": "object",
36-
"properties": {
37-
"app-features": {
38-
"$ref": "#/definitions/module-parameters-app-features",
39-
"description": "A set of features that can be enabled for the application module (This is not applicable for module type com.sap.application.content). The features are not mandatory and can be used to enable additional functionality for the application."
40-
},
41-
"skip-deploy": {
42-
"description": "Skip the deployment of the application.",
43-
"type": "boolean"
44-
}
45-
},
46-
"additionalProperties": true
20+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/module-parameters"
4721
},
48-
"module-parameters-app-features": {
49-
"type": "object",
50-
"properties": {
51-
"ssh": {
52-
"description": "Enable SSH access to the application.",
53-
"type": "boolean"
54-
},
55-
"file-based-vcap-services": {
56-
"description": "Enable file-based VCAP service bindings for the app.",
57-
"type": "boolean"
58-
}
59-
}
22+
"module-requires-parameters": {
23+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/module-requires-parameters"
24+
},
25+
"module-provides": {
26+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/module-provides"
27+
},
28+
"module-requires": {
29+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/module-requires"
6030
},
6131
"parameters-metadata": {
62-
"type": "object",
63-
"properties": {
64-
"overwritable": {
65-
"type": "boolean",
66-
"default": true
67-
},
68-
"optional": {
69-
"type": "boolean",
70-
"default": false
71-
}
72-
}
32+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/properties-metadata"
33+
},
34+
"resource-parameters": {
35+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/resource-parameters"
7336
},
7437
"includes": {
7538
"type": "array",
@@ -90,97 +53,7 @@
9053
}
9154
},
9255
"hooks": {
93-
"type": "array",
94-
"items": {
95-
"type": "object",
96-
"required": ["name"],
97-
"properties": {
98-
"name": {
99-
"description": "An internal name which can be used for documentation purposes and shown by the deployer.",
100-
"type": "string",
101-
"pattern": "^[A-Za-z0-9_\\-\\.]+$"
102-
},
103-
"type": {
104-
"description": "Defines the type of action that should be executed by the deployer.",
105-
"type": "string",
106-
"enum": ["task"]
107-
},
108-
"phases": {
109-
"description": "A list of strings that define the points at which the hook must be executed.",
110-
"type": "array",
111-
"items": {
112-
"type": "string",
113-
"enum": [
114-
"deploy.application.before-stop",
115-
"blue-green.application.before-stop.idle",
116-
"blue-green.application.before-stop.live",
117-
"deploy.application.after-stop",
118-
"blue-green.application.after-stop.idle",
119-
"blue-green.application.after-stop.live",
120-
"deploy.application.before-unmap-routes",
121-
"blue-green.application.before-unmap-routes.live",
122-
"blue-green.application.before-unmap-routes.idle",
123-
"deploy.application.before-start",
124-
"blue-green.application.before-start.idle",
125-
"blue-green.application.before-start.live"
126-
]
127-
}
128-
},
129-
"parameters": {
130-
"$ref": "#/definitions/hooks-parameters",
131-
"description": "Configuration parameters that are used when executing the hook to the target runtime environment."
132-
},
133-
"parameters-metadata": {
134-
"$ref": "#/definitions/properties-metadata",
135-
"description": "Additional information about the hook's parameters."
136-
},
137-
"requires": {
138-
"description": "List of names either matching a resource name or a provided dependency name provided within the same MTA that are required by this hook.",
139-
"type": "array",
140-
"items": {
141-
"type": "object",
142-
"required": ["name"],
143-
"properties": {
144-
"name": {
145-
"description": "An MTA internal name which must match either a provided name, or a resource name within the same MTA.",
146-
"type": "string",
147-
"pattern": "^[A-Za-z0-9_\\-\\.]+$"
148-
},
149-
"parameters": {
150-
"description": "Parameters can be used to influence the behavior of tools which interpret this descriptor. Parameters are not made available to the hook at runtime. Provided property values can be accessed by \"~{<provided-property-name>}\". Such expressions can be part of an arbitrary string",
151-
"type": "object"
152-
},
153-
"parameters-metadata": {
154-
"$ref": "#/definitions/properties-metadata",
155-
"description": "Additional information about the hook's parameters."
156-
}
157-
}
158-
}
159-
}
160-
}
161-
}
162-
},
163-
"hooks-parameters": {
164-
"type": "object",
165-
"required": ["command"],
166-
"properties": {
167-
"name": {
168-
"description": "Defines the name of the Cloud Foundry task that should be executed.",
169-
"type": "string"
170-
},
171-
"command": {
172-
"description": "Defines the actual command that is executed as a Cloud Foundry task.",
173-
"type": "string"
174-
},
175-
"memory": {
176-
"$ref": "#/definitions/generic-memory",
177-
"description": "Defines the memory that is available to the Cloud Foundry task."
178-
},
179-
"disk-quota": {
180-
"$ref": "#/definitions/generic-memory",
181-
"description": "Defines the disk space that is available to the Cloud Foundry task."
182-
}
183-
}
56+
"$ref": "https://json.schemastore.org/mtad.json#/definitions/hooks"
18457
}
18558
},
18659
"description": "MTA DESCRIPTOR SCHEMA",
@@ -285,89 +158,12 @@
285158
}
286159
},
287160
"provides": {
288-
"description": "Used to define the named property sets that other modules and resources can require.",
289-
"type": "array",
290-
"items": {
291-
"type": "object",
292-
"required": ["name"],
293-
"properties": {
294-
"name": {
295-
"description": "The name of the property set that the module provides. The provided name must be unique and cannot be the same as any resource or module name.",
296-
"type": "string",
297-
"pattern": "^[A-Za-z0-9_\\-\\.]+$"
298-
},
299-
"public": {
300-
"description": "Configures the accessibility of the provided property set; if set to \"true\", it is publicly accessible and can be consumed by other MTA projects.",
301-
"type": "boolean",
302-
"default": false
303-
},
304-
"properties": {
305-
"$ref": "#/definitions/properties",
306-
"description": "A list of properties that are included in this property set."
307-
},
308-
"properties-metadata": {
309-
"$ref": "#/definitions/properties-metadata",
310-
"description": "Additional information about the provided set's properties."
311-
}
312-
}
313-
}
161+
"$ref": "#/definitions/module-provides",
162+
"description": "List of provided names (MTA internal) to which properties can be attached"
314163
},
315164
"requires": {
316-
"description": "A list of property sets provided by other modules and/or resources (providers) that this module requires.",
317-
"type": "array",
318-
"items": {
319-
"type": "object",
320-
"required": ["name"],
321-
"properties": {
322-
"name": {
323-
"description": "The name of a provided property set or resource (provider) that this module requires.",
324-
"type": "string",
325-
"pattern": "^[A-Za-z0-9_\\-\\.]+$"
326-
},
327-
"group": {
328-
"description": "A \"group\" can be used to combine properties from multiple providers into one runtime lookup object, such as an environment variable. As of schema version 2.1, this property is DEPRECATED.",
329-
"type": "string"
330-
},
331-
"list": {
332-
"description": "Defines a name for a runtime lookup object, such as an environment variable, if the required property set contains multiple values; for example, if used to consume configuration data from outside this MTA project.",
333-
"type": "string"
334-
},
335-
"properties": {
336-
"$ref": "#/definitions/properties",
337-
"description": "Module properties whose values are determined by the provided properties. These properties can be referenced by the tilde notation: \"~{<provided-property-name>}\" "
338-
},
339-
"properties-metadata": {
340-
"$ref": "#/definitions/properties-metadata",
341-
"description": "Additional information about the modules' properties."
342-
},
343-
"parameters": {
344-
"$ref": "#/definitions/parameters",
345-
"description": "Configuration parameters that are used when deploying the module to the target runtime environment."
346-
},
347-
"parameters-metadata": {
348-
"$ref": "#/definitions/parameters-metadata",
349-
"description": "Additional information about the modules' parameters."
350-
},
351-
"includes": {
352-
"type": "array",
353-
"description": "It is possible to define parameters in external files. The \"includes\" section is used to point to those files.",
354-
"items": {
355-
"type": "object",
356-
"required": ["name", "path"],
357-
"properties": {
358-
"name": {
359-
"description": "The name of an \"includes\" section. This name is used by a builder to generate a parameter section in the deployment descriptor.",
360-
"type": "string"
361-
},
362-
"path": {
363-
"description": "A path pointing to a file that contains a map of parameters, either in JSON or in YAML format.",
364-
"type": "string"
365-
}
366-
}
367-
}
368-
}
369-
}
370-
}
165+
"$ref": "#/definitions/module-requires",
166+
"description": "List of names either matching a resource name or a name provided by another module within the same MTA that are required by this module."
371167
}
372168
}
373169
}
@@ -401,7 +197,7 @@
401197
"description": "Additional information about the resource's properties."
402198
},
403199
"parameters": {
404-
"$ref": "#/definitions/parameters",
200+
"$ref": "#/definitions/resource-parameters",
405201
"description": "Configuration parameters that are used when provisioning the resource in the target runtime environment."
406202
},
407203
"parameters-metadata": {

0 commit comments

Comments
 (0)