From e6a9a31ef8501d769edc12321ec1a041df5e5838 Mon Sep 17 00:00:00 2001 From: quobix Date: Mon, 9 Sep 2024 12:49:43 -0400 Subject: [PATCH] Locked in release for DO spec. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stupid thing is throwing 404’s today for the latest release. Screw it, lock it down! --- datamodel/high/base/licence_test.go | 5 +++-- document_examples_test.go | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/datamodel/high/base/licence_test.go b/datamodel/high/base/licence_test.go index 152ca3be..53fd7ada 100644 --- a/datamodel/high/base/licence_test.go +++ b/datamodel/high/base/licence_test.go @@ -82,7 +82,8 @@ func TestLicense_Render_Identifier(t *testing.T) { func TestLicense_Render_IdentifierAndURL_Error(t *testing.T) { - // this should fail because you can't have both an identifier and a URL + // this used to fail because you can't have both an identifier and a URL + // however in v0.18.0 I deleted this logic, because it's dumb. highL := &License{Name: "MIT", Identifier: "MIT", URL: "https://pb33f.io"} dat, _ := highL.Render() @@ -95,5 +96,5 @@ func TestLicense_Render_IdentifierAndURL_Error(t *testing.T) { _ = lowmodel.BuildModel(cNode.Content[0], &lowLicense) err := lowLicense.Build(context.Background(), nil, cNode.Content[0], nil) - assert.Error(t, err) + assert.NoError(t, err) } diff --git a/document_examples_test.go b/document_examples_test.go index 4dda99fc..88c891e5 100644 --- a/document_examples_test.go +++ b/document_examples_test.go @@ -110,7 +110,9 @@ func ExampleNewDocument_fromWithDocumentConfigurationSuccess() { digitalOcean, _ := os.ReadFile("test_specs/digitalocean.yaml") // Digital Ocean needs a baseURL to be set, so we can resolve relative references. - baseURL, _ := url.Parse("https://raw.githubusercontent.com/digitalocean/openapi/main/specification") + //baseURL, _ := url.Parse("https://raw.githubusercontent.com/digitalocean/openapi/main/specification") + // locked this in to a release, because the spec is throwing 404's occasionally. + baseURL, _ := url.Parse("https://raw.githubusercontent.com/digitalocean/openapi/9b763029ba805c3e0e56927fd6685d73bc27f3e8/specification") // create a DocumentConfiguration that allows loading file and remote references, and sets the baseURL // to somewhere that can resolve the relative references.