Kitura-OpenAPI icon indicating copy to clipboard operation
Kitura-OpenAPI copied to clipboard

Flag API changes

Open djones6 opened this issue 7 years ago • 0 comments

Use the Swagger generation of Kitura as the basis for implementing a mechanism to highlight API changes. This would be implemented by comparing the in-memory representation of the swagger with one previously written to disk.

This may be a problematic task as a comparison would be order dependent so a simple diff would probably not work. We would need some way of sorting the swagger prior to comparison.

Possibly we could add a hash generated from the in-memory model into the description in the file.

Assuming the above is achieved, then we also need to:

  1. Have a means to enable this feature, possibly only for debug, but not release.
  2. Highlight when a change has occurred and then implement an appropriate action; for example, output a message and halt the server.

Clear & Actionable Tasks

  • [ ] Implement a mechanism for comparing swagger documents on disk and in-memory.
  • [ ] Implement start-up arguments to enable the feature in debug mode.
  • [ ] At start-up, normalise the in-memory swagger and the on-disk swagger and compare them.
  • [ ] Highlight an API difference when is occurs .

djones6 avatar Nov 15 '18 16:11 djones6