question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version Enhancement to Compatibility Strategy

See original GitHub issue

The current OpenAPI Specification includes a field version in the Info Object that is a required string containing a version number for the API. Currently the specification does not state the semantics or syntax of the structure of this string. Community discussion has indicated a preference for semver format and semantics.

Versioning is really just an obvious, intuitive, and commonly used approach to the deeper issue of API compatibility. From that perspective, versioning is just one of several possible compatibility strategies. There are several commonly used approaches to versioning. Many in the hypermedia community feel that we should not version resources, although that pushes potential versioning into the representation. Since the OpenAPI specification describes both the URL and the payload, representation compatibility strategies should be addressed, as well.

I would like to propose that the current info.version be elaborated to a compatibilityStrategy object functionally similar to the Security Definitions and Scheme Objects. To maintain compatibility and for forward migration, the default strategy would map to the equivalent of the current version definition.

An example might be

{
    "openapi": "3.1.0",
    "info": {
        "title": "MyAPI",
        "compatibilityStrategy": "semver"
    },
    ...
}

The details of compatibility strategies and their corresponding objects needs to be elaborated.

Other strategies might include “simple”, “date”, or “migration”. The “simple” strategy might be a single-digit strategy based on a major version or a sequence number as is most commonly represented in URL-based API versions. The “date” strategy is fairly self-evident and might address use cases like Stripe. The “migration” strategy describes an approach I am developing that obviates the need for versioning based on a limited compatibility period.

I would also like to propose that compatibility strategies could apply at smaller granularities than the API as a whole, most notably at the level of the payload entity defined in the Schema Object. This proposal will also impact the evolution of the “deprecated” fields and should be coordinated or merged with issue #782.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
srvancecommented, Feb 8, 2017

@darrelmiller How would you feel about defining it as the version of the API description, not of the API itself?

The word version carries connotations that steer users and tools and block alternate approaches. I understand if you don’t want ideas you don’t feel are fully mature to be represented in the standard yet, but do you really want to prevent them?

Frankly, @fehguy, lots of people feel the pain of versions, but few understand that there are alternatives and what they are. The ones who do usually get drowned out by the ones who insist there aren’t practical alternatives or don’t want to be bothered. Millions of people thought the world was flat for hundreds of years, and look where we are now. Mass belief is not a strong argument of anything other than mass belief and an acknowledged current perceived reality.

Is there any way to put it to the thousands? Counting reactions, there are five in this thread in favor of the proposal and two against.

3reactions
handrewscommented, Feb 7, 2017

For better or worse, using a version identifier for an API is by far the most commonly expected declaration of compatibility.

That’s a reason to support it, not a reason to require it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Progressive Enhancement & Cross Browser Testing
Progressive Enhancement strategy steps in here for delivering cross-browser compatibility. It makes sure that the core elements of the ...
Read more >
What is Progressive Enhancement, and why it matters
Progressive enhancement is a strategy for web design that emphasizes core web page content first. This strategy then progressively adds more ...
Read more >
JDK 17 Release Notes, Important Changes, and Information
Introduction. These notes describe important changes, enhancements, removed APIs and features, deprecated APIs and features, and other information about JDK ...
Read more >
Progressive enhancement - Wikipedia
Progressive enhancement is a strategy in web design that puts emphasis on web content first, allowing everyone to access the basic content and...
Read more >
Progressive Enhancement vs Graceful Degradation
Get an in-depth yet simplified guide for the concepts of Progressive Enhancement and Graceful Degradation in cross-browser compatibility.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found