Skip to content

Commit

Permalink
chore: cleanup unused fields/comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Aug 15, 2020
1 parent 677e707 commit b61ffa7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 56 deletions.
26 changes: 0 additions & 26 deletions v3/pact_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,6 @@ import (
version "github.com/pact-foundation/pact-go/command"
)

// Example matching rule / generated doc
// {
// "method": "POST",
// "path": "/",
// "query": "",
// "headers": {"Content-Type": "application/json"},
// "matchingRules": {
// "$.body.animals": {"min": 1, "match": "type"},
// "$.body.animals[*].*": {"match": "type"},
// "$.body.animals[*].children": {"min": 1, "match": "type"},
// "$.body.animals[*].children[*].*": {"match": "type"}
// },
// "body": {
// "animals": [
// {
// "name" : "Fred",
// "children": [
// {
// "age": 9
// }
// ]
// }
// ]
// }
// }

// SpecificationVersion is used to determine the current specification version
type SpecificationVersion string

Expand Down
38 changes: 8 additions & 30 deletions v3/pact_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,18 @@ func pactInteractionFromV2Interaction(interaction InteractionV2) pactInteraction
Description: interaction.Description,
State: interaction.State,
Request: pactRequestV2{
Method: interaction.Request.Method,
Body: interaction.Request.Body,
Headers: interaction.Request.Headers,
Query: interaction.Request.Query,
Path: interaction.Request.Path,
// Generators: make(generatorType),
Method: interaction.Request.Method,
Body: interaction.Request.Body,
Headers: interaction.Request.Headers,
Query: interaction.Request.Query,
Path: interaction.Request.Path,
MatchingRules: make(ruleValue),
MatchingRules2: generator{
Body: make(ruleValue),
Headers: make(ruleValue),
Path: make(ruleValue),
Query: make(ruleValue),
},
},
Response: pactResponseV2{
Status: interaction.Response.Status,
Body: interaction.Response.Body,
Headers: interaction.Response.Headers,
// Generators: make(generatorType),
Status: interaction.Response.Status,
Body: interaction.Response.Body,
Headers: interaction.Response.Headers,
MatchingRules: make(ruleValue),
MatchingRules2: matchingRule{
Body: make(ruleValue),
Headers: make(ruleValue),
Path: make(ruleValue),
Query: make(ruleValue),
},
},
}
}
Expand All @@ -100,14 +86,6 @@ func (p *pactFileV2) generateV2PactFile() *pactFileV2 {
_, serialisedInteraction.Request.Body, serialisedInteraction.Request.MatchingRules, _ = buildPactBody("", interaction.Request.Body, make(map[string]interface{}), "$.body", make(ruleValue), make(ruleValue))
_, serialisedInteraction.Response.Body, serialisedInteraction.Response.MatchingRules, _ = buildPactBody("", interaction.Response.Body, make(map[string]interface{}), "$.body", make(ruleValue), make(ruleValue))

// v2
// serialisedInteraction.Request.MatchingRules = requestBodyMatchingRules
// serialisedInteraction.Response.MatchingRules = responseBodyMatchingRules

// v3 only
// serialisedInteraction.Request.MatchingRules.Body = requestBodyMatchingRules
// serialisedInteraction.Response.MatchingRules.Body = responseBodyMatchingRules

// TODO
buildPactHeaders()
buildPactQuery()
Expand Down

0 comments on commit b61ffa7

Please sign in to comment.