Skip to content

Commit

Permalink
Add 400 response to requst deployment from catalog item api (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak Mettem <dmettem@vmware.com>
  • Loading branch information
dmettem authored Apr 23, 2020
1 parent a704ece commit dd869e8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hack/fix_vra_swagger
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@ def add_404_not_found(swagger):
}


def add_400_bad_request(swagger):
# List of paths and operations to add a 400 bad request
paths = [
('/catalog/api/items/{id}/request', 'post'),
]

# Update the needed paths
for (p, op) in paths:
responses = swagger['paths'][p][op]['responses']
if '400' not in responses:
responses['400'] = {
"description": "Bad Request",
}


def change_operationId_for_get_fabric_compute(swagger):
# Remove when VCOM-16823 is fixed.
path = '/iaas/api/fabric-computes/{id}'
Expand Down Expand Up @@ -265,6 +280,7 @@ if __name__ == "__main__":
add_blockdevice_delete_purge(swagger)
add_blockdevice_resize(swagger)
add_404_not_found(swagger)
add_400_bad_request(swagger)

add_error_definition(swagger)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd869e8

Please sign in to comment.