Skip to content

Commit

Permalink
feat: update yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzawaleed01 committed Dec 13, 2023
1 parent 820c740 commit d258818
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 58 deletions.
16 changes: 6 additions & 10 deletions api-compact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ auth_header: &auth_header
required: true
type: "string"

x-amazon-apigateway-integration-assign-licenses: &apigateway_integration_assign_licenses
responses: *apigateway_responses_with_mapping_template_for_uuid
httpMethod: "POST"
type: "http"
requestParameters:
integration.request.header.Authorization: "method.request.header.Authorization"
integration.request.path.subscription_plan_uuid: "method.request.path.subscription_plan_uuid"


endpoints:
v1:

Expand Down Expand Up @@ -146,5 +137,10 @@ endpoints:
required: true
responses: *responses
x-amazon-apigateway-integration:
<<: *apigateway_integration_assign_licenses
responses: *apigateway_responses
httpMethod: "POST"
type: "http"
requestParameters:
integration.request.header.Authorization: "method.request.header.Authorization"
integration.request.path.subscription_plan_uuid: "method.request.path.subscription_plan_uuid"
uri: "https://${stageVariables.license_manager_host}/v1/subscriptions/{subscription_plan_uuid}/licenses/assign/"
48 changes: 0 additions & 48 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,40 +70,6 @@ auth_header:
in: header
required: true
type: string
x-amazon-apigateway-integration-assign-licenses:
responses:
"200":
statusCode: "200"
responseTemplates:
application/json: >
#set($inputRoot = $input.path('$')) #set($host =
$stageVariables.gateway_host) #set($uuid = $input.params('uuid'))
#set($URLMatchRegex = "(^https?://)[^/]*[^?]*(.*$)") #set($updatedURL = "$1$host$context.resourcePath$2") #set($resourceUuidMatch = "{uuid}")
{
"count": $inputRoot.count,
"next": "$inputRoot.next.replaceAll($URLMatchRegex, $updatedURL).replace($resourceUuidMatch, $uuid)",
"previous": "$inputRoot.previous.replaceAll($URLMatchRegex, $updatedURL).replace($resourceUuidMatch, $uuid)",
"results": $inputRoot.results
}
"401":
statusCode: "401"
"403":
statusCode: "403"
"404":
statusCode: "404"
"429":
statusCode: "429"
"500":
statusCode: "500"
default:
statusCode: "400"
httpMethod: POST
type: http
requestParameters:
integration.request.header.Authorization: method.request.header.Authorization
integration.request.path.subscription_plan_uuid: method.request.path.subscription_plan_uuid
endpoints:
v1:
assignLicenses:
Expand Down Expand Up @@ -172,20 +138,6 @@ endpoints:
responses:
"200":
statusCode: "200"
responseTemplates:
application/json: >
#set($inputRoot = $input.path('$')) #set($host =
$stageVariables.gateway_host) #set($uuid =
$input.params('uuid'))
#set($URLMatchRegex = "(^https?://)[^/]*[^?]*(.*$)") #set($updatedURL = "$1$host$context.resourcePath$2") #set($resourceUuidMatch = "{uuid}")
{
"count": $inputRoot.count,
"next": "$inputRoot.next.replaceAll($URLMatchRegex, $updatedURL).replace($resourceUuidMatch, $uuid)",
"previous": "$inputRoot.previous.replaceAll($URLMatchRegex, $updatedURL).replace($resourceUuidMatch, $uuid)",
"results": $inputRoot.results
}
"401":
statusCode: "401"
"403":
Expand Down

0 comments on commit d258818

Please sign in to comment.