diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
| commit | 310ac404f25b412c5c1ead12247b4eb36e9f0025 (patch) | |
| tree | 6e1dcc5e1f85a483cef7044d341b7c940c1690a8 /internal/calfeed/json.go | |
| parent | 44472bbe31475a3c672ae003d928d7caffb4b50a (diff) | |
| parent | c5abf87fa7198c8f245f407774e2326e4b6c9b9c (diff) | |
| download | lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.tar.gz lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.zip | |
Merge branch 'engine-precedence-fixes': OF/EF calendar+readings flawlessness pass
Per-day validation vs litcal (OF) and missalemeum (EF) 2005-2050, all defects
fixed and re-validated to zero: OF calendar 0 real errors forward, OF readings
0 unresolvable, EF 0 reading gaps + resumed Sundays correct.
Diffstat (limited to 'internal/calfeed/json.go')
| -rw-r--r-- | internal/calfeed/json.go | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/internal/calfeed/json.go b/internal/calfeed/json.go index c1a50ca..1cb0b6f 100644 --- a/internal/calfeed/json.go +++ b/internal/calfeed/json.go @@ -1,17 +1,28 @@ package calfeed -import "encoding/json" +import ( + "encoding/json" + + "github.com/lukaszkasprzak/lectio/internal/config" +) const Schema = "lectio.calendar/1" // JSON renders days as the stable lectio.calendar/1 envelope. +// +// "source" and "license" carry the AGPL-3.0 ยง13 offer to consumers who only +// ever see this endpoint and never load the HTML UI. They are envelope +// metadata, not day data -- adding them does not change the schema version, +// since existing consumers read "days". func JSON(form string, days []DayView) ([]byte, error) { if days == nil { days = []DayView{} } return json.MarshalIndent(struct { - Schema string `json:"schema"` - Form string `json:"form"` - Days []DayView `json:"days"` - }{Schema, form, days}, "", " ") + Schema string `json:"schema"` + Form string `json:"form"` + Source string `json:"source"` + License string `json:"license"` + Days []DayView `json:"days"` + }{Schema, form, config.SourceURL, config.License, days}, "", " ") } |
