Add output validation against a defined JSON schema
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"os"
|
||||
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/config"
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/model"
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/report"
|
||||
"gitea.maximumdirect.net/eric/seriatim/schema"
|
||||
)
|
||||
|
||||
type jsonOutputWriter struct{}
|
||||
@@ -16,7 +16,7 @@ func (jsonOutputWriter) Name() string {
|
||||
return "json"
|
||||
}
|
||||
|
||||
func (jsonOutputWriter) Write(ctx context.Context, out model.FinalTranscript, rpt report.Report, cfg config.Config) ([]report.Event, error) {
|
||||
func (jsonOutputWriter) Write(ctx context.Context, out schema.Transcript, rpt report.Report, cfg config.Config) ([]report.Event, error) {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -34,6 +34,6 @@ func (jsonOutputWriter) Write(ctx context.Context, out model.FinalTranscript, rp
|
||||
}
|
||||
|
||||
return []report.Event{
|
||||
report.Info("output", "json", "wrote placeholder transcript JSON"),
|
||||
report.Info("output", "json", "wrote transcript JSON"),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user