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

Public API: Document versioning policies of the API and change implications #1089

Open
tahini opened this issue Oct 30, 2024 · 0 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@tahini
Copy link
Collaborator

tahini commented Oct 30, 2024

The current API is 1.0. As long as we don't change or delete anything, we don't need to bump the major. But what about the minor? Any addition to the API should imply a minor version update.

To specify in which version a specific field or endpoint was added, copilot suggests:

  • either to mention in the description tag of the element
paths:
  /api/v1/newEndpoint:
    get:
      summary: New endpoint
      description: |
        This endpoint was added in version 1.2.0.
        Retrieves new data.
   ...
  • Use custom extensions starting with x-
paths:
  /api/v1/newEndpoint:
    get:
      summary: New endpoint
      description: Retrieves new data.
      x-added-in-version: '1.2.0'
  ...

The server should also have a /version or /versions endpoint to advertise which API versions it supports. Copilot agrees and suggests the following details:

  • Endpoint Path: Use a clear path like /api/versions.
  • Response Format: Return a structured JSON response with version details.
  • Version Details: Include version number, release date, status, and description.

with a response like this

[
  {
    "version": "1.0",
    "releaseDate": "2022-01-01",
    "status": "active",
    "description": "Initial release with basic functionality."
  },
  {
    "version": "1.1",
    "releaseDate": "2022-06-01",
    "status": "active",
    "description": "Added new endpoints for paths and nodes."
  },
  {
    "version": "1.2",
    "releaseDate": "2023-01-01",
    "status": "active",
    "description": "Introduced scenarios endpoint and other improvements."
  }
]
@tahini tahini added the documentation Improvements or additions to documentation label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant