Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
support disabling format validation
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Dec 1, 2021
1 parent 17712da commit b829663
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/apis/crtapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ var CreateCmd = &cobra.Command{
var content []byte
var oasDocName string
if oasFile != "" {
oasDocName, content, err = bundle.LoadDocumentFromFile(oasFile, validateSpec)
oasDocName, content, err = bundle.LoadDocumentFromFile(oasFile, validateSpec, formatValidation)
} else {
oasDocName, content, err = bundle.LoadDocumentFromURI(oasURI, validateSpec)
oasDocName, content, err = bundle.LoadDocumentFromURI(oasURI, validateSpec, formatValidation)
}
if err != nil {
return err
Expand Down Expand Up @@ -86,7 +86,7 @@ var CreateCmd = &cobra.Command{
}

var proxy, oasFile, oasURI, gqlFile, gqlURI string
var importProxy, validateSpec, skipPolicy, addCORS bool
var importProxy, validateSpec, skipPolicy, addCORS, formatValidation bool

func init() {

Expand All @@ -106,6 +106,8 @@ func init() {
false, "Skip adding the OAS Validate policy")
CreateCmd.Flags().BoolVarP(&addCORS, "add-cors", "",
false, "Add a CORS policy")
CreateCmd.Flags().BoolVarP(&formatValidation, "formatValidation", "",
true, "disables validation of schema type formats")

_ = CreateCmd.MarkFlagRequired("name")
}

0 comments on commit b829663

Please sign in to comment.