Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct the data model for
BuildpackToml
(heroku#248)
The CNB spec states that a `buildpack.toml` must contain exactly one of the tables `stacks` or `order`, but not both - since they relate to different buildpack types (single buildpacks and meta-buildpacks respectively): https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-implementations Previously `BuildpackToml` attempted to represent both of these as a single type, which both meant the type wasn't an accurate representation, but also that invalid `buildpack.toml` files would pass `libcnb package` validation only to fail later at runtime with a Pack CLI error message. Now `BuildpackToml` has been replaced with the enum `BuildpackDescriptor`, which has `Single` and `Meta` variants that wrap new `SingleBuildpackDescriptor` and `MetaBuildpackDescriptor` types. Consumers of libcnb-data can now either parse `buildpack.toml` files using `BuildpackDescriptor` when they wish to support both variants, or else use the specific sub-types when a specific buildpack type is required for improved error messages. Fixes heroku#211. GUS-W-10289129.
- Loading branch information