-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments
@@ -130,7 +130,7 @@ | |||
"additionalProperties": false, | |||
"properties": { | |||
"url": { | |||
"type": "string", | |||
"type": ["string", "null"], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@@ -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' |
There was a problem hiding this comment.
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
@elastic/machine-learning - Is there any public documentation for |
No. There's no HLRC either. If I remember correctly the thinking was that they weren't as useful as the job validation that the ML UI does, so we didn't want to encourage people to use them. Officially they don't exist.
Given the above I guess they have to be "private". Will that mean none of the language clients include them? That would match the lack of HLRC. If having spec files is causing too many problems we could just delete the spec files altogether. |
thanks @droberts195, I changed the stability to 'private' and the validation should pass now with the conditional to allow null documentation. @russcam - not sure about the passivity for changing this to private. Any concerns from the client side ? Also, you may want to spot check that the conditional works correctly with what ever the clients are using to validate the spec. I am not 100% sure that merging of definitions from two places is fully part of the schema validation spec. |
@elasticmachine update branch |
@elasticmachine update branch |
Test failures are related: |
My apologies @jakelandis; the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some suggestions that would allow us to move forward with this.
The allowed types for Documentation based on stability looks good.
x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json
Outdated
Show resolved
Hide resolved
…_detector.json Co-authored-by: Russ Cam <[email protected]>
….json Co-authored-by: Russ Cam <[email protected]>
….json Co-authored-by: Russ Cam <[email protected]>
…_detector.json Co-authored-by: Russ Cam <[email protected]>
Thanks @russcam - I have applied the suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
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.
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.
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.
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.
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.
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.
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.