Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8e08c77
revert deleted changelog entries
Jul 27, 2026
bf023b5
add missing issue number
Jul 27, 2026
ac42fb8
Update changelog to reflect dependency updates addressing high-severi…
Jul 27, 2026
2db7d18
Update changelog to reflect dependency updates addressing security al…
Jul 27, 2026
47b6a8b
Update changelog to reflect enhancements in UI code formatting and su…
Jul 27, 2026
033e551
changelog
Jul 27, 2026
bcdd26f
Update JSON Schema version to Draft 2020-12 across multiple templates…
Jul 27, 2026
fdcd389
Merge branch 'fix-changelog' into json-schema
Jul 27, 2026
7a1e6f3
changelog
Jul 27, 2026
6c22dc4
linting
Jul 27, 2026
e352b52
Apply suggestions from code review
JC-wk Jul 27, 2026
3e771c9
docs
Jul 27, 2026
bdbccaa
improve wording
Jul 27, 2026
44263d2
Potential fix for pull request finding
JC-wk Jul 27, 2026
aab3d68
remove $id's which are invalid and unnecessary
Jul 27, 2026
e340e9d
add docs on $id
Jul 27, 2026
d6197df
update doc fromatting
Jul 27, 2026
97f297e
lint
Jul 27, 2026
f429875
Potential fix for pull request finding
JC-wk Jul 27, 2026
e4b5e65
Merge branch 'main' into json-schema
JC-wk Jul 27, 2026
8ff0e85
Merge branch 'main' into json-schema
JC-wk Jul 30, 2026
fe0c3df
Bump version to 0.26.1
Jul 30, 2026
907e529
update docs
Jul 30, 2026
448e9aa
fix schema in docs
Jul 30, 2026
137dd58
Merge branch 'main' into json-schema
JC-wk Jul 31, 2026
9865790
copilot feedback
Jul 31, 2026
a1a267a
Merge branch 'main' into json-schema
Aug 10, 2026
acfe17e
bump versions
Aug 10, 2026
467cda6
Merge branch 'main' into json-schema
JC-wk Aug 17, 2026
064007f
Enhance CHANGELOG with JSON Schema update
JC-wk Aug 17, 2026
3b6babe
Bump Porter template versions
Aug 21, 2026
b11922e
Clarify that only a subset of JSON schema is supported not the full t…
Aug 24, 2026
640575a
fix tests
Aug 24, 2026
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
**BREAKING CHANGES**

ENHANCEMENTS:
* Update JSON Schema version to Draft 2020-12 ([#5005](https://github.com/microsoft/AzureTRE/pull/5005))

BUG FIXES:

## (0.29.0) (August 14, 2026)
**BREAKING CHANGES**
Expand Down
2 changes: 1 addition & 1 deletion api_app/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.26.5"
__version__ = "0.26.6"
4 changes: 4 additions & 0 deletions api_app/db/repositories/resource_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ async def create_template(self, template_input: ResourceTemplateInCreate, resour
"customActions": template_input.customActions
}

for schema_key, template_field in (("$schema", "schema_uri"), ("$id", "schema_id"), ("$defs", "defs")):
if schema_key in template_input.json_schema:
template[template_field] = template_input.json_schema[schema_key]

if "uiSchema" in template_input.json_schema:
template["uiSchema"] = template_input.json_schema["uiSchema"]

Expand Down
8 changes: 7 additions & 1 deletion api_app/models/domain/resource_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _serialize(self) -> dict:
_strip_none_recursive(data)
return data

type: Optional[str] = Field(default=None, title="Property type")
type: Optional[Union[str, List[str]]] = Field(default=None, title="Property type")
title: str = Field(default="", title="Property description")
description: Optional[str] = Field(default=None, title="Property description")
default: Any = Field(default=None, title="Default value for the property")
Expand Down Expand Up @@ -91,6 +91,9 @@ class ResourceTemplate(AzureTREModel):
def _serialize(self, handler: Any, info: Any) -> dict:
data = handler(self)
_strip_none_recursive(data) # covers allOf and other plain-dict fields missed by exclude_none
for field_name, schema_key in (("schema_uri", "$schema"), ("schema_id", "$id"), ("defs", "$defs")):
if field_name in data:
data[schema_key] = data.pop(field_name)
return data

id: str
Expand All @@ -101,6 +104,9 @@ def _serialize(self, handler: Any, info: Any) -> dict:
resourceType: ResourceType = Field(title="Type of resource this template is for (workspace/service)")
current: bool = Field(title="Is this the current version of this template")
type: str = "object"
schema_uri: Optional[str] = Field(default=None, alias="$schema")
schema_id: Optional[str] = Field(default=None, alias="$id")
defs: Optional[dict] = Field(default=None, alias="$defs")
required: List[str] = Field(title="List of properties which must be provided")
authorizedRoles: Optional[List[str]] = Field(default_factory=list, title="If not empty, the user is required to have one of these roles to install the template")
properties: Dict[str, Property] = Field(title="Template properties")
Expand Down
2 changes: 1 addition & 1 deletion api_app/models/schemas/shared_service_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SharedServiceTemplateInCreate(ResourceTemplateInCreate):
"version": "0.0.1",
"current": True,
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/shared_services/myshared_service/shared_service.json",
"type": "object",
"title": "My Shared Service Template",
Expand Down
2 changes: 1 addition & 1 deletion api_app/models/schemas/user_resource_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class UserResourceTemplateInCreate(ResourceTemplateInCreate):
"version": "0.0.1",
"current": True,
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/user_resource.json",
"type": "object",
"title": "My User Resource Template",
Expand Down
2 changes: 1 addition & 1 deletion api_app/models/schemas/workspace_service_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class WorkspaceServiceTemplateInCreate(ResourceTemplateInCreate):
"version": "0.0.1",
"current": True,
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace_service.json",
"type": "object",
"title": "My Workspace Service Template",
Expand Down
2 changes: 1 addition & 1 deletion api_app/models/schemas/workspace_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WorkspaceTemplateInCreate(ResourceTemplateInCreate):
"version": "0.0.1",
"current": True,
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace.json",
"type": "object",
"title": "My Workspace Template",
Expand Down
2 changes: 1 addition & 1 deletion api_app/schemas/azuread.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/schema/azuread.json",
"type": "object",
"title": "Azure AD Authorisation Schema",
Expand Down
2 changes: 1 addition & 1 deletion api_app/schemas/shared_service.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/schema/shared_service.json",
"type": "object",
"title": "Shared Service Default Parameters",
Expand Down
2 changes: 1 addition & 1 deletion api_app/schemas/user_resource.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/schema/user_resource.json",
"type": "object",
"title": "User Resource Default Parameters",
Expand Down
2 changes: 1 addition & 1 deletion api_app/schemas/workspace.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/schema/workspace.json",
"type": "object",
"title": "Workspace Default Parameters",
Expand Down
2 changes: 1 addition & 1 deletion api_app/schemas/workspace_service.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/schema/workspace_service.json",
"type": "object",
"title": "Workspace Service Default Parameters",
Expand Down
10 changes: 5 additions & 5 deletions api_app/tests_ma/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def input_workspace_template():
version="0.0.1",
current=True,
json_schema={
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace.json",
"type": "object",
"title": "My Workspace Template",
Expand Down Expand Up @@ -101,7 +101,7 @@ def input_workspace_service_template():
version="0.0.1",
current=True,
json_schema={
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace_service.json",
"type": "object",
"title": "My Workspace Service Template",
Expand All @@ -122,11 +122,11 @@ def input_user_resource_template():
version="0.0.1",
current=True,
json_schema={
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/user_resource.json",
"type": "object",
"title": "My User Resource Template",
"description": "These is a test user resource template schema",
"description": "This is a test user resource template schema",
"required": [],
"properties": {},
},
Expand All @@ -143,7 +143,7 @@ def input_shared_service_template():
version="0.0.1",
current=True,
json_schema={
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/shared_services/mysharedservice/shared_service.json",
"type": "object",
"title": "My Shared Service Template",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,38 @@ async def test_create_workspace_template_succeeds_without_required(uuid_mock, sa
assert expected_resource_template == returned_template


@patch('db.repositories.resource_templates.ResourceTemplateRepository.save_item')
@patch('uuid.uuid4')
async def test_create_workspace_template_preserves_json_schema_metadata(uuid_mock, save_item_mock, resource_template_repo):
uuid_mock.return_value = "1234"
input_workspace_template = WorkspaceTemplateInCreate(
name="schema-metadata-template",
version="0.0.1",
current=True,
json_schema={
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schema-metadata-template",
"$defs": {"nullable_string": {"type": ["string", "null"]}},
"title": "Schema metadata template",
"description": "A template using Draft 2020-12 metadata",
"properties": {"value": {"type": ["string", "null"]}},
},
customActions=[],
)

returned_template = await resource_template_repo.create_template(input_workspace_template, ResourceType.Workspace)

assert returned_template.schema_uri == input_workspace_template.json_schema["$schema"]
assert returned_template.schema_id == input_workspace_template.json_schema["$id"]
assert returned_template.defs == input_workspace_template.json_schema["$defs"]
assert returned_template.properties["value"].type == ["string", "null"]
serialized_template = returned_template.model_dump()
assert serialized_template["$schema"] == input_workspace_template.json_schema["$schema"]
assert serialized_template["$id"] == input_workspace_template.json_schema["$id"]
assert serialized_template["$defs"] == input_workspace_template.json_schema["$defs"]
save_item_mock.assert_called_once_with(returned_template)


@patch('db.repositories.resource_templates.ResourceTemplateRepository.query')
async def test_get_by_name_and_version_queries_db(query_mock, resource_template_repo):
expected_query = 'SELECT * FROM c WHERE c.resourceType = @resourceType AND c.name = @name AND c.version = @version'
Expand Down Expand Up @@ -190,6 +222,8 @@ async def test_create_workspace_template_item_calls_create_item_with_the_correct
description=input_workspace_template.json_schema["description"],
version=input_workspace_template.version,
resourceType=ResourceType.Workspace,
schema_uri=input_workspace_template.json_schema["$schema"],
schema_id=input_workspace_template.json_schema["$id"],
properties=input_workspace_template.json_schema["properties"],
allOf=input_workspace_template.json_schema["allOf"],
customActions=input_workspace_template.customActions,
Expand All @@ -213,6 +247,8 @@ async def test_create_item_created_with_the_expected_type(uuid_mock, save_item_m
description=input_workspace_template.json_schema["description"],
version=input_workspace_template.version,
resourceType=expected_type,
schema_uri=input_workspace_template.json_schema["$schema"],
schema_id=input_workspace_template.json_schema["$id"],
properties=input_workspace_template.json_schema["properties"],
allOf=input_workspace_template.json_schema["allOf"],
customActions=input_workspace_template.customActions,
Expand Down Expand Up @@ -243,6 +279,8 @@ async def test_create_item_with_pipeline_succeeds(uuid_mock, save_item_mock, res
description=input_user_resource_template.json_schema["description"],
version=input_user_resource_template.version,
resourceType=expected_type,
schema_uri=input_user_resource_template.json_schema["$schema"],
schema_id=input_user_resource_template.json_schema["$id"],
properties=input_user_resource_template.json_schema["properties"],
customActions=input_user_resource_template.customActions,
required=input_user_resource_template.json_schema["required"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ async def test_create_shared_service_template_item_calls_create_item_with_the_co
actions=input_shared_service_template.customActions,
required=input_shared_service_template.json_schema["required"],
current=input_shared_service_template.current,
schema_uri=input_shared_service_template.json_schema["$schema"],
schema_id=input_shared_service_template.json_schema["$id"],
)
save_item_mock.assert_called_once_with(expected_resource_template)
assert expected_resource_template == returned_template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ async def test_create_user_resource_template_item_calls_create_item_with_the_cor
customActions=input_user_resource_template.customActions,
required=input_user_resource_template.json_schema["required"],
current=input_user_resource_template.current,
schema_uri=input_user_resource_template.json_schema["$schema"],
schema_id=input_user_resource_template.json_schema["$id"],
parentWorkspaceService="parent_service_template_name"
)
save_item_mock.assert_called_once_with(expected_resource_template)
Expand Down
8 changes: 3 additions & 5 deletions api_http_requests/API Template Modifying Endpoints.http
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Content-Type: {{contentType}}
"version": "0.0.3",
"current": "true",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace.json",
"type": "object",
"title": "My Workspace Template",
Expand All @@ -21,7 +21,6 @@ Content-Type: {{contentType}}
],
"properties": {
"vm_size": {
"$id": "#/properties/vm_size",
"type": "string",
"title": "VM size",
"description": "Size of the VMs in my workspace",
Expand All @@ -33,7 +32,6 @@ Content-Type: {{contentType}}
]
},
"no_of_vms": {
"$id": "#/properties/no_of_vms",
"type": "integer",
"title": "Number of VMs",
"description": "Number of virtual machines to be deployed in the workspace",
Expand All @@ -55,7 +53,7 @@ Content-Type: {{contentType}}
"version": "0.0.1",
"current": "true",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace_service.json",
"type": "object",
"title": "My Workspace Service Template",
Expand All @@ -77,7 +75,7 @@ Content-Type: {{contentType}}
"version": "0.0.1",
"current": "true",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/user_resource.json",
"type": "object",
"title": "My User Resource Template",
Expand Down
8 changes: 3 additions & 5 deletions api_http_requests/API User Journey.http
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Content-Type: {{contentType}}
"version": "0.0.3",
"current": "true",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace.json",
"type": "object",
"title": "My Workspace Template",
Expand All @@ -23,7 +23,6 @@ Content-Type: {{contentType}}
],
"properties": {
"vm_size": {
"$id": "#/properties/vm_size",
"type": "string",
"title": "VM size",
"description": "Size of the VMs in my workspace",
Expand All @@ -35,7 +34,6 @@ Content-Type: {{contentType}}
]
},
"no_of_vms": {
"$id": "#/properties/no_of_vms",
"type": "integer",
"title": "Number of VMs",
"description": "Number of virtual machines to be deployed in the workspace",
Expand All @@ -57,7 +55,7 @@ Content-Type: {{contentType}}
"version": "0.0.1",
"current": "true",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/workspace_service.json",
"type": "object",
"title": "My Workspace Service Template",
Expand All @@ -79,7 +77,7 @@ Content-Type: {{contentType}}
"version": "0.0.1",
"current": "true",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/myworkspace/user_resource.json",
"type": "object",
"title": "My User Resource Template",
Expand Down
6 changes: 3 additions & 3 deletions docs/schemas/operation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"format": "uuid"
},
"resourceVersion": {
"type": "string",
"type": "integer",
"description": "Resource version."
},
"createdAt": {
Expand Down Expand Up @@ -73,7 +73,7 @@
"type": "string",
"description": "Event timestamp."
},
"description": {
"message": {
"type": "string",
"description": "Event message."
},
Expand Down
4 changes: 2 additions & 2 deletions docs/schemas/resource-assignment.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
Expand All @@ -11,7 +11,7 @@
"description": "User id.",
"format": "uuid"
},
"ResourceId": {
"resourceId": {
"type": "string",
"description": "Resource id.",
"format": "uuid"
Expand Down
6 changes: 3 additions & 3 deletions docs/schemas/resource.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
Expand All @@ -16,8 +16,8 @@
"type": "string",
"description": "Resource specification version."
},
"ResourceVersion": {
"type": "string",
"resourceVersion": {
"type": "integer",
"description": "Resource version."
},
"title": {
Expand Down
Loading
Loading