Git Product home page Git Product logo

Comments (1)

commonsensesoftware avatar commonsensesoftware commented on May 24, 2024

The libraries default to using a query string parameter because the resource URLs are more stable that way and it's easier to integrate API versioning into existing codebases. Consider that /api/v1/orders/1 and /api/v2/orders/1 both refer to the same resource (e.g. order 1), but with different URLs. The uniform interface constraint states that a resource should be unique identifiable by it's URL path. The query string is not considered part of the path. When using a query string parameter, the identifier is always api/orders/1, regardless of which version of the order you ask for because the resource is logically the same, even though its representation or behavior is different.

Nevertheless, you are correct that having part of the URL path represent an API version is quite common. Heated arguments have been made as to which approach is better. While the libraries do have a default configuration, the approach you choose to use to version your APIs is up to you.

API versioning using a URL path segment is supported and documented. Please review the wiki topic on Versioning via the URL Path.

from aspnet-api-versioning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.