-
Notifications
You must be signed in to change notification settings - Fork 8
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
Embed json schema in the binary #34
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good to me. I've just put a couple of comments, but up to you to modify something or not :)
check.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return body, resp.Body.Close() |
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.
I am not sure about this, but either we add a resp.Body.Close()
before line 197, or we do not need to call resp.Body.Close()
in line 200, no ? Does jsonschema.UnmarshalJSON
call Close
itself?
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.
UnmarshalJSON
does not close the reader, but it's true that we should close it if there's an error
cmd.go
Outdated
Cmd *cobra.Command | ||
Flags []FlagBuilder | ||
once *sync.Once | ||
Constraints []ContraintBuilder |
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.
nittypicky: ContraintBuilder is missing an s -> ConstraintBuilder.
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.
Ups
Added new ways to lint the config file
Embed schema
Use
cmd.NewCheckCmd(schema)
when building the root command to embed a json schema in string format.Spawn the
krakend check
command with a-n|--lint-no-network
lint against itCustom schema
Spawn the
krakend check
command with a-s|--lint-schema [url|path]
to lint against a custom URL or local file--lint
,--lint-no-network
and--lint-schema
flags are mutually exclusiveℹ️ This PR bumps
jsonschema
dependency tov6
and cobra tov1.8.1