Expand schema for error.codes to reflect reality

Add '_' as a valid character in error.codes, because that's what's
present in the wild.

The schema is updated to include a pattern check, and one of the
examples is changed to demonstrate the use of the new char.

Change-Id: I6bcfd5d411b2b9c540546f92859647333114a8f8
This commit is contained in:
Chris Dent 2018-07-06 16:44:41 +01:00
parent 777732d9c4
commit 348f499ff5
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"errors": [
{
"request_id": "1dc92f06-8ede-4fb4-8921-b507601fb59d",
"code": "orchestration.create-failed",
"code": "orchestration.create_failed",
"status": 418,
"title": "The Stack could not be created",
"detail": "The Stack could not be created because of error(s) in other parts of the system.",

View File

@ -17,7 +17,8 @@
},
"code": {
"type": "string",
"description": "A service-specific error code. The general form of the code is service-type.error-code. service-type MUST be the service type as defined by the service types authority at http://specs.openstack.org/openstack/service-types-authority. error-code is defined by service project team and MUST only consist of lowercase alpha, numeric, '.', and '-' characters."
"pattern": "^[a-z0-9._-]+$",
"description": "A service-specific error code. The general form of the code is service-type.error-code. service-type MUST be the service type as defined by the service types authority at http://specs.openstack.org/openstack/service-types-authority. error-code is defined by service project team and MUST only consist of lowercase alpha, numeric, '.', '_', and '-' characters."
},
"status": {
"type": "integer",