Heray-Was-Here
Server : LiteSpeed
System : Linux uk-fast-web1372.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User : u390967363 ( 390967363)
PHP Version : 8.2.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Directory :  /opt/go/pkg/mod/github.com/go-openapi/spec@v0.20.14/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/go/pkg/mod/github.com/go-openapi/spec@v0.20.14/schema_loader_test.go
package spec

import (
	"encoding/json"
	"path/filepath"
	"testing"

	"github.com/stretchr/testify/require"
)

func TestLoader_Issue145(t *testing.T) {
	t.Run("with ExpandSpec", func(t *testing.T) {
		basePath := filepath.Join("fixtures", "bugs", "145", "Program Files (x86)", "AppName", "todos.json")
		todosDoc, err := jsonDoc(basePath)
		require.NoError(t, err)

		spec := new(Swagger)
		require.NoError(t, json.Unmarshal(todosDoc, spec))

		require.NoError(t, ExpandSpec(spec, &ExpandOptions{RelativeBase: basePath}))
	})

	t.Run("with ExpandSchema", func(t *testing.T) {
		basePath := filepath.Join("fixtures", "bugs", "145", "Program Files (x86)", "AppName", "ref.json")
		schemaDoc, err := jsonDoc(basePath)
		require.NoError(t, err)

		sch := new(Schema)
		require.NoError(t, json.Unmarshal(schemaDoc, sch))

		require.NoError(t, ExpandSchema(sch, nil, nil))
	})
}

Hry