-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependencies Upgrade 2024-08 #428
Changes from all commits
ff4f12f
b04caf1
2ee3bb7
4d15a67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ func ExternalImportsFromFormat(element interface{}) (result []string) { | |
|
||
func MatchesFormat(element interface{}, specificType string) bool { | ||
schema, err := ConvertToSchemaRef(element) | ||
if err != nil && schema.Value.Type != openapi3.TypeString { | ||
if err != nil || schema == nil || schema.Value.Type == nil || !schema.Value.Type.Is(openapi3.TypeString) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch |
||
return false | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
package lanai | ||
|
||
import ( | ||
"crypto/md5" | ||
"crypto/sha256" | ||
"errors" | ||
"fmt" | ||
"github.com/getkin/kin-openapi/openapi3" | ||
|
@@ -42,7 +42,7 @@ type Regex struct { | |
} | ||
|
||
func NewRegex(value openapi3.Schema) (*Regex, error) { | ||
if value.Type != "string" { | ||
if !value.Type.Is(openapi3.TypeString) { | ||
return nil, errors.New("schema is not a string type for regex") | ||
} | ||
|
||
|
@@ -73,7 +73,7 @@ func generateNameFromRegex(regex string) string { | |
} | ||
} | ||
|
||
hashedString := strings.ToUpper(fmt.Sprintf("%x", md5.Sum([]byte(regex))))[0:5] | ||
hashedString := strings.ToUpper(fmt.Sprintf("%x", sha256.Sum224([]byte(regex))))[0:5] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what prompted this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. linter, use of md5 result in lint issue |
||
return fmt.Sprintf("regex%v", hashedString) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the github action annotation is referring to the original code on line 154, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a bug fix that brought to my attention after I enabled linters on
/cmd
.If you are asking about the github-action output format for tests, it's in
.github/actions/verify/action.yml
, and it's already in main