Skip to content

Commit 50227cd

Browse files
authored
Remove unused content attribute from the spec (#277)
Remove unused option to embed specs.
1 parent 1cd07c6 commit 50227cd

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

code/go/internal/validator/common_spec.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import (
1010
)
1111

1212
type commonSpec struct {
13-
AdditionalContents bool `yaml:"additionalContents"`
14-
Content map[string]interface{} `yaml:"content"`
15-
Contents []folderItemSpec `yaml:"contents"`
16-
DevelopmentFolder bool `yaml:"developmentFolder"`
13+
AdditionalContents bool `yaml:"additionalContents"`
14+
Contents []folderItemSpec `yaml:"contents"`
15+
DevelopmentFolder bool `yaml:"developmentFolder"`
1716
}
1817

1918
func setDefaultValues(spec *commonSpec) error {

code/go/internal/validator/folder_item_spec.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ func (s *folderItemSpec) validate(fs fs.FS, folderSpecPath string, itemPath stri
7979
if s.Ref != "" {
8080
schemaPath := filepath.Join(filepath.Dir(folderSpecPath), s.Ref)
8181
schemaLoader = yamlschema.NewReferenceLoaderFileSystem("file:///"+schemaPath, fs)
82-
} else if s.Content != nil {
83-
schemaLoader = yamlschema.NewRawLoaderFileSystem(s.Content, fs)
8482
} else {
8583
return nil // item's schema is not defined
8684
}

code/go/internal/yamlschema/schema_loader.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ type rawReferenceLoader struct {
3232
source interface{}
3333
}
3434

35-
var _ gojsonschema.JSONLoader = new(rawReferenceLoader)
36-
3735
// NewReferenceLoaderFileSystem method creates new instance of `yamlReferenceLoader`.
3836
func NewReferenceLoaderFileSystem(source string, fs fs.FS) gojsonschema.JSONLoader {
3937
return &yamlReferenceLoader{
@@ -42,14 +40,6 @@ func NewReferenceLoaderFileSystem(source string, fs fs.FS) gojsonschema.JSONLoad
4240
}
4341
}
4442

45-
// NewRawLoaderFileSystem method creates new instance of `rawReferenceLoader`
46-
func NewRawLoaderFileSystem(source interface{}, fs fs.FS) gojsonschema.JSONLoader {
47-
return &rawReferenceLoader{
48-
fs: fs,
49-
source: source,
50-
}
51-
}
52-
5343
func (l *yamlReferenceLoader) JsonSource() interface{} { // golint:ignore
5444
return l.source
5545
}
@@ -94,24 +84,6 @@ func (l *yamlReferenceLoader) LoaderFactory() gojsonschema.JSONLoaderFactory {
9484
}
9585
}
9686

97-
func (l *rawReferenceLoader) JsonSource() interface{} {
98-
return l.source
99-
}
100-
101-
func (l *rawReferenceLoader) LoadJSON() (interface{}, error) {
102-
return l.source, nil
103-
}
104-
105-
func (l *rawReferenceLoader) JsonReference() (gojsonreference.JsonReference, error) {
106-
return gojsonreference.NewJsonReference("#")
107-
}
108-
109-
func (l *rawReferenceLoader) LoaderFactory() gojsonschema.JSONLoaderFactory {
110-
return &fileSystemYAMLLoaderFactory{
111-
fs: l.fs,
112-
}
113-
}
114-
11587
type fileSystemYAMLLoaderFactory struct {
11688
fs fs.FS
11789
}

0 commit comments

Comments
 (0)