Skip to content

Commit

Permalink
fix(cli): allow service base path to be a slash (#4513)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Sep 2, 2024
1 parent a6692b5 commit 7554746
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
14 changes: 14 additions & 0 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
- changelog_entry:
- summary: |
`fern check` allows the service base-path to be a slash. For example, the following
would be valid:
```yml
service:
base-path: "/"
```
type: fix
created_at: '2024-09-02'
ir_version: 53
version: 0.40.4

- changelog_entry:
- summary: Now `fern generator upgrade` respects the `--group` flag and only upgrades generators within a particular group.
type: fix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ describe("valid-endpoint-path", () => {

const expectedViolations: ValidationViolation[] = [
{
message: 'Path cannot be /. Use "" instead.',
nodePath: ["service", "endpoints", "slash"],
relativeFilepath: RelativeFilePath.of("a.yml"),
severity: "error"
},
{
message: "Path must be the empty string, or start with a slash.",
message: "Path must start with a slash.",
nodePath: ["service", "endpoints", "noLeadingSlash"],
relativeFilepath: RelativeFilePath.of("a.yml"),
severity: "error"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ export const ValidEndpointPathRule: Rule = {
if (!endpoint.path.startsWith("/")) {
violations.push({
severity: "error",
message: "Path must be the empty string, or start with a slash."
});
}

if (endpoint.path === "/") {
violations.push({
severity: "error",
message: 'Path cannot be /. Use "" instead.'
message: "Path must start with a slash."
});
}

Expand Down

0 comments on commit 7554746

Please sign in to comment.