Skip to content

Commit

Permalink
Added test for #269
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Apr 19, 2024
1 parent 8d4b638 commit 3aed0d3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package libopenapi

import (
"bytes"
"errors"
"fmt"
"log/slog"
"os"
Expand Down Expand Up @@ -1344,3 +1345,30 @@ func TestDocument_Issue264(t *testing.T) {
assert.Len(t, errs, 1)
assert.Equal(t, "yaml: cannot decode !!float `-999.99` as a !!int", errs[0].Error())
}

func TestDocument_Issue269(t *testing.T) {

spec := `openapi: "3.0.0"
info:
title: test
version: "3"
paths: { }
components:
schemas:
Container:
properties:
pet:
$ref: https://petstore3.swagger.io/api/v3/openapi.json#/components/schemas/Pet`

doc, err := NewDocumentWithConfiguration([]byte(spec), &datamodel.DocumentConfiguration{
AllowRemoteReferences: true,
})
if err != nil {
panic(err)
}
_, errs := doc.BuildV3Model()
if len(errs) > 0 {
fmt.Println(errors.Join(errs...))
}

}

0 comments on commit 3aed0d3

Please sign in to comment.