diff --git a/apps/disco/main.go b/apps/disco/main.go index 59bc19bc..ec5a067e 100644 --- a/apps/disco/main.go +++ b/apps/disco/main.go @@ -23,8 +23,9 @@ import ( "github.com/docopt/docopt-go" "github.com/golang/protobuf/proto" - "github.com/googleapis/gnostic/conversions" - discovery "github.com/googleapis/gnostic/discovery" + + "github.com/google/gnostic/conversions" + discovery "github.com/google/gnostic/discovery" ) func main() { diff --git a/apps/parse-linter-output/main.go b/apps/parse-linter-output/main.go index a1c47938..c310f296 100644 --- a/apps/parse-linter-output/main.go +++ b/apps/parse-linter-output/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - lint "github.com/googleapis/gnostic/metrics/lint" + lint "github.com/google/gnostic/metrics/lint" ) func main() { diff --git a/apps/petstore-builder/petstore-v2.go b/apps/petstore-builder/petstore-v2.go index 83457fa3..ec2cd6e2 100644 --- a/apps/petstore-builder/petstore-v2.go +++ b/apps/petstore-builder/petstore-v2.go @@ -15,7 +15,7 @@ package main import ( - v2 "github.com/googleapis/gnostic/openapiv2" + v2 "github.com/google/gnostic/openapiv2" ) func buildDocumentV2() *v2.Document { @@ -252,7 +252,7 @@ func buildDocumentV2() *v2.Document { &v2.NamedSchema{Name: "code", Value: &v2.Schema{ Type: &v2.TypeItem{Value: []string{"integer"}}, Format: "int32"}}, - &v2.NamedSchema{Name: "message", Value: &v2.Schema{Type: &v2.TypeItem{Value:[]string{"string"}}}}, + &v2.NamedSchema{Name: "message", Value: &v2.Schema{Type: &v2.TypeItem{Value: []string{"string"}}}}, }, }, }}) diff --git a/apps/petstore-builder/petstore-v3.go b/apps/petstore-builder/petstore-v3.go index 240a3435..9042ff95 100644 --- a/apps/petstore-builder/petstore-v3.go +++ b/apps/petstore-builder/petstore-v3.go @@ -15,7 +15,7 @@ package main import ( - v3 "github.com/googleapis/gnostic/openapiv3" + v3 "github.com/google/gnostic/openapiv3" ) func buildDocumentV3() *v3.Document { diff --git a/apps/protoc-gen-openapi/generator/openapi-v3.go b/apps/protoc-gen-openapi/generator/openapi-v3.go index 4211c978..c486f1b3 100644 --- a/apps/protoc-gen-openapi/generator/openapi-v3.go +++ b/apps/protoc-gen-openapi/generator/openapi-v3.go @@ -22,11 +22,12 @@ import ( "sort" "strings" - v3 "github.com/googleapis/gnostic/openapiv3" "google.golang.org/genproto/googleapis/api/annotations" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" + + v3 "github.com/google/gnostic/openapiv3" ) const infoURL = "https://github.com/googleapis/gnostic/tree/master/apps/protoc-gen-openapi" diff --git a/apps/protoc-gen-openapi/main.go b/apps/protoc-gen-openapi/main.go index 081a373a..af621d65 100644 --- a/apps/protoc-gen-openapi/main.go +++ b/apps/protoc-gen-openapi/main.go @@ -16,8 +16,9 @@ package main import ( - "github.com/googleapis/gnostic/apps/protoc-gen-openapi/generator" "google.golang.org/protobuf/compiler/protogen" + + "github.com/google/gnostic/apps/protoc-gen-openapi/generator" ) func main() { diff --git a/apps/report-messages/main.go b/apps/report-messages/main.go index 74c43f06..a308a80f 100644 --- a/apps/report-messages/main.go +++ b/apps/report-messages/main.go @@ -22,9 +22,10 @@ import ( "os" "github.com/golang/protobuf/proto" - "github.com/googleapis/gnostic/printer" - plugins "github.com/googleapis/gnostic/plugins" + "github.com/google/gnostic/printer" + + plugins "github.com/google/gnostic/plugins" ) func readMessagesFromFileWithName(filename string) *plugins.Messages { @@ -43,13 +44,13 @@ func readMessagesFromFileWithName(filename string) *plugins.Messages { func printMessages(code *printer.Code, messages *plugins.Messages) { for _, message := range messages.Messages { - line := fmt.Sprintf("%-7s %-14s %s %+v", - message.Level, - message.Code, - message.Text, - message.Keys) + line := fmt.Sprintf("%-7s %-14s %s %+v", + message.Level, + message.Code, + message.Text, + message.Keys) code.Print(line) - } + } } func main() { diff --git a/apps/report/main.go b/apps/report/main.go index c259d843..f0b166b3 100644 --- a/apps/report/main.go +++ b/apps/report/main.go @@ -24,9 +24,10 @@ import ( "os" "github.com/golang/protobuf/proto" - "github.com/googleapis/gnostic/printer" - pb "github.com/googleapis/gnostic/openapiv2" + "github.com/google/gnostic/printer" + + pb "github.com/google/gnostic/openapiv2" ) func readDocumentFromFileWithName(filename string) (*pb.Document, error) { diff --git a/apps/vocabulary-operations/main.go b/apps/vocabulary-operations/main.go index d050fbb2..8bc22ef2 100644 --- a/apps/vocabulary-operations/main.go +++ b/apps/vocabulary-operations/main.go @@ -23,8 +23,9 @@ import ( "strings" "github.com/golang/protobuf/proto" - metrics "github.com/googleapis/gnostic/metrics" - vocabulary "github.com/googleapis/gnostic/metrics/vocabulary" + + metrics "github.com/google/gnostic/metrics" + vocabulary "github.com/google/gnostic/metrics/vocabulary" ) // openVocabularyFiles uses standard input to create a slice of diff --git a/compiler/extensions.go b/compiler/extensions.go index 20848a0a..5b5a916d 100644 --- a/compiler/extensions.go +++ b/compiler/extensions.go @@ -22,8 +22,9 @@ import ( "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/any" - extensions "github.com/googleapis/gnostic/extensions" yaml "gopkg.in/yaml.v3" + + extensions "github.com/google/gnostic/extensions" ) // ExtensionHandler describes a binary that is called by the compiler to handle specification extensions. diff --git a/compiler/helpers.go b/compiler/helpers.go index 48f02f39..97ffaa51 100644 --- a/compiler/helpers.go +++ b/compiler/helpers.go @@ -20,8 +20,9 @@ import ( "sort" "strconv" - "github.com/googleapis/gnostic/jsonschema" "gopkg.in/yaml.v3" + + "github.com/google/gnostic/jsonschema" ) // compiler helper functions, usually called from generated code diff --git a/conversions/openapiv2.go b/conversions/openapiv2.go index 70365536..fb738865 100644 --- a/conversions/openapiv2.go +++ b/conversions/openapiv2.go @@ -18,8 +18,8 @@ import ( "log" "net/url" - openapi2 "github.com/googleapis/gnostic/openapiv2" - discovery "github.com/googleapis/gnostic/discovery" + discovery "github.com/google/gnostic/discovery" + openapi2 "github.com/google/gnostic/openapiv2" ) func addOpenAPI2SchemaForSchema(d *openapi2.Document, name string, schema *discovery.Schema) { diff --git a/conversions/openapiv3.go b/conversions/openapiv3.go index ab0a7eaf..576c2ec2 100644 --- a/conversions/openapiv3.go +++ b/conversions/openapiv3.go @@ -19,8 +19,8 @@ import ( "net/url" "strings" - openapi3 "github.com/googleapis/gnostic/openapiv3" - discovery "github.com/googleapis/gnostic/discovery" + discovery "github.com/google/gnostic/discovery" + openapi3 "github.com/google/gnostic/openapiv3" ) func pathForMethod(path string) string { diff --git a/discovery/discovery.go b/discovery/discovery.go index ad62277c..c13c2320 100644 --- a/discovery/discovery.go +++ b/discovery/discovery.go @@ -18,10 +18,12 @@ package discovery_v1 import ( "fmt" - "github.com/googleapis/gnostic/compiler" - "gopkg.in/yaml.v3" "regexp" "strings" + + "gopkg.in/yaml.v3" + + "github.com/google/gnostic/compiler" ) // Version returns the package name (and OpenAPI version). diff --git a/discovery/document.go b/discovery/document.go index ab6a5c86..13316d1b 100644 --- a/discovery/document.go +++ b/discovery/document.go @@ -15,7 +15,7 @@ package discovery_v1 import ( - "github.com/googleapis/gnostic/compiler" + "github.com/google/gnostic/compiler" ) // FetchDocumentBytes downloads the bytes of a discovery document from a URL. diff --git a/discovery/list.go b/discovery/list.go index ebe01991..257b67da 100644 --- a/discovery/list.go +++ b/discovery/list.go @@ -19,7 +19,7 @@ import ( "errors" "strings" - "github.com/googleapis/gnostic/compiler" + "github.com/google/gnostic/compiler" ) // APIsListServiceURL is the URL for the Google APIs Discovery Service diff --git a/generate-gnostic/domain.go b/generate-gnostic/domain.go index 1487dec9..cb67b677 100644 --- a/generate-gnostic/domain.go +++ b/generate-gnostic/domain.go @@ -21,7 +21,7 @@ import ( "sort" "strings" - "github.com/googleapis/gnostic/jsonschema" + "github.com/google/gnostic/jsonschema" ) // Domain models a collection of types that is defined by a schema. diff --git a/generate-gnostic/generate-compiler.go b/generate-gnostic/generate-compiler.go index 41723237..997db1a5 100644 --- a/generate-gnostic/generate-compiler.go +++ b/generate-gnostic/generate-compiler.go @@ -20,7 +20,7 @@ import ( "sort" "strings" - "github.com/googleapis/gnostic/printer" + "github.com/google/gnostic/printer" ) // patternNames hands out unique names for a given string. diff --git a/generate-gnostic/generate-extension.go b/generate-gnostic/generate-extension.go index e3b990bb..cb90760e 100644 --- a/generate-gnostic/generate-extension.go +++ b/generate-gnostic/generate-extension.go @@ -26,9 +26,9 @@ import ( "sort" "strings" - "github.com/googleapis/gnostic/compiler" - "github.com/googleapis/gnostic/jsonschema" - "github.com/googleapis/gnostic/printer" + "github.com/google/gnostic/compiler" + "github.com/google/gnostic/jsonschema" + "github.com/google/gnostic/printer" ) var protoOptionsForExtensions = []ProtoOption{ @@ -272,7 +272,7 @@ func generateExtension(schemaFile string, outDir string) error { "fmt", "regexp", "strings", - "github.com/googleapis/gnostic/compiler", + "github.com/google/gnostic/compiler", "gopkg.in/yaml.v3", }) goFilename := path.Join(protoOutDirectory, outFileBaseName+".go") @@ -287,7 +287,7 @@ func generateExtension(schemaFile string, outDir string) error { // TODO: This path is currently fixed to the location of the samples. // Can we make it relative, perhaps with an option or by generating // a go.mod file for the generated extension handler? - outDirRelativeToPackageRoot := "github.com/googleapis/gnostic/extensions/sample/" + outDir + outDirRelativeToPackageRoot := "github.com/google/gnostic/extensions/sample/" + outDir var extensionNameKeys []string for k := range extensionNameToMessageName { @@ -315,8 +315,8 @@ func generateExtension(schemaFile string, outDir string) error { extMainCode := fmt.Sprintf(additionalCompilerCodeWithMain, cases) imports := []string{ "github.com/golang/protobuf/proto", - "github.com/googleapis/gnostic/extensions", - "github.com/googleapis/gnostic/compiler", + "github.com/google/gnostic/extensions", + "github.com/google/gnostic/compiler", "gopkg.in/yaml.v3", outDirRelativeToPackageRoot + "/" + "proto", } diff --git a/generate-gnostic/generate-proto.go b/generate-gnostic/generate-proto.go index 6b56d271..1fe0eb99 100644 --- a/generate-gnostic/generate-proto.go +++ b/generate-gnostic/generate-proto.go @@ -18,7 +18,7 @@ import ( "fmt" "strings" - "github.com/googleapis/gnostic/printer" + "github.com/google/gnostic/printer" ) // ProtoOption represents an option to be added to generated .proto files. diff --git a/generate-gnostic/main.go b/generate-gnostic/main.go index 34062f2e..59397181 100644 --- a/generate-gnostic/main.go +++ b/generate-gnostic/main.go @@ -23,12 +23,12 @@ import ( "io/ioutil" "log" "os" - "os/exec" "path" - "runtime" "strings" - "github.com/googleapis/gnostic/jsonschema" + "golang.org/x/tools/imports" + + "github.com/google/gnostic/jsonschema" ) // License is the software license applied to generated code. @@ -193,19 +193,27 @@ func generateOpenAPIModel(version string) error { "gopkg.in/yaml.v3", "strings", "regexp", - "github.com/googleapis/gnostic/compiler", + "github.com/google/gnostic/compiler", } // generate the compiler log.Printf("Generating compiler support code") compiler := cc.GenerateCompiler(goPackageName, License, packageImports) goFileName := projectRoot + directoryName + "/" + filename + ".go" - err = ioutil.WriteFile(goFileName, []byte(compiler), 0644) + + // format the compiler + log.Printf("Formatting compiler support code") + imports.LocalPrefix = "github.com/google/gnostic" + data, err := imports.Process(goFileName, []byte(compiler), &imports.Options{ + TabWidth: 8, + TabIndent: true, + Comments: true, + Fragment: true, + }) if err != nil { return err } - // format the compiler - log.Printf("Formatting compiler support code") - return exec.Command(runtime.GOROOT()+"/bin/gofmt", "-w", goFileName).Run() + + return ioutil.WriteFile(goFileName, []byte(data), 0644) } func usage() string { diff --git a/generate-gnostic/types.go b/generate-gnostic/types.go index 917296cc..df148d70 100644 --- a/generate-gnostic/types.go +++ b/generate-gnostic/types.go @@ -18,7 +18,7 @@ import ( "fmt" "strings" - "github.com/googleapis/gnostic/jsonschema" + "github.com/google/gnostic/jsonschema" ) /// Type Modeling diff --git a/gnostic.go b/gnostic.go index 24a2760c..2de60601 100644 --- a/gnostic.go +++ b/gnostic.go @@ -35,7 +35,7 @@ import ( "fmt" "os" - "github.com/googleapis/gnostic/lib" + "github.com/google/gnostic/lib" ) func main() { diff --git a/gnostic_test.go b/gnostic_test.go index 2dfe628e..4cb1609a 100644 --- a/gnostic_test.go +++ b/gnostic_test.go @@ -22,7 +22,7 @@ import ( "strings" "testing" - "github.com/googleapis/gnostic/lib" + "github.com/google/gnostic/lib" ) func isURL(path string) bool { diff --git a/go.mod b/go.mod index c4b8f1fe..077a2270 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,15 @@ -module github.com/googleapis/gnostic +module github.com/google/gnostic go 1.12 require ( - github.com/davecgh/go-spew v1.1.1 + github.com/davecgh/go-spew v1.1.1 // indirect github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 github.com/golang/protobuf v1.5.2 github.com/kr/pretty v0.2.0 // indirect github.com/stoewer/go-strcase v1.2.0 + golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 google.golang.org/protobuf v1.26.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 diff --git a/go.sum b/go.sum index 8761c49f..b71b39f0 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -62,9 +60,11 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/jsonwriter/writer_test.go b/jsonwriter/writer_test.go index a4e2477a..b714e609 100644 --- a/jsonwriter/writer_test.go +++ b/jsonwriter/writer_test.go @@ -17,8 +17,8 @@ package jsonwriter_test import ( "testing" - "github.com/googleapis/gnostic/compiler" - "github.com/googleapis/gnostic/jsonwriter" + "github.com/google/gnostic/compiler" + "github.com/google/gnostic/jsonwriter" "gopkg.in/yaml.v3" ) diff --git a/lib/gnostic.go b/lib/gnostic.go index 7b642cf9..dc7cd843 100644 --- a/lib/gnostic.go +++ b/lib/gnostic.go @@ -29,14 +29,15 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/googleapis/gnostic/compiler" - discovery_v1 "github.com/googleapis/gnostic/discovery" - "github.com/googleapis/gnostic/jsonwriter" - openapi_v2 "github.com/googleapis/gnostic/openapiv2" - openapi_v3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" - surface "github.com/googleapis/gnostic/surface" "gopkg.in/yaml.v3" + + "github.com/google/gnostic/compiler" + discovery_v1 "github.com/google/gnostic/discovery" + "github.com/google/gnostic/jsonwriter" + openapi_v2 "github.com/google/gnostic/openapiv2" + openapi_v3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" + surface "github.com/google/gnostic/surface" ) // UsageError is a response to invalid command-line inputs diff --git a/linters/go/gnostic-lint-descriptions/linter_v2.go b/linters/go/gnostic-lint-descriptions/linter_v2.go index fd7d5da5..3e44f300 100644 --- a/linters/go/gnostic-lint-descriptions/linter_v2.go +++ b/linters/go/gnostic-lint-descriptions/linter_v2.go @@ -14,8 +14,8 @@ package main import ( - openapi "github.com/googleapis/gnostic/openapiv2" - plugins "github.com/googleapis/gnostic/plugins" + openapi "github.com/google/gnostic/openapiv2" + plugins "github.com/google/gnostic/plugins" ) // DocumentLinter contains information collected about an API description. diff --git a/linters/go/gnostic-lint-descriptions/linter_v3.go b/linters/go/gnostic-lint-descriptions/linter_v3.go index 7b9894d1..b30ba8c0 100644 --- a/linters/go/gnostic-lint-descriptions/linter_v3.go +++ b/linters/go/gnostic-lint-descriptions/linter_v3.go @@ -15,8 +15,8 @@ package main import ( - openapi "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + openapi "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) // DocumentLinter contains information collected about an API description. diff --git a/linters/go/gnostic-lint-descriptions/main.go b/linters/go/gnostic-lint-descriptions/main.go index a3416721..ea33ce62 100644 --- a/linters/go/gnostic-lint-descriptions/main.go +++ b/linters/go/gnostic-lint-descriptions/main.go @@ -22,9 +22,10 @@ package main import ( "github.com/golang/protobuf/proto" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) type DocumentLinter interface { diff --git a/linters/go/gnostic-lint-paths/main.go b/linters/go/gnostic-lint-paths/main.go index 81934453..56dab5bd 100644 --- a/linters/go/gnostic-lint-paths/main.go +++ b/linters/go/gnostic-lint-paths/main.go @@ -19,9 +19,10 @@ package main import ( "github.com/golang/protobuf/proto" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) func checkPathsV2(document *openapiv2.Document, messages []*plugins.Message) []*plugins.Message { diff --git a/metrics/lint/aip-linterv2.go b/metrics/lint/aip-linterv2.go index 31fc8939..ee4b17ef 100644 --- a/metrics/lint/aip-linterv2.go +++ b/metrics/lint/aip-linterv2.go @@ -17,8 +17,8 @@ package linter import ( "fmt" - rules "github.com/googleapis/gnostic/metrics/rules" - pb "github.com/googleapis/gnostic/openapiv2" + rules "github.com/google/gnostic/metrics/rules" + pb "github.com/google/gnostic/openapiv2" ) // fillProtoStructure takes a slice of rules and coverts them to a slice of diff --git a/metrics/lint/aip-linterv3.go b/metrics/lint/aip-linterv3.go index 534aad6a..c2737836 100644 --- a/metrics/lint/aip-linterv3.go +++ b/metrics/lint/aip-linterv3.go @@ -18,8 +18,8 @@ import ( "fmt" "os" - rules "github.com/googleapis/gnostic/metrics/rules" - openapi_v3 "github.com/googleapis/gnostic/openapiv3" + rules "github.com/google/gnostic/metrics/rules" + openapi_v3 "github.com/google/gnostic/openapiv3" ) // processParametersV2 loops over the parameters of component and creates a diff --git a/metrics/vocabulary/difference.go b/metrics/vocabulary/difference.go index 8c2ad490..9745099c 100644 --- a/metrics/vocabulary/difference.go +++ b/metrics/vocabulary/difference.go @@ -15,7 +15,7 @@ package vocabulary import ( - metrics "github.com/googleapis/gnostic/metrics" + metrics "github.com/google/gnostic/metrics" ) // mapDifference finds the difference between two Vocabularies. diff --git a/metrics/vocabulary/discovery.go b/metrics/vocabulary/discovery.go index 7c2145d3..3e8d8032 100644 --- a/metrics/vocabulary/discovery.go +++ b/metrics/vocabulary/discovery.go @@ -15,8 +15,8 @@ package vocabulary import ( - discovery_v1 "github.com/googleapis/gnostic/discovery" - metrics "github.com/googleapis/gnostic/metrics" + discovery_v1 "github.com/google/gnostic/discovery" + metrics "github.com/google/gnostic/metrics" ) func (vocab *Vocabulary) processMethodDiscovery(operation *discovery_v1.Method) { diff --git a/metrics/vocabulary/filterCommon.go b/metrics/vocabulary/filterCommon.go index bcbd1679..39c4698a 100644 --- a/metrics/vocabulary/filterCommon.go +++ b/metrics/vocabulary/filterCommon.go @@ -15,7 +15,7 @@ package vocabulary import ( - metrics "github.com/googleapis/gnostic/metrics" + metrics "github.com/google/gnostic/metrics" ) // FilterCommon implements the difference operation amongst a slice of Vocabularies. diff --git a/metrics/vocabulary/intersection.go b/metrics/vocabulary/intersection.go index d417df82..58b22718 100644 --- a/metrics/vocabulary/intersection.go +++ b/metrics/vocabulary/intersection.go @@ -15,7 +15,7 @@ package vocabulary import ( - metrics "github.com/googleapis/gnostic/metrics" + metrics "github.com/google/gnostic/metrics" ) // mapIntersection finds the intersection between two Vocabularies. diff --git a/metrics/vocabulary/openapiv2.go b/metrics/vocabulary/openapiv2.go index 81f725fd..38875cbc 100644 --- a/metrics/vocabulary/openapiv2.go +++ b/metrics/vocabulary/openapiv2.go @@ -15,8 +15,8 @@ package vocabulary import ( - metrics "github.com/googleapis/gnostic/metrics" - openapi_v2 "github.com/googleapis/gnostic/openapiv2" + metrics "github.com/google/gnostic/metrics" + openapi_v2 "github.com/google/gnostic/openapiv2" ) func (vocab *Vocabulary) processOperationV2(operation *openapi_v2.Operation) { diff --git a/metrics/vocabulary/openapiv3.go b/metrics/vocabulary/openapiv3.go index b7e874fa..ab94df51 100644 --- a/metrics/vocabulary/openapiv3.go +++ b/metrics/vocabulary/openapiv3.go @@ -17,8 +17,8 @@ package vocabulary import ( "sort" - metrics "github.com/googleapis/gnostic/metrics" - openapi_v3 "github.com/googleapis/gnostic/openapiv3" + metrics "github.com/google/gnostic/metrics" + openapi_v3 "github.com/google/gnostic/openapiv3" ) func fillProtoStructures(m map[string]int) []*metrics.WordCount { diff --git a/metrics/vocabulary/union.go b/metrics/vocabulary/union.go index 10a8e718..57d05b8a 100644 --- a/metrics/vocabulary/union.go +++ b/metrics/vocabulary/union.go @@ -15,7 +15,7 @@ package vocabulary import ( - metrics "github.com/googleapis/gnostic/metrics" + metrics "github.com/google/gnostic/metrics" ) // Union implements the union operation between multiple Vocabularies. diff --git a/metrics/vocabulary/version.go b/metrics/vocabulary/version.go index 783a210c..7dd0de55 100644 --- a/metrics/vocabulary/version.go +++ b/metrics/vocabulary/version.go @@ -15,7 +15,7 @@ package vocabulary import ( - metrics "github.com/googleapis/gnostic/metrics" + metrics "github.com/google/gnostic/metrics" ) // fillVersionProto takes a newer and older version of a vocabularies and utilizes the diff --git a/metrics/vocabulary/vocabulary.go b/metrics/vocabulary/vocabulary.go index bb11368b..cbca53f9 100644 --- a/metrics/vocabulary/vocabulary.go +++ b/metrics/vocabulary/vocabulary.go @@ -24,8 +24,9 @@ import ( "sort" "strings" - metrics "github.com/googleapis/gnostic/metrics" "google.golang.org/protobuf/proto" + + metrics "github.com/google/gnostic/metrics" ) type Vocabulary struct { diff --git a/metrics/vocabulary/vocabulary_test.go b/metrics/vocabulary/vocabulary_test.go index caefcda3..90d93868 100644 --- a/metrics/vocabulary/vocabulary_test.go +++ b/metrics/vocabulary/vocabulary_test.go @@ -21,10 +21,11 @@ import ( "testing" "github.com/golang/protobuf/jsonpb" - discovery "github.com/googleapis/gnostic/discovery" - metrics "github.com/googleapis/gnostic/metrics" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" + + discovery "github.com/google/gnostic/discovery" + metrics "github.com/google/gnostic/metrics" + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" ) func fillTestProtoStructure(words []string, count []int) []*metrics.WordCount { diff --git a/openapiv2/OpenAPIv2.go b/openapiv2/OpenAPIv2.go index 727d7f4a..0f179076 100644 --- a/openapiv2/OpenAPIv2.go +++ b/openapiv2/OpenAPIv2.go @@ -18,10 +18,12 @@ package openapi_v2 import ( "fmt" - "github.com/googleapis/gnostic/compiler" - "gopkg.in/yaml.v3" "regexp" "strings" + + "gopkg.in/yaml.v3" + + "github.com/google/gnostic/compiler" ) // Version returns the package name (and OpenAPI version). diff --git a/openapiv2/document.go b/openapiv2/document.go index 56e5966b..0021ae87 100644 --- a/openapiv2/document.go +++ b/openapiv2/document.go @@ -15,8 +15,9 @@ package openapi_v2 import ( - "github.com/googleapis/gnostic/compiler" "gopkg.in/yaml.v3" + + "github.com/google/gnostic/compiler" ) // ParseDocument reads an OpenAPI v2 description from a YAML/JSON representation. diff --git a/openapiv3/OpenAPIv3.go b/openapiv3/OpenAPIv3.go index 607e33c7..dc6feb3d 100644 --- a/openapiv3/OpenAPIv3.go +++ b/openapiv3/OpenAPIv3.go @@ -18,10 +18,12 @@ package openapi_v3 import ( "fmt" - "github.com/googleapis/gnostic/compiler" - "gopkg.in/yaml.v3" "regexp" "strings" + + "gopkg.in/yaml.v3" + + "github.com/google/gnostic/compiler" ) // Version returns the package name (and OpenAPI version). diff --git a/openapiv3/document.go b/openapiv3/document.go index 999f7fd2..ef10d1d9 100644 --- a/openapiv3/document.go +++ b/openapiv3/document.go @@ -15,8 +15,9 @@ package openapi_v3 import ( - "github.com/googleapis/gnostic/compiler" "gopkg.in/yaml.v3" + + "github.com/google/gnostic/compiler" ) // ParseDocument reads an OpenAPI v3 description from a YAML/JSON representation. diff --git a/openapiv3/schema-generator/main.go b/openapiv3/schema-generator/main.go index 3ee2ed41..a75002ff 100644 --- a/openapiv3/schema-generator/main.go +++ b/openapiv3/schema-generator/main.go @@ -29,7 +29,7 @@ import ( "unicode" "unicode/utf8" - "github.com/googleapis/gnostic/jsonschema" + "github.com/google/gnostic/jsonschema" ) // convert the first character of a string to lower case diff --git a/plugins/environment.go b/plugins/environment.go index f0ca035b..3a935295 100644 --- a/plugins/environment.go +++ b/plugins/environment.go @@ -14,10 +14,10 @@ import ( "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/any" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - discovery "github.com/googleapis/gnostic/discovery" - surface "github.com/googleapis/gnostic/surface" + discovery "github.com/google/gnostic/discovery" + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + surface "github.com/google/gnostic/surface" ) // Environment contains the environment of a plugin call. diff --git a/plugins/gnostic-analyze/main.go b/plugins/gnostic-analyze/main.go index 0d4babac..f2e6918f 100644 --- a/plugins/gnostic-analyze/main.go +++ b/plugins/gnostic-analyze/main.go @@ -30,12 +30,13 @@ import ( "path" "strings" - "github.com/googleapis/gnostic/plugins/gnostic-analyze/statistics" + "github.com/google/gnostic/plugins/gnostic-analyze/statistics" "github.com/golang/protobuf/proto" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) // Record an error, then serialize and return a response. diff --git a/plugins/gnostic-analyze/statistics/statsv2.go b/plugins/gnostic-analyze/statistics/statsv2.go index b7199308..7f64e81d 100644 --- a/plugins/gnostic-analyze/statistics/statsv2.go +++ b/plugins/gnostic-analyze/statistics/statsv2.go @@ -18,7 +18,7 @@ import ( "fmt" "strings" - openapi "github.com/googleapis/gnostic/openapiv2" + openapi "github.com/google/gnostic/openapiv2" ) // DocumentStatistics contains information collected about an API description. diff --git a/plugins/gnostic-analyze/statistics/statsv3.go b/plugins/gnostic-analyze/statistics/statsv3.go index 7bd4ba0d..e7f8f0c9 100644 --- a/plugins/gnostic-analyze/statistics/statsv3.go +++ b/plugins/gnostic-analyze/statistics/statsv3.go @@ -15,7 +15,7 @@ package statistics import ( - openapi "github.com/googleapis/gnostic/openapiv3" + openapi "github.com/google/gnostic/openapiv3" ) // NewDocumentStatistics builds a new DocumentStatistics object. diff --git a/plugins/gnostic-analyze/summarize/main.go b/plugins/gnostic-analyze/summarize/main.go index c0119ce7..7056ee82 100644 --- a/plugins/gnostic-analyze/summarize/main.go +++ b/plugins/gnostic-analyze/summarize/main.go @@ -24,7 +24,7 @@ import ( "path/filepath" "sort" - "github.com/googleapis/gnostic/plugins/gnostic-analyze/statistics" + "github.com/google/gnostic/plugins/gnostic-analyze/statistics" ) // Results are collected in this global slice. diff --git a/plugins/gnostic-complexity/main.go b/plugins/gnostic-complexity/main.go index d3053c91..fbffc45c 100644 --- a/plugins/gnostic-complexity/main.go +++ b/plugins/gnostic-complexity/main.go @@ -20,10 +20,11 @@ import ( "path/filepath" "github.com/golang/protobuf/proto" - metrics "github.com/googleapis/gnostic/metrics" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + + metrics "github.com/google/gnostic/metrics" + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) // This is the main function for the plugin. diff --git a/plugins/gnostic-linter/main.go b/plugins/gnostic-linter/main.go index 68208b9d..116f80b6 100644 --- a/plugins/gnostic-linter/main.go +++ b/plugins/gnostic-linter/main.go @@ -19,10 +19,11 @@ import ( "path/filepath" "github.com/golang/protobuf/proto" - lint "github.com/googleapis/gnostic/metrics/lint" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + + lint "github.com/google/gnostic/metrics/lint" + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) // Record an error, then serialize and return a response. diff --git a/plugins/gnostic-plugin-request/main.go b/plugins/gnostic-plugin-request/main.go index f85f012c..0c42af60 100644 --- a/plugins/gnostic-plugin-request/main.go +++ b/plugins/gnostic-plugin-request/main.go @@ -21,10 +21,11 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" - surface "github.com/googleapis/gnostic/surface" + + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" + surface "github.com/google/gnostic/surface" ) func main() { diff --git a/plugins/gnostic-process-plugin-response/main.go b/plugins/gnostic-process-plugin-response/main.go index 3332128b..294b97b0 100644 --- a/plugins/gnostic-process-plugin-response/main.go +++ b/plugins/gnostic-process-plugin-response/main.go @@ -24,7 +24,8 @@ import ( "os" "github.com/golang/protobuf/proto" - plugins "github.com/googleapis/gnostic/plugins" + + plugins "github.com/google/gnostic/plugins" ) func exitIfError(err error) { diff --git a/plugins/gnostic-summary/main.go b/plugins/gnostic-summary/main.go index 9a63a736..846e2904 100644 --- a/plugins/gnostic-summary/main.go +++ b/plugins/gnostic-summary/main.go @@ -21,10 +21,11 @@ import ( "path/filepath" "github.com/golang/protobuf/proto" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" - "github.com/googleapis/gnostic/printer" + + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" + "github.com/google/gnostic/printer" ) // generate a simple report of an OpenAPI document's contents diff --git a/plugins/gnostic-vocabulary/main.go b/plugins/gnostic-vocabulary/main.go index 18873137..dbfb1125 100644 --- a/plugins/gnostic-vocabulary/main.go +++ b/plugins/gnostic-vocabulary/main.go @@ -20,12 +20,13 @@ import ( "path/filepath" "github.com/golang/protobuf/proto" - discovery_v1 "github.com/googleapis/gnostic/discovery" - metrics "github.com/googleapis/gnostic/metrics" - vocabulary "github.com/googleapis/gnostic/metrics/vocabulary" - openapiv2 "github.com/googleapis/gnostic/openapiv2" - openapiv3 "github.com/googleapis/gnostic/openapiv3" - plugins "github.com/googleapis/gnostic/plugins" + + discovery_v1 "github.com/google/gnostic/discovery" + metrics "github.com/google/gnostic/metrics" + vocabulary "github.com/google/gnostic/metrics/vocabulary" + openapiv2 "github.com/google/gnostic/openapiv2" + openapiv3 "github.com/google/gnostic/openapiv3" + plugins "github.com/google/gnostic/plugins" ) // Record an error, then serialize and return a response. diff --git a/surface/model_openapiv2.go b/surface/model_openapiv2.go index 772c1e54..9974f028 100644 --- a/surface/model_openapiv2.go +++ b/surface/model_openapiv2.go @@ -15,10 +15,11 @@ package surface_v1 import ( - openapiv2 "github.com/googleapis/gnostic/openapiv2" - "github.com/googleapis/gnostic/compiler" "log" "strconv" + + "github.com/google/gnostic/compiler" + openapiv2 "github.com/google/gnostic/openapiv2" ) type OpenAPI2Builder struct { diff --git a/surface/model_openapiv3.go b/surface/model_openapiv3.go index 86282028..83df4ed9 100644 --- a/surface/model_openapiv3.go +++ b/surface/model_openapiv3.go @@ -15,10 +15,11 @@ package surface_v1 import ( - "github.com/googleapis/gnostic/compiler" - openapiv3 "github.com/googleapis/gnostic/openapiv3" "log" "strings" + + "github.com/google/gnostic/compiler" + openapiv3 "github.com/google/gnostic/openapiv3" ) type OpenAPI3Builder struct { diff --git a/tools/format-schema/main.go b/tools/format-schema/main.go index 1feb7134..5cc363c3 100644 --- a/tools/format-schema/main.go +++ b/tools/format-schema/main.go @@ -17,9 +17,10 @@ package main import ( "fmt" - "github.com/googleapis/gnostic/jsonschema" "os" "path" + + "github.com/google/gnostic/jsonschema" ) func main() { diff --git a/tools/j2y2j/main.go b/tools/j2y2j/main.go index ae8eecb0..4b74fb43 100644 --- a/tools/j2y2j/main.go +++ b/tools/j2y2j/main.go @@ -21,8 +21,9 @@ import ( "os" "path" - "github.com/googleapis/gnostic/jsonschema" "gopkg.in/yaml.v3" + + "github.com/google/gnostic/jsonschema" ) func usage() {