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

Add json schema for built-in feature filters #903

Merged
merged 6 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://azconfig.io/schemas/FeatureManagement/v1.0.0/TargetingFilter.json",
"type": "object",
"title": "A Microsoft Targeting Filter Declaration",
"required": [
"name"
],
"properties": {
"name": {
"$id": "#/properties/name",
"type": "string",
"title": "Targeting Filter Name",
"enum": [
"Microsoft.Targeting"
]
},
"parameters": {
"$id": "#/properties/parameters",
"type": "object",
"title": "Targeting Filter Parameters",
"properties": {
"Audience": {
"$id": "#/properties/parameters/properties/Audience",
"type": "object",
"title": "Targeting Filter Audience Parameter",
"properties": {
"DefaultRolloutPercentage": {
"$id": "#/properties/parameters/properties/Audience/properties/DefaultRolloutPercentage",
"type": "number",
"title": "Targeting Filter Default Rollout Percentage Parameter",
"minimum": 0,
"maximum": 100
},
"Users": {
"$id": "#/properties/parameters/properties/Audience/properties/Users",
"type": "array",
"title": "Targeting Filter Users Parameter",
"items": {
"type": "string"
}
},
"Groups": {
"$id": "#/properties/parameters/properties/Audience/properties/Groups",
"type": "array",
"title": "Targeting Filter Groups Parameter",
"items": {
"$id": "#/properties/parameters/properties/Audience/properties/Groups/items/Group",
"type": "object",
"title": "Targeting Filter Group Parameter",
"properties": {
"Name": {
"$id": "#/properties/parameters/properties/Audience/properties/Groups/items/Group/Name",
"type": "string",
"title": "Targeting Filter Group Name Parameter"
},
"RolloutPercentage": {
"$id": "#/properties/parameters/properties/Audience/properties/Groups/items/Group/RolloutPercentage",
"type": "number",
"title": "Targeting Filter Group RolloutPercentage Parameter",
"minimum": 0,
"maximum": 100
}
},
"required": [
"Name",
"RolloutPercentage"
]
}
},
"Exclusion": {
"$id": "#/properties/parameters/properties/Audience/properties/Exclusion",
"type": "object",
"title": "Targeting Filter Exclusion Parameter",
"properties": {
"Users": {
"$id": "#/properties/parameters/properties/Audience/properties/Exclusion/Users",
"type": "array",
"title": "Targeting Filter Exclusion Users Parameter",
"items": {
"type": "string"
}
},
"Groups": {
"$id": "#/properties/parameters/properties/Audience/properties/Exclusion/Groups",
"type": "array",
"title": "Targeting Filter Exclusion Groups Parameter",
"items": {
"type": "string"
}
}
}
}
},
"required": [
"DefaultRolloutPercentage"
]
}
},
"required": [
"Audience"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://azconfig.io/schemas/FeatureManagement/v1.0.0/TimeWindowFilter.json",
"type": "object",
"title": "A Microsoft Time Window Filter Declaration",
"required": [
"name"
],
"properties": {
"name": {
"$id": "#/properties/name",
"type": "string",
"title": "Time Window Filter Name",
"enum": ["Microsoft.TimeWindow"]
},
"parameters": {
"$id": "#/properties/parameters",
"type": "object",
"title": "Time Window Filter Parameters",
"properties": {
"Start": {
"$id": "#/properties/parameters/properties/Start",
"type": "string",
"title": "Time Window Filter Start Parameter",
"examples": [
"Wed, 1 May 2024 12:00:00 GMT",
"Wed, 1 May 2024 20:00:00 +0800"
]
},
"End": {
"$id": "#/properties/parameters/properties/End",
"type": "string",
"title": "Time Window Filter End Parameter",
"examples": [
"Thu, 2 May 2024 12:00:00 GMT",
"Thu, 2 May 2024 20:00:00 +0800"
]
}
},
"anyOf": [
{ "required": [
"Start"
]
},
{ "required": [
"End"
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://azconfig.io/schemas/FeatureManagement/v2.0.0/TimeWindowFilter.json",
"type": "object",
"title": "A Microsoft Time Window Filter Declaration",
"required": [
"name"
],
"properties": {
"name": {
"$id": "#/properties/name",
"type": "string",
"title": "Time Window Filter Name",
"enum": [
"Microsoft.TimeWindow"
]
},
"parameters": {
"$id": "#/properties/parameters",
"type": "object",
"title": "Time Window Filter Parameters",
"properties": {
"Start": {
"$id": "#/properties/parameter/properties/Start",
"type": "string",
"title": "Time Window Filter Start Parameter",
"examples": [
"Wed, 1 May 2024 12:00:00 GMT",
"Wed, 1 May 2024 20:00:00 +0800"
]
},
"End": {
"$id": "#/properties/parameters/properties/End",
"type": "string",
"title": "Time Window Filter End Parameter",
"examples": [
"Thu, 2 May 2024 12:00:00 GMT",
"Thu, 2 May 2024 20:00:00 +0800"
]
},
"Recurrence": {
"$id": "#/properties/parameters/properties/Recurrence",
"type": "object",
"title": "Time Window Filter Recurrence Parameter",
"properties": {
"Pattern": {
zhiyuanliang-ms marked this conversation as resolved.
Show resolved Hide resolved
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern",
"type": "object",
"title": "Time Window Filter Recurrence Pattern Parameter",
"required": [
"Type"
],
"properties": {
"Type": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/Type",
"type": "string",
"title": "Time Window Filter Recurrence Pattern Type Parameter",
"enum": [
"Daily",
"Weekly"
]
},
"Interval": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/Interval",
"type": "number",
"title": "Time Window Filter Recurrence Pattern Interval Parameter",
"default": 1
},
"DaysOfWeek": {
zhiyuanliang-ms marked this conversation as resolved.
Show resolved Hide resolved
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/DaysOfWeek",
"type": "array",
"title": "Time Window Filter Recurrence Weekly Pattern DaysOfWeek Parameter",
"items": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/DaysOfWeek/items",
"type": "string",
"title": "DayOfWeek",
"enum": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
]
}
},
"FirstDayOfWeek": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/FirstDayOfWeek",
"type": "string",
"title": "Time Window Filter Recurrence Weekly Pattern FirstDayOfWeek Parameter",
"enum": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
],
"default": "Sunday"
}
}
},
"Range": {
"required": [
"Type"
],
"properties": {
"Type": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Range/properties/Type",
"type": "string",
"title": "Time Window Filter Recurrence Range Type Parameter",
"enum": [
"NoEnd",
"EndDate",
"Numbered"
]
},
"EndDate": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Range/properties/EndDate",
"type": "string",
"title": "Time Window Filter Recurrence End Date Parameter",
"examples": [
"Wed, 1 May 2024 12:00:00 GMT",
"Wed, 1 May 2024 20:00:00 +0800"
]
},
"NumberOfOccurrences": {
"$id": "#/properties/parameters/properties/Recurrence/properties/Range/properties/NumberOfOccurrences",
"type": "number",
"title": "Time Window Filter Recurrence NumberOfOccurrences Parameter"
}
}
}
}
}
},
"anyOf": [
{
"required": [
"Start"
]
},
{
"required": [
"End"
]
},
{
"required": [
"Start",
"End",
"Recurrence"
]
}
]
}
}
}