-
Notifications
You must be signed in to change notification settings - Fork 6
feat(oaslint): add oaslint #371
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
base: main
Are you sure you want to change the base?
Changes from all commits
a143620
2cdaa1e
53d8c7a
0422636
24648b8
9a1bb96
843e7da
0fe4516
799f51e
0d63d9b
8e4df39
ed60c71
e1b5bde
3104ad0
f8e9e06
db2f31e
4db1eb6
427a979
ae6b0b1
6082d9a
82df404
20fad69
4edc142
9f6f6c2
941910d
e51d49d
d573338
72197cb
05c4c4e
cee8de3
32deef7
55f5f80
f967e1d
a94205f
a8119a6
557cec7
3ca4e9d
06e6d5c
71a10f5
abdcefb
7a51dfb
32b811e
091da41
0ad7014
02e32c2
f0e8817
732c272
5c6ecea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ package config | |
|
|
||
| import ( | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/pkg/errors" | ||
| "github.com/spf13/viper" | ||
|
|
@@ -16,6 +17,15 @@ type ServerConfig struct { | |
| Security SecurityConfig `json:"security"` | ||
| Log LogConfig `json:"log"` | ||
| FileManager FileManagerConfig `json:"fileManager"` | ||
| OasLinting OasLintingConfig `json:"oasLinting"` | ||
| } | ||
|
|
||
| type OasLintingConfig struct { | ||
|
Member
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. Could use some comment, e.g. what is the meaning of ErrorMessage and DashboardURL? |
||
| ErrorMessage string `json:"errorMessage"` | ||
| Timeout time.Duration `json:"timeout"` | ||
| URL string `json:"url"` | ||
| DashboardURL string `json:"dashboardURL"` | ||
| SkipTLS bool `json:"skipTLS"` | ||
| } | ||
|
|
||
| type SecurityConfig struct { | ||
|
|
@@ -72,6 +82,13 @@ func setDefaults() { | |
| // FileManager | ||
| viper.SetDefault("fileManager.skipTLS", true) | ||
|
|
||
| // OAS Linting | ||
| viper.SetDefault("oasLinting.errorMessage", "Linter scan result contains errors for RULESET_NAME_PLACEHOLDER ruleset.") | ||
|
Member
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. [nitpick]: Could have used an actual template-string here |
||
| viper.SetDefault("oasLinting.timeout", 55) // seconds; 0 means block indefinitely until linter responds | ||
|
Member
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. why 55? I know it but maybe someone else does not ;)
Member
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. And is the type time.Duration not supported? |
||
| viper.SetDefault("oasLinting.url", "") | ||
| viper.SetDefault("oasLinting.dashboardURL", "") | ||
| viper.SetDefault("oasLinting.skipTLS", false) | ||
|
|
||
| // Database | ||
| viper.SetDefault("database.filepath", "") // empty string means in-memory only | ||
| viper.SetDefault("database.reduceMemory", false) // see common-server docs | ||
|
|
||
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.
[nitpick] These should be above the enum type