Subject: [PATCH 42/47] gnu: Add go-github-com-go-openapi-analysis.

From: Leo Nikkilä <[email-masked]>
Date: Fri, 25 Mar 2022 15:32:06 +0200

* gnu/packages/golang.scm (go-github-com-go-openapi-analysis): New
variable.
---
 gnu/packages/golang.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 8256ad5ad6..bebde5fe89 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -10135,6 +10135,43 @@ (define-public go-github-com-go-logfmt-logfmt
     (home-page "https://github.com/go-logfmt/logfmt")
     (license license:expat)))
 
+(define-public go-github-com-go-openapi-analysis
+  (package
+    (name "go-github-com-go-openapi-analysis")
+    (version "0.21.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/go-openapi/analysis")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0kwal4skrv4nayif71cdvirsa76vm7s9lrqyac33gsc8gzsfdh7z"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/go-openapi/analysis"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tests
+           (lambda* (#:key import-path #:allow-other-keys)
+             ;; Skip test that needs network access
+             (substitute* (string-append "src/" import-path "/flatten_test.go")
+               (("func TestFlatten_RemoteAbsolute\\(t \\*testing\\.T\\) \\{"
+                 match)
+                (string-append match "\n\tt.Skip()")))
+             #t)))))
+    (propagated-inputs (list go-github-com-go-openapi-jsonpointer
+                             go-github-com-go-openapi-spec
+                             go-github-com-go-openapi-strfmt
+                             go-github-com-go-openapi-swag))
+    (native-inputs (list go-github-com-stretchr-testify))
+    (synopsis "OpenAPI specification object model analyzer")
+    (description "A foundational library to analyze an OAI specification
+document for easier reasoning about the content.")
+    (home-page "https://github.com/go-openapi/analysis")
+    (license license:asl2.0)))
+
 (define-public go-github-com-go-openapi-errors
   (package
     (name "go-github-com-go-openapi-errors")
-- 
2.34.0