test(09-03): add failing test for strict form schema compilation
- All locked field kinds, empty and single documents, and source order fail closed - Unknown keys, types, duplicates, path escape, modelClass, partials, and missing assets must name the plugin, controller, and file
This commit is contained in:
28
cabana/form_schema.go
Normal file
28
cabana/form_schema.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package cabana
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/fs"
|
||||
|
||||
"git.golem15.com/golem15/summercms/pact"
|
||||
)
|
||||
|
||||
// FormSchema is the boot-compiled form contract. The RED stub rejects every
|
||||
// asset so the ADMIN-01 tests fail on the contract, not on a missing symbol.
|
||||
type FormSchema struct{}
|
||||
|
||||
// CompileForm will compile config_form.yaml and fields.yaml. It does not yet.
|
||||
func CompileForm(pluginID string, ctl pact.AdminController, fsys fs.FS) (*FormSchema, error) {
|
||||
if pluginID == "" || ctl == nil || fsys == nil {
|
||||
return nil, fmt.Errorf("cabana: form schema is not implemented")
|
||||
}
|
||||
return nil, fmt.Errorf("cabana: form schema is not implemented")
|
||||
}
|
||||
|
||||
// CanonicalJSON will emit the stable form contract. It does not yet.
|
||||
func (s *FormSchema) CanonicalJSON() ([]byte, error) {
|
||||
if s == nil {
|
||||
return nil, fmt.Errorf("cabana: form schema is not implemented")
|
||||
}
|
||||
return nil, fmt.Errorf("cabana: form schema is not implemented")
|
||||
}
|
||||
Reference in New Issue
Block a user