Skip to content

Update JSON Schema version to Draft 2020-12 - #5005

Open
James Chapman (JC-wk) wants to merge 36 commits into
microsoft:mainfrom
JC-wk:json-schema
Open

Update JSON Schema version to Draft 2020-12#5005
James Chapman (JC-wk) wants to merge 36 commits into
microsoft:mainfrom
JC-wk:json-schema

Conversation

@JC-wk

@JC-wk James Chapman (JC-wk) commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Resolves #4795

What is being addressed

Various schema are currently in use, this aligns templates to the latest.
Minor spelling and naming issues are also fixed
fixes issues in template schema docs

How is this addressed

  • Updated version numbers for several shared services and workspace templates to reflect new changes.
  • Update documentation
  • Update CHANGELOG.md
  • Increment template versions

James Chapman added 7 commits July 27, 2026 08:11
… and schemas

- Changed "$schema" from "http://json-schema.org/draft-07/schema" to "https://json-schema.org/draft/2020-12/schema" in:
  - api_app/schemas/workspace_service.json
  - api_app/tests_ma/conftest.py
  - api_http_requests/API Template Modifying Endpoints.http
  - api_http_requests/API User Journey.http
  - docs/schemas/operation.json
  - docs/schemas/resource-assignment.json
  - docs/schemas/resource.json
  - docs/tre-templates/pipeline-templates/overview.md
  - docs/tre-workspace-authors/authoring-workspace-templates.md
  - e2e_tests/test.http
  - e2e_tests/test_workspace_service_templates.py
  - templates/shared_services/admin-vm/template_schema.json
  - templates/shared_services/airlock_notifier/template_schema.json
  - templates/shared_services/certs/template_schema.json
  - templates/shared_services/cyclecloud/template_schema.json
  - templates/shared_services/databricks-auth/template_schema.json
  - templates/shared_services/firewall/template_schema.json
  - templates/shared_services/gitea/template_schema.json
  - templates/shared_services/sonatype-nexus-vm/template_schema.json
  - templates/workspace_services/azureml/template_schema.json
  - templates/workspace_services/azuresql/template_schema.json
  - templates/workspace_services/databricks/template_schema.json
  - templates/workspace_services/guacamole/template_schema.json
  - templates/workspaces/airlock-import-review/template_schema.json
  - templates/workspaces/base/template_schema.json
  - templates/workspaces/unrestricted/template_schema.json

- Updated version numbers for several shared services and workspace templates to reflect new changes.
Copilot AI balanced review requested due to automatic review settings July 27, 2026 11:05
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Unit Test Results

764 tests   764 ✅  10s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 37ab365.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Azure TRE’s template JSON Schemas and documentation to standardize on JSON Schema Draft 2020-12, aligning templates/docs/examples with newer keywords (e.g., unevaluatedProperties) and keeping template/API versions in sync.

Changes:

  • Switched $schema declarations across templates, API schema files, tests, and docs to https://json-schema.org/draft/2020-12/schema.
  • Bumped multiple template bundle versions (Porter version:) to reflect the schema change.
  • Updated documentation and HTTP/e2e examples that embed JSON schema snippets.

Reviewed changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
templates/workspaces/unrestricted/template_schema.json Updates workspace template schema $schema to Draft 2020-12.
templates/workspaces/unrestricted/porter.yaml Patch bump for unrestricted workspace bundle version.
templates/workspaces/base/template_schema.json Updates workspace base schema $schema to Draft 2020-12.
templates/workspaces/base/porter.yaml Patch bump for base workspace bundle version.
templates/workspaces/airlock-import-review/template_schema.json Updates airlock import review workspace $schema to Draft 2020-12.
templates/workspaces/airlock-import-review/porter.yaml Patch bump for airlock import review workspace bundle version.
templates/workspace_services/openai/template_schema.json Updates OpenAI service schema $schema to Draft 2020-12.
templates/workspace_services/openai/porter.yaml Patch bump for OpenAI workspace service bundle version.
templates/workspace_services/ohdsi/template_schema.json Updates OHDSI service schema $schema to Draft 2020-12.
templates/workspace_services/ohdsi/porter.yaml Patch bump for OHDSI workspace service bundle version.
templates/workspace_services/mysql/template_schema.json Updates MySQL service schema $schema to Draft 2020-12.
templates/workspace_services/mysql/porter.yaml Patch bump for MySQL workspace service bundle version.
templates/workspace_services/health-services/template_schema.json Updates health services schema $schema to Draft 2020-12.
templates/workspace_services/health-services/porter.yaml Patch bump for health services workspace service bundle version.
templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/template_schema.json Updates Guacamole Windows VM user resource schema $schema to Draft 2020-12.
templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/porter.yaml Patch bump for Guacamole Windows VM user resource bundle version.
templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json Updates Guacamole Linux VM user resource schema $schema to Draft 2020-12.
templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/porter.yaml Patch bump for Guacamole Linux VM user resource bundle version.
templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/template_schema.json Updates Guacamole import review VM user resource schema $schema to Draft 2020-12.
templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/porter.yaml Patch bump for Guacamole import review VM user resource bundle version.
templates/workspace_services/guacamole/user_resources/guacamole-azure-export-reviewvm/template_schema.json Updates Guacamole export review VM user resource schema $schema to Draft 2020-12.
templates/workspace_services/guacamole/user_resources/guacamole-azure-export-reviewvm/porter.yaml Patch bump for Guacamole export review VM user resource bundle version.
templates/workspace_services/guacamole/template_schema.json Updates Guacamole workspace service schema $schema to Draft 2020-12.
templates/workspace_services/guacamole/porter.yaml Patch bump for Guacamole workspace service bundle version.
templates/workspace_services/gitea/template_schema.json Updates Gitea workspace service schema $schema to Draft 2020-12.
templates/workspace_services/gitea/porter.yaml Patch bump for Gitea workspace service bundle version.
templates/workspace_services/databricks/template_schema.json Updates Databricks workspace service schema $schema to Draft 2020-12.
templates/workspace_services/databricks/porter.yaml Patch bump for Databricks workspace service bundle version.
templates/workspace_services/azuresql/template_schema.json Updates Azure SQL workspace service schema $schema to Draft 2020-12.
templates/workspace_services/azuresql/porter.yaml Patch bump for Azure SQL workspace service bundle version.
templates/workspace_services/azureml/user_resources/aml_compute/template_schema.json Updates AML compute user resource schema $schema to Draft 2020-12.
templates/workspace_services/azureml/user_resources/aml_compute/porter.yaml Patch bump for AML compute user resource bundle version.
templates/workspace_services/azureml/template_schema.json Updates AzureML workspace service schema $schema to Draft 2020-12.
templates/workspace_services/azureml/porter.yaml Patch bump for AzureML workspace service bundle version.
templates/shared_services/sonatype-nexus-vm/template_schema.json Updates Nexus shared service schema $schema to Draft 2020-12.
templates/shared_services/sonatype-nexus-vm/porter.yaml Patch bump for Nexus shared service bundle version.
templates/shared_services/gitea/template_schema.json Updates shared Gitea schema $schema to Draft 2020-12.
templates/shared_services/gitea/porter.yaml Patch bump for shared Gitea bundle version.
templates/shared_services/firewall/template_schema.json Updates firewall shared service schema $schema to Draft 2020-12.
templates/shared_services/firewall/porter.yaml Patch bump for firewall shared service bundle version.
templates/shared_services/databricks-auth/template_schema.json Updates databricks-auth shared service schema $schema to Draft 2020-12.
templates/shared_services/databricks-auth/porter.yaml Patch bump for databricks-auth shared service bundle version.
templates/shared_services/cyclecloud/template_schema.json Updates CycleCloud shared service schema $schema to Draft 2020-12.
templates/shared_services/cyclecloud/porter.yaml Patch bump for CycleCloud shared service bundle version.
templates/shared_services/certs/template_schema.json Updates certs shared service schema $schema to Draft 2020-12.
templates/shared_services/certs/porter.yaml Patch bump for certs shared service bundle version.
templates/shared_services/airlock_notifier/template_schema.json Updates airlock notifier schema $schema to Draft 2020-12.
templates/shared_services/airlock_notifier/porter.yaml Patch bump for airlock notifier shared service bundle version.
templates/shared_services/admin-vm/template_schema.json Updates admin-vm shared service schema $schema to Draft 2020-12.
templates/shared_services/admin-vm/porter.yaml Patch bump for admin-vm shared service bundle version.
e2e_tests/test.http Updates embedded $schema in HTTP test payload to Draft 2020-12.
e2e_tests/test_workspace_service_templates.py Updates embedded $schema in e2e test payload to Draft 2020-12.
docs/tre-workspace-authors/authoring-workspace-templates.md Documents Draft 2020-12 as the template schema standard.
docs/tre-templates/pipeline-templates/overview.md Updates example $schema value to Draft 2020-12.
docs/schemas/resource.json Updates docs schema $schema to Draft 2020-12.
docs/schemas/resource-assignment.json Updates docs schema $schema to Draft 2020-12.
docs/schemas/operation.json Updates docs schema $schema to Draft 2020-12.
api_http_requests/API User Journey.http Updates embedded $schema values in request examples to Draft 2020-12.
api_http_requests/API Template Modifying Endpoints.http Updates embedded $schema values in request examples to Draft 2020-12.
api_app/tests_ma/conftest.py Updates test fixtures’ $schema values to Draft 2020-12.
api_app/schemas/workspace.json Updates API schema $schema to Draft 2020-12.
api_app/schemas/workspace_service.json Updates API schema $schema to Draft 2020-12.
api_app/schemas/user_resource.json Updates API schema $schema to Draft 2020-12.
api_app/schemas/shared_service.json Updates API schema $schema to Draft 2020-12.
api_app/schemas/azuread.json Updates API schema $schema to Draft 2020-12.
api_app/models/schemas/workspace_template.py Updates OpenAPI example $schema to Draft 2020-12.
api_app/models/schemas/workspace_service_template.py Updates OpenAPI example $schema to Draft 2020-12.
api_app/models/schemas/user_resource_template.py Updates OpenAPI example $schema to Draft 2020-12.
api_app/models/schemas/shared_service_template.py Updates OpenAPI example $schema to Draft 2020-12.
api_app/_version.py Bumps API version to 0.26.0.

Comment thread templates/workspaces/unrestricted/template_schema.json Outdated
Comment thread templates/workspaces/airlock-import-review/template_schema.json Outdated
Comment thread templates/workspace_services/openai/template_schema.json Outdated
Comment thread templates/workspace_services/mysql/template_schema.json Outdated
Comment thread templates/workspace_services/gitea/template_schema.json Outdated
Comment thread templates/shared_services/cyclecloud/template_schema.json Outdated
Comment thread templates/workspace_services/health-services/template_schema.json Outdated
Comment thread docs/tre-workspace-authors/authoring-workspace-templates.md
Copilot AI review requested due to automatic review settings July 27, 2026 11:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 71 out of 71 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (8)

templates/workspaces/unrestricted/template_schema.json:3

  • The schema "$id" points to the base workspace schema URL, but this file is the unrestricted workspace schema. This makes the schema identifier non-unique and can break $ref resolution/caching in validators.
    templates/workspace_services/openai/template_schema.json:3
  • The schema "$id" points to the SQL workspace service schema URL, but this file is the OpenAI workspace service schema. Using the wrong $id can cause incorrect schema identification and $ref resolution issues.
    templates/workspace_services/mysql/template_schema.json:3
  • The schema "$id" points to the SQL workspace service schema URL, but this file is the MySQL workspace service schema. The $id should uniquely identify this schema.
    templates/workspace_services/gitea/template_schema.json:3
  • The schema "$id" currently points to the Guacamole workspace service schema URL instead of the Gitea schema. This makes the schema identifier misleading/non-unique.
    templates/shared_services/cyclecloud/template_schema.json:3
  • The schema "$id" points to a Guacamole user resource schema URL, but this file is the CycleCloud shared service schema. The $id should be updated to the canonical CycleCloud schema URL.
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json",

templates/workspace_services/health-services/template_schema.json:3

  • The schema "$id" URL uses "healthcare_services" but the template lives under "health-services". Keeping the $id aligned with the actual canonical path avoids confusion and makes schema identifiers consistent across templates.
    templates/workspaces/airlock-import-review/template_schema.json:3
  • The schema "$id" uses "airlock_import_review" but the template directory name is "airlock-import-review". For consistency (and to avoid broken canonical links), the $id should match the actual path.
    docs/tre-workspace-authors/authoring-workspace-templates.md:86
  • The fenced ```json example is not valid JSON (it’s missing the surrounding braces). This can confuse readers and some renderers/linters.
```json
"$schema": "https://json-schema.org/draft/2020-12/schema"
</details>

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 11:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 71 out of 71 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

docs/tre-workspace-authors/authoring-workspace-templates.md:86

  • The JSON example in the code block is not valid JSON (it shows only a property without surrounding braces). This can confuse readers and breaks JSON syntax highlighting/validation in many renderers. Consider showing a minimal valid JSON object instead.
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"

Copilot AI review requested due to automatic review settings July 27, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 71 out of 71 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (4)

api_app/models/schemas/shared_service_template.py:51

  • The sample schema example has a grammatical error ("These is") and the $id path uses myshared_service, which is inconsistent with the test fixture (mysharedservice) and other examples. Align the $id and fix the wording to avoid confusing API consumers.
                    "$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",
                    "description": "These is a test shared service resource template schema",

api_app/models/schemas/workspace_service_template.py:52

  • The sample schema example contains a grammatical error ("These is"). This text is surfaced in API schema examples, so it should read correctly.
                    "$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",
                    "description": "These is a test workspace service resource template schema",

api_app/models/schemas/user_resource_template.py:51

  • The sample schema example contains a grammatical error ("These is"). This is part of the API example payload and should read correctly.
                    "$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",

api_app/tests_ma/conftest.py:129

  • This test fixture schema has a grammatical error ("These is"). Fixing it improves readability and keeps fixtures aligned with the API schema examples.
            "$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",

Copilot AI review requested due to automatic review settings July 27, 2026 11:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 71 out of 71 changed files in this pull request and generated 2 comments.

Comment thread api_app/models/schemas/shared_service_template.py Outdated
Comment thread CHANGELOG.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Update JSON Schema version to Draft 2020-12.
Copilot AI review requested due to automatic review settings August 17, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 21, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.

Comment thread docs/tre-workspace-authors/authoring-workspace-templates.md Outdated
Copilot AI review requested due to automatic review settings August 24, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 74 out of 74 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 24, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 76 out of 76 changed files in this pull request and generated no new comments.

@rudolphjacksonm

Copy link
Copy Markdown
Collaborator

/test-extended 640575a

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/32858030276 (with refid 1647bd51)

(in response to this comment from Jack Morris (@rudolphjacksonm))

Copilot AI review requested due to automatic review settings September 3, 2026 10:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The migration is consistent across templates, documentation, API handling, versions, and metadata-preservation tests.

Review details
  • Files reviewed: 76/76 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@maxmartin-cgi

Copy link
Copy Markdown
Collaborator

/test-extended

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/33760100975 (with refid 1647bd51)

(in response to this comment from maxmartin-cgi)

Copilot AI review requested due to automatic review settings September 4, 2026 21:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The UI strips the new metadata and still validates with Draft 7, breaking Draft 2020-12 features such as $defs references.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 76/76 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +107 to +109
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Pipeline Template JSON Schema versions

5 participants