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
2 changes: 1 addition & 1 deletion rest-api-spec/src/main/resources/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"type": ["string", "null"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the use of null be constrained only to APIs that have stability beta or experimental? This would align with APIs that are under development, whilst still providing benefit of having links for stable APIs

Copy link
Contributor Author

@jakelandis jakelandis Apr 29, 2020

Choose a reason for hiding this comment

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

I made the null conditional. So that only stable requires a string, the others (beta, experimental, and private) now allow null. 0b37977

As you pointed out below, this does indeed cause a validation error on the two ml specs below we will need to sort out first.

"format": "uri"
},
"description": {
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,4 @@ validateRestSpec {
ignore 'autoscaling.delete_autoscaling_policy.json'
ignore 'autoscaling.get_autoscaling_policy.json'
ignore 'autoscaling.put_autoscaling_policy.json'
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'
}