Skip to content

Commit

Permalink
Fix error BuildpackApi message
Browse files Browse the repository at this point in the history
It looks like the message for BuildpackApi was copied from BuildpackId.

From the spec https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version

```
This document specifies Buildpack API version 0.5

Buildpack API versions:

    MUST be in form <major>.<minor> or <major>, where <major> is equivalent to <major>.0
    When <major> is greater than 0 increments to <minor> SHALL exclusively indicate additive changes
```

The spec actually doesn't say that it should only be numbers, but really it should. To be extremely specific, we can also specify that it cannot be greater u32::MAX which would make our implementation standards compliant.
  • Loading branch information
schneems committed Oct 26, 2021
1 parent 21832f7 commit 8f48d38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/buildpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl StackId {

#[derive(thiserror::Error, Debug)]
pub enum BuildpackTomlError {
#[error("Found `{0}` but value MUST only contain numbers, letters, and the characters `.`, `/`, and `-`. Value MUST NOT be 'config' or 'app'.")]
#[error("Found `{0}` but value MUST be in the form `<major>.<minor>` or `<major>` and only contain numbers.")]
InvalidBuildpackApi(String),

#[error("Stack with id `*` MUST not contain mixins. mixins: [{0}]")]
Expand Down

0 comments on commit 8f48d38

Please sign in to comment.