Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 400 response to request deployment from catalog item api #22

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.