-
Notifications
You must be signed in to change notification settings - Fork 193
Open
Labels
Description
See #2091 for full context, as well as a fixing (but backwards-incompatible) patch. I'm filing this as a separate issue so that it can be tracked for Rekor's v2 series 🙂
TL;DR:
- Rekor uses an OpenAPI spec written in Swagger 2.0
- The OpenAPI spec currently includes a
LogEntry.bodydefinition withtype: object, which doesn't reflect the actual type ofbodyin practice (in practice it's actually a base64 string, i.e.type: string) - This would have caused problems in the Go code except that Go generates
type: objectasinterface, meaning that the mis-typing was silently ignored and is now baked into the public API for Rekor. - As such, changing
LogEntry.bodytotype: stringcan't be done until Rekor v2.
Alternatives considered:
- Fixing it now: this can't be done, since it incurs backwards-incompatible changes to the generated Go clients. These changes are mostly trivial (going from
interface.(string)to usingstringdirectly), but are still incompatible and therefore must wait until v2. - Using
oneOfin the OpenAPI definition: this doesn't work, since the current OpenAPI spec used is Swagger 2.0, which does not supportoneOf. This could be fixed by upgrading from Swagger 2.0 to OpenAPI 3.0 (OpenAPI 3.0 foropenapi.yaml? #1729), but this is itself blocked by go-swagger's intentional lack of support for OAPI 3.0 (Support for Open API spec 3.0 go-swagger/go-swagger#1122)