Skip to content

Commit

Permalink
add origin to ApiChange
Browse files Browse the repository at this point in the history
  • Loading branch information
reuvenharrison committed Sep 25, 2024
1 parent 7058596 commit e7f5761
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions checker/api_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type ApiChange struct {
OperationId string
Path string
Source *load.Source
Origin *openapi3.Origin

SourceFile string
SourceLine int
Expand Down Expand Up @@ -51,6 +52,11 @@ func NewApiChange(id string, config *Config, args []any, comment string, operati
}
}

func (c ApiChange) WithOrigin(origin *openapi3.Origin) ApiChange {
c.Origin = origin
return c

Check warning on line 57 in checker/api_change.go

View check run for this annotation

Codecov / codecov/patch

checker/api_change.go#L55-L57

Added lines #L55 - L57 were not covered by tests
}

func getOrigin(operation *openapi3.Operation) (int, int) {
if operation == nil || operation.Origin == nil {
return 0, 0
Expand Down

0 comments on commit e7f5761

Please sign in to comment.