Add 415 to list of exceptions for microversions devref

There was some confusion/debate in reviewing
I5fa1fdba56803b2ef63b1efaaeeced6ceb7779d9 and whether or
not it required a microversion to change the response code.

This was a pretty common sense scenario where 415 was a
more appropriate error code for 400 and is a better client
experience when hitting that error.

This change updates the potentially confusing part of the
devref about this and adds a note to ask the Nova API
subteam when in doubt about whether or not a microversion
is needed for changing error codes.

Change-Id: I8a2836076b7fadc697bdc013578c3d777d02a833
Related-Bug: #1567977
This commit is contained in:
Matt Riedemann
2016-04-20 14:15:49 -04:00
parent 893d3d68e8
commit e781103841

View File

@@ -82,7 +82,7 @@ changed. The user contract covers many kinds of information such as:
Example: an API previously could return 200, 400, 403, 404 and the Example: an API previously could return 200, 400, 403, 404 and the
change would make the API now also be allowed to return 409. change would make the API now also be allowed to return 409.
See [#f2]_ for the 400, 403 and 404 cases. See [#f2]_ for the 400, 403, 404 and 415 cases.
- changing a status code on a particular response - changing a status code on a particular response
@@ -172,11 +172,18 @@ we need a microversion".
microversion is probably needed. microversion is probably needed.
.. [#f2] The exception to not needing a microversion when returning a .. [#f2] The exception to not needing a microversion when returning a
previously unspecified error code is the 400, 403 and 404 cases. This is previously unspecified error code is the 400, 403, 404 and 415 cases. This is
considered OK to return even if previously unspecified in the code since considered OK to return even if previously unspecified in the code since
it's implied given keystone authentication can fail with a 403 and API it's implied given keystone authentication can fail with a 403 and API
validation can fail with a 400 for invalid json request body. Request to validation can fail with a 400 for invalid json request body. Request to
url/resource that does not exist always fails with 404. url/resource that does not exist always fails with 404. Invalid content types
are handled before API methods are called which results in a 415.
.. note:: When in doubt about whether or not a microversion is required
for changing an error response code, consult the `Nova API subteam`_.
.. _Nova API subteam: https://wiki.openstack.org/wiki/Meetings/NovaAPI
When a microversion is not needed When a microversion is not needed
--------------------------------- ---------------------------------