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

Define standards to deprecate in Rest Api Spec #35262

Closed
mayya-sharipova opened this issue Nov 5, 2018 · 4 comments
Closed

Define standards to deprecate in Rest Api Spec #35262

mayya-sharipova opened this issue Nov 5, 2018 · 4 comments
Labels
:Core/Infra/REST API REST infrastructure and utilities

Comments

@mayya-sharipova
Copy link
Contributor

It seems that we don't have a standard to deprecate APIs or part of APIs (fields, methods etc) in our Rest API specification files:
rest-api-spec/src/main/resources/rest-api-spec/api/*.json

In this issue we can propose possible ways to define deprecations, and come up with a single standard way.

relates to #34771

@mayya-sharipova
Copy link
Contributor Author

My suggestion is to add a "deprecated" object field to the specification:
For example:

"deprecated" : {
  "version": "5.0",
  "description" : "Use regular count endpoint instead."
}

And depending what is deprecated (main API, or a field) put it on the corresponding level.

Example - the whole API is deprecated:

{
  "count_percolate": {
    "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-percolate.html",
    "methods": ["GET", "POST"],
    "url": {},
    "body" : {},
    "deprecated" : {
      "version": "5.0",
      "description" : "Use regular count endpoint instead."
   }
}

@mayya-sharipova mayya-sharipova added the :Core/Infra/REST API REST infrastructure and utilities label Nov 5, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@Mpdreamz
Copy link
Member

Mpdreamz commented Feb 5, 2019

Love this proposal, would love to help out getting this into the rest spec.

One remaining question I have is around deprecated urls paths.

In #38102 I proposed:

"deprecated_paths": ["/{index}/{type}/{id}"]

But perhaps the following falls more in line with your proposal @mayya-sharipova

"deprecated_paths": [ { "url": "/{index}/{type}/{id}", "version": "5.0", "description": "" } ]

cc @elastic/es-clients

@mayya-sharipova
Copy link
Contributor Author

closing the issue, as it will be addressed by #39063

Mpdreamz added a commit to Mpdreamz/elasticsearch that referenced this issue Apr 9, 2019
Mpdreamz added a commit that referenced this issue Apr 23, 2019
* fix #35262 define deprecations of API's as a whole and urls

* document hot threads deprecated paths

* deprecate scroll_id as part of the URL, documented only as part of the body which is a safer behaviour as well

* use version numbers up to patch version

* rest spec parser picks up deprecated paths as paths too
Mpdreamz added a commit that referenced this issue Apr 23, 2019
* fix #35262 define deprecations of API's as a whole and urls

* document hot threads deprecated paths

* deprecate scroll_id as part of the URL, documented only as part of the body which is a safer behaviour as well

* use version numbers up to patch version

* rest spec parser picks up deprecated paths as paths too

(cherry picked from commit 7e06023)
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this issue May 27, 2019
…lastic#39063)

* fix elastic#35262 define deprecations of API's as a whole and urls

* document hot threads deprecated paths

* deprecate scroll_id as part of the URL, documented only as part of the body which is a safer behaviour as well

* use version numbers up to patch version

* rest spec parser picks up deprecated paths as paths too
Mpdreamz added a commit that referenced this issue Jun 11, 2019
* Documents the new deprecations options on the rest-api-spec

Relates #41439 #38613 #35262

* remove reference to path now that #41452 is merged, also fixed missing a comma rendering the example json invalid

* removed one more instance of path

* make sure json examples are self contained and not excerpts
Mpdreamz added a commit to Mpdreamz/elasticsearch that referenced this issue Jun 11, 2019
…41444)

* Documents the new deprecations options on the rest-api-spec

Relates elastic#41439 elastic#38613 elastic#35262

* remove reference to path now that elastic#41452 is merged, also fixed missing a comma rendering the example json invalid

* removed one more instance of path

* make sure json examples are self contained and not excerpts

(cherry picked from commit 4430f99)
Mpdreamz added a commit to Mpdreamz/elasticsearch that referenced this issue Jun 11, 2019
…41444)

* Documents the new deprecations options on the rest-api-spec

Relates elastic#41439 elastic#38613 elastic#35262

* remove reference to path now that elastic#41452 is merged, also fixed missing a comma rendering the example json invalid

* removed one more instance of path

* make sure json examples are self contained and not excerpts

(cherry picked from commit 4430f99)
Mpdreamz added a commit that referenced this issue Jun 11, 2019
…43090)

* Documents the new deprecations options on the rest-api-spec

Relates #41439 #38613 #35262

* remove reference to path now that #41452 is merged, also fixed missing a comma rendering the example json invalid

* removed one more instance of path

* make sure json examples are self contained and not excerpts

(cherry picked from commit 4430f99)
Mpdreamz added a commit that referenced this issue Jun 11, 2019
…43089)

* Documents the new deprecations options on the rest-api-spec

Relates #41439 #38613 #35262

* remove reference to path now that #41452 is merged, also fixed missing a comma rendering the example json invalid

* removed one more instance of path

* make sure json examples are self contained and not excerpts

(cherry picked from commit 4430f99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/REST API REST infrastructure and utilities
Projects
None yet
Development

No branches or pull requests

3 participants