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

json spec: allow null for documentation url #55749

Merged
merged 10 commits into from
May 12, 2020
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 @@ -111,7 +111,4 @@ testClusters.integTest {
extraConfigFile 'roles.yml', file('src/test/resources/roles.yml')
}

validateRestSpec {
ignore 'ml.validate.json'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these are stable APIs, so would clash with the previous comment about allowing null only for beta and experimental APIs. Perhaps we can link to ML jobs documentation for these specs for now? For example,

https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html

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