from semver.org:

Software using Semantic Versioning MUST declare a public API. This API could be declared in the code itself or exist strictly in documentation. However it is done, it should be precise and comprehensive.

Why are we forced to declare a public API? Why can't I use it for my own website that has no API?

Perhaps I am wrong with the definition. For me it is a part of the site desigedn for other developers (i.e.: api.example.com) that allow them to query my website and get the result into structured data (json, xml...).

  • They're not talking about web service APIs. They're talking about the actual code. – Doval May 14 '14 at 19:41

It requires a public API in order to effectively apply it's versioning pattern.

For example:

Bug fixes not affecting the API increment the patch version

Backwards compatible API additions/changes increment the minor version, and...

Backwards incompatible API changes increment the major version.

What represents your API is subjective, as they even state in the SemVer doc:

This may consist of documentation or be enforced by the code itself.

I think that is where your misunderstanding is. An API is not necessarily...

a part of the site designed for other developers that allow them to query my website and get the result into structured data

It could be that. Who knows. It could also be a set of documented UX rules.

If you can't effectively outline what your website's API is, then maybe SemVer isn't appropriate.

| improve this answer | |
  • So if my website is just coded for me I don't need semantic versionning if I understand – Vinz243 May 14 '14 at 19:58
  • That is completely possible. – BrandonV May 14 '14 at 19:59
  • I apologize for being stupid, but their is no I interest in using semantic versionning for me? Also, where should I put the versionning if there is a public api as described ? For the whole website or just for the part? – Vinz243 May 14 '14 at 20:04
  • These are all "it depends" type questions. We don't know enough about your use case to say "this doesn't make sense for you". All we can say is "this may not make sense". When versioning a web-service, it is common to use path parameters as ''/api/v2/people/42''. If you're talking about language specific APIs / libraries, the versioning really depends on the framework and implementation (Java, PHP, C#). – BrandonV May 14 '14 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.