Skip to content
Open
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
18 changes: 11 additions & 7 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Validate sample queries
on:
workflow_dispatch:

push:
paths:
- sample-queries/sample-queries.json
- scripts/**
- tests/**
- package.json
- package-lock.json

pull_request:
paths:
- sample-queries/sample-queries.json
Expand All @@ -19,18 +22,19 @@ jobs:
validate-json-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Validate json schema
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /tests/samples.schema.json
INPUT_JSONS: /sample-queries/sample-queries.json
- uses: actions/checkout@v5

- name: Validate JSON schema
uses: dsanders11/[email protected]
with:
schema: tests/samples.schema.json
files: sample-queries/sample-queries.json

test:
runs-on: ubuntu-latest
needs: validate-json-schema
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5

- name: Install
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion sample-queries/sample-queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -3668,7 +3668,7 @@
"postBody": "{\r\n \"@odata.type\": \"#microsoft.graph.windowsUpdates.contentApproval\",\r\n \"content\": {\r\n \"@odata.type\": \"#microsoft.graph.windowsUpdates.catalogContent\",\r\n \"catalogEntry\": {\r\n \"@odata.type\": \"#microsoft.graph.windowsUpdates.driverUpdateCatalogEntry\",\r\n \"id\": \"{catalogEntryId}\"\r\n }\r\n }\r\n}",
"tip": "Please enable the WindowsUpdates.ReadWrite.All permission to use this query. To find a value for the updatePolicyId parameter, you can run: GET https://graph.microsoft.com/beta/admin/windows/updates/updatePolicies.",
"skipTest": false
},
},
{
"id": "eba3d860-f13d-4eec-8cca-44b62507d67f",
"category": "Windows Updates",
Expand Down
135 changes: 66 additions & 69 deletions tests/samples.schema.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,78 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"SampleQueries": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"category": {
"type": "string"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
]
},
"humanName": {
"type": "string"
},
"requestUrl": {
"type": "string"
},
"docLink": {
"type": "string",
"format": "uri"
},
"tip": {
"type": "string"
},
"postBody": {
"type": "string"
},
"headers": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"name",
"value"
]
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"category": {
"type": "string"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
]
},
"humanName": {
"type": "string"
},
"requestUrl": {
"type": "string"
},
"docLink": {
"type": "string",
"format": "uri"
},
"tip": {
"type": "string"
},
"postBody": {
"type": "string"
},
"headers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"name",
"value"
]
},
"skipTest": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"id",
"category",
"method",
"humanName",
"requestUrl",
"docLink"
]
}
]
"skipTest": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"id",
"category",
"method",
"humanName",
"requestUrl",
"docLink"
]
}
}
},
"additionalProperties": false,
Expand Down