0

I am deploying a FastAPI application to docker and I'm pondering how to best manage the Semantic Versioning.

Since it is just an API, I would think that MAJOR.MINOR.PATCH could be determined by comparing the previous builds OpenAPI Spec to the current builds OpenAPI Spec. If the request or response interface has changed, then increment the version accordingly.

Is this something that would work and is there something that already provides this functionality? If not, what approaches are used today to auto manage Semantic Versioning?

Thanks!

David Maze
  • 130,717
  • 29
  • 175
  • 215
Kenton Parton
  • 70
  • 1
  • 5
  • 1
    It could work. If there is no change in the spec, you could increase PATCH, if there is only added endpoints, then increase MINOR and if there is a change to existing endpoints (in either request or responses) your would increase MAJOR. I am not aware of any standard packages that provide this functionality in an CICD pipeline though, you might need to build the logic yourself. – JarroVGIT Jul 10 '22 at 11:02
  • In my projects i use a version.py file with a ```__version__ = 1.1.1``` or if it's a lib i have a variable version in my setup.py. Both can be called in your doc variable setting class i believe – Bastien B Jul 11 '22 at 10:14

0 Answers0