Skip to content

Commit

Permalink
[7.8] json spec: allow null for documentation url (#55749) (#56624)
Browse files Browse the repository at this point in the history
This commit allows the JSON schema's documentation.url property to have a null value.
This can useful for cases where a feature is under development, and does not have
documentation published yet.

This commit also adds a documentation.url for two ml resources.
  • Loading branch information
jakelandis authored May 12, 2020
1 parent 867e053 commit c95a6f6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
32 changes: 31 additions & 1 deletion rest-api-spec/src/main/resources/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,37 @@
"$ref": "#/definitions/Body"
}
},
"if": {
"properties": {
"stability": {
"const": "stable"
}
}
},
"then": {
"properties": {
"documentation": {
"$ref": "#/definitions/Documentation",
"properties": {
"url" : {
"type": ["string"]
}
}
}
}
},
"else": {
"properties": {
"documentation": {
"$ref": "#/definitions/Documentation",
"properties": {
"url" : {
"type": ["string", "null"]
}
}
}
}
},
"required": [
"documentation",
"stability",
Expand Down Expand Up @@ -130,7 +161,6 @@
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"format": "uri"
},
"description": {
Expand Down
5 changes: 1 addition & 4 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,4 @@ testClusters.integTest {
extraConfigFile 'roles.yml', file('src/test/resources/roles.yml')
}

validateRestSpec {
ignore 'ml.validate.json'
ignore 'ml.validate_detector.json'
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ml.validate":{
"documentation":{
"url":null,
"url":"https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html",
"description":"Validates an anomaly detection job."
},
"stability":"stable",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ml.validate_detector":{
"documentation":{
"url":null,
"url":"https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html",
"description":"Validates an anomaly detection detector."
},
"stability":"stable",
Expand Down

0 comments on commit c95a6f6

Please sign in to comment.