15
15
package spec
16
16
17
17
import (
18
- "encoding/json"
19
18
"io/ioutil"
20
19
"log"
21
20
"net/http"
@@ -27,6 +26,8 @@ import (
27
26
"strings"
28
27
"testing"
29
28
29
+ stdjson "encoding/json"
30
+
30
31
"github.com/go-openapi/jsonpointer"
31
32
"github.com/go-openapi/swag"
32
33
"github.com/stretchr/testify/assert"
@@ -39,12 +40,12 @@ var (
39
40
rex = regexp .MustCompile (`"\$ref":\s*"(.+)"` )
40
41
)
41
42
42
- func jsonDoc (path string ) (json .RawMessage , error ) {
43
+ func jsonDoc (path string ) (stdjson .RawMessage , error ) {
43
44
data , err := swag .LoadFromFileOrHTTP (path )
44
45
if err != nil {
45
46
return nil , err
46
47
}
47
- return json .RawMessage (data ), nil
48
+ return stdjson .RawMessage (data ), nil
48
49
}
49
50
50
51
// tests that paths are normalized correctly
@@ -1030,8 +1031,9 @@ func TestSchemaExpansion(t *testing.T) {
1030
1031
}
1031
1032
1032
1033
func TestDefaultResolutionCache (t * testing.T ) {
1033
-
1034
1034
cache := initResolutionCache ()
1035
+ jsonSchema := MustLoadJSONSchemaDraft04 ()
1036
+ swaggerSchema := MustLoadSwagger20Schema ()
1035
1037
1036
1038
sch , ok := cache .Get ("not there" )
1037
1039
assert .False (t , ok )
@@ -1760,7 +1762,7 @@ func TestResolveExtraItem(t *testing.T) {
1760
1762
}
1761
1763
1762
1764
// PetStoreJSONMessage json raw message for Petstore20
1763
- var PetStoreJSONMessage = json .RawMessage ([]byte (PetStore20 ))
1765
+ var PetStoreJSONMessage = stdjson .RawMessage ([]byte (PetStore20 ))
1764
1766
1765
1767
// PetStore20 json doc for swagger 2.0 pet store
1766
1768
const PetStore20 = `{
0 commit comments