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

Annotate paths with a version changelog #78

Closed
cmars opened this issue Nov 29, 2021 · 1 comment
Closed

Annotate paths with a version changelog #78

cmars opened this issue Nov 29, 2021 · 1 comment

Comments

@cmars
Copy link
Contributor

cmars commented Nov 29, 2021

API documentation needs to represent a "changelog" per resource endpoint: a list of versions in which a change to a given resource endpoint was released.

This can be represented as an OpenAPI extension on the PathInfo element. For example, a response to GET /openapi/experimental might show:

...
paths:
  /some_resource:
...
    x-snyk-api-version: '2021-08-09~experimental'
    x-snyk-api-releases: ['2021-06-07~experimental', '2021-07-21~beta', '2021-08-09~experimental']

Indicating that /some_resource has 3 versioned releases. The latest experimental is the one shown, but if one wanted to compare this against prior changes, they could look at 2021-06-07~experimental or 2021-07-21~beta.

To implement this (CC @mrded @jcsackett), I would look at adding the extensions to paths in vervet.LoadResourceVersionsFileset. After the sort, you'll have everything you need:

  • The OpenAPI specs at each resource version relevant to this particular resource.
  • Sorted in version order, ascending.

The dead-simplest approach would be to set x-snyk-api-releases to a slice containing this list of versions, at each version. That might be slightly redundant in cases where the only release change was an endpoint being added or removed, since this list of versions is per-resource rather than per-endpoint. In practice, that may not matter much -- it could be something to refine later, or we might actually want to highlight that the resource changed, while this particular endpoint did not.

cmars added a commit that referenced this issue Dec 5, 2021
API documentation needs to represent a "changelog" per resource
endpoint: a list of versions in which a change to a given resource
endpoint was released.

This change adds a list of other resource release versions in which a
particular path was declared for such navigation purposes.

Implements #78.
cmars added a commit to cmars/vervet that referenced this issue Dec 6, 2021
API documentation needs to represent a "changelog" per resource
endpoint: a list of versions in which a change to a given resource
endpoint was released.

This change adds a list of other resource release versions in which a
particular path was declared for such navigation purposes.

Implements snyk#78.
cmars added a commit to cmars/vervet that referenced this issue Dec 6, 2021
API documentation needs to represent a "changelog" per resource
endpoint: a list of versions in which a change to a given resource
endpoint was released.

This change adds a list of other resource release versions in which a
particular path was declared for such navigation purposes.

Implements snyk#78.
@cmars
Copy link
Contributor Author

cmars commented Dec 7, 2021

Fixed in #89

@cmars cmars closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant