Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This cannot be answered in a general manner, but I believe the answer for your case can be well determined by the intended client applications, since you are in the constrained environment and you know the business case for the API.</p> <p>If your client applications need to work across "Provider" and "Consumer" sub-domains, for example, I would suggest placing the version in the API root ($SERVER/$VERSION/$SUBDOMAIN), since versioning each subdomains separately does not make much of a sense. From the client side perspective, the API acts as a single solid piece. (in the source, you have one constant "apiVersion").</p> <p>If each endpoint will be used by a different client applications (for example mobile app for "Consumer" and desktop client system for the "Provider"), I suggest versioning subdomains ($SERVER/$SUBDOMAIN/$VERSION), since different development speed can be applied for various systems and the systems are more or less independent.</p> <p>It is worth noting that the 2nd approach is more flexible and can be mapped to the 1st one:</p> <pre><code>$SERVER/1.0/$SUBDOMAIN_A/ $SERVER/1.0/$SUBDOMAIN_B/ </code></pre> <p>can be easily rewritten as ==></p> <pre><code>$SERVER/$SUBDOMAIN_A/1.0 $SERVER/$SUBDOMAIN_B/1.0 </code></pre> <p>I would go with the second approach then, just to be a bit safer - even if you upgrade all the APIs at the same time, this will work.</p> <p>A general rule to follow is to perform a good API design and do the most to avoid incompatible changes that force you to upgrade the API version.</p> <p>Update: There is one more thing - the notion of API dependency. For example, if you upgrade API for authentication so that a new API version is needed, all the clients need to be upgraded too and you might need to version this API separately. This is one more point for the 2nd approach...</p> <p>Hope that helps...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload