INNER CODE UNIT · Go

integrationResponses

mweagle/Sparta · apigateway.go:116

func integrationResponses(api *API, userResponses map[int]*IntegrationResponse, corsEnabled bool) []gofapig.Method_IntegrationResponse {

	var integrationResponses []gofapig.Method_IntegrationResponse

	// We've already populated this entire map in the NewMethod call
	for eachHTTPStatusCode, eachMethodIntegrationResponse := range userResponses {
		responseParameters := eachMethodIntegrationResponse.Parameters
		if corsEnabled {
			for eachKey, eachValue := range corsIntegrationResponseParams(api) {
				responseParameters[eachKey] = eachValue
			}
		}

		integrationResponse := gofapig.Method_IntegrationResponse{
			ResponseTemplates: eachMethodIntegrationResponse.Templates,
			SelectionPattern:  eachMethodIntegrationResponse.SelectionPattern,
			StatusCode:        strconv.Itoa(eachHTTPStatusCode),
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…