openapicompat

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package openapicompat contains normalization used only by the OpenAPI compatibility gate. It does not alter runtime request or response behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSecuritySchemes

func CheckSecuritySchemes(base, revision io.Reader) error

CheckSecuritySchemes rejects any semantic change to the authentication scheme definitions. oasdiff detects scheme additions/removals but does not currently detect fields such as HTTP scheme or API-key name/location.

func CheckStableSDKSurface

func CheckStableSDKSurface(base, revision io.Reader) error

CheckStableSDKSurface protects OpenAPI names that are part of generated SDK APIs but are not treated as wire-level breaking changes by oasdiff.

The inputs must already have passed NormalizeStability and PruneExportInterior. That makes the canonical beta marker authoritative and preserves the account export's versioned-interior exemption.

func CheckStableSDKSurfaceWithAllowedSchemaCorrections

func CheckStableSDKSurfaceWithAllowedSchemaCorrections(base, revision io.Reader, allowedDemotions, allowedRemovals []string) error

CheckStableSDKSurfaceWithAllowedSchemaCorrections permits exact, reviewed pre-GA lifecycle corrections while leaving the default stable SDK freeze strict. Removal exceptions are narrower than demotions and must only name generated models intentionally retired before the announced GA tag.

func CheckStableSDKSurfaceWithAllowedSchemaDemotions

func CheckStableSDKSurfaceWithAllowedSchemaDemotions(base, revision io.Reader, allowedDemotions []string) error

CheckStableSDKSurfaceWithAllowedSchemaDemotions applies the same stable SDK freeze while permitting an explicit, exact set of schema lifecycle corrections. Callers should use this only when a schema landed after the latest release with a missing beta marker; the default check remains strict.

func NormalizeStability

func NormalizeStability(r io.Reader, w io.Writer) error

NormalizeStability maps e2a's historical experimental marker into the canonical lifecycle extension understood by oasdiff. Older release specs can therefore be compared with newer specs without misclassifying beta APIs as stable.

func PruneExportInterior

func PruneExportInterior(r io.Reader, w io.Writer) error

PruneExportInterior rewrites an OpenAPI document for the compatibility gate: the account export's versioned-interior schemas are collapsed to `{type: object, additionalProperties: true, x-stability-level: beta}`. A document with no UserExport component passes through semantically unchanged. Like NormalizeStability, this never alters runtime behavior — it only feeds oasdiff.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL