diff --git a/.dredd/hooks/capabilities.go b/.dredd/hooks/capabilities.go index b82d73b2a..f03b1e717 100644 --- a/.dredd/hooks/capabilities.go +++ b/.dredd/hooks/capabilities.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "fmt" "regexp" "strconv" "strings" @@ -150,6 +151,13 @@ func resolveCapability(caps []string, resolved []string, uid string) { case "integrationextractor": integrationextractor = addIntegrationExtractor() integrationExtractorID = integrationextractor.ID + + fmt.Println("******************************") + fmt.Println("******************************") + fmt.Println(integrationExtractorID) + fmt.Println("******************************") + fmt.Println("******************************") + case "integrationextractvalue": integrationextractvalue = addIntegrationExtractValue() integrationExtractValueID = integrationextractvalue.ID @@ -234,7 +242,6 @@ func alterRequestBody(t *trans.Transaction) { bodyFieldProcessor("integration_id", integration.ID, &request) } if integrationextractor != nil { - //bodyFieldProcessor("integration_id", integrationextractor.IntegrationID, &request) bodyFieldProcessor("extractor_id", integrationextractor.ID, &request) } if integrationextractvalue != nil { diff --git a/.dredd/hooks/helpers.go b/.dredd/hooks/helpers.go index 04353a04b..144033906 100644 --- a/.dredd/hooks/helpers.go +++ b/.dredd/hooks/helpers.go @@ -245,7 +245,7 @@ func addIntegration() *db.Integration { func addIntegrationExtractor() *db.IntegrationExtractor { integrationextractor, err := store.CreateIntegrationExtractor(db.IntegrationExtractor{ - IntegrationID: int(integrationID), + IntegrationID: integrationID, Name: "Integration Extractor", }) diff --git a/.dredd/hooks/main.go b/.dredd/hooks/main.go index 0b378ba36..9762b46b8 100644 --- a/.dredd/hooks/main.go +++ b/.dredd/hooks/main.go @@ -85,7 +85,7 @@ func main() { h.Before("project > /api/project/{project_id}/integrations/{integration_id} > Remove integration > 204 > application/json", capabilityWrapper("integration")) h.Before("integration > /api/project/{project_id}/integrations/{integration_id}/extractors > Get Integration Extractors > 200 > application/json", capabilityWrapper("integrationextractor")) - h.Before("integration > /api/project/{project_id}/integrations/{integration_id}/extractors > Add Integration Extractor > 204 > application/json", capabilityWrapper("integration")) + h.Before("integration > /api/project/{project_id}/integrations/{integration_id}/extractors > Add Integration Extractor > 201 > application/json", capabilityWrapper("integration")) h.Before("integration > /api/project/{project_id}/integrations/{integration_id}/extractors/{extractor_id} > Updates Integration extractor > 204 > application/json", capabilityWrapper("integrationextractor")) h.Before("integration > /api/project/{project_id}/integrations/{integration_id}/extractors/{extractor_id} > Removes integration extractor > 204 > application/json", capabilityWrapper("integrationextractor")) h.Before("integration > /api/project/{project_id}/integrations/{integration_id}/extractors/{extractor_id}/values > Get Integration Extracted Values linked to integration extractor > 200 > application/json", capabilityWrapper("integrationextractvalue")) diff --git a/api-docs.yml b/api-docs.yml index 5044c70d4..fc8a11bd8 100644 --- a/api-docs.yml +++ b/api-docs.yml @@ -1551,26 +1551,26 @@ paths: schema: $ref: "#/definitions/IntegrationExtractor" responses: - 204: + 201: description: Integration Extractor Created /project/{project_id}/integrations/{integration_id}/extractors/{extractor_id}: parameters: - $ref: "#/parameters/project_id" - $ref: "#/parameters/integration_id" - $ref: "#/parameters/extractor_id" - put: - tags: - - integration - summary: Updates Integration extractor - parameters: - - name: Integration Extractor - in: body - required: true - schema: - $ref: "#/definitions/IntegrationExtractorRequest" - responses: - 204: - description: Integration Extractor updated +# put: +# tags: +# - integration +# summary: Updates Integration extractor +# parameters: +# - name: Integration Extractor +# in: body +# required: true +# schema: +# $ref: "#/definitions/IntegrationExtractorRequest" +# responses: +# 204: +# description: Integration Extractor updated delete: tags: - integration @@ -1605,7 +1605,7 @@ paths: schema: $ref: "#/definitions/IntegrationExtractValue" responses: - 204: + 201: description: Integration Extract Value Created 400: description: Bad Integration Extract Value params @@ -1664,7 +1664,7 @@ paths: schema: $ref: "#/definitions/IntegrationMatcher" responses: - 204: + 200: description: Integration Matcher Created 400: description: Bad Integration Matcher params