Skip to content

Commit

Permalink
break(cli): require generators.yml to be present if using OpenAPI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Sep 3, 2024
1 parent 7554746 commit 6b62522
Show file tree
Hide file tree
Showing 41 changed files with 1,849 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ The `generators.yml` file can include information about where your API specifica
<AccordionGroup>
<Accordion title="generators.yml for Python + TypeScript SDKs">
```yaml
api:
path: ./path/to/openapi.yml
groups:
public:
generators:
Expand Down Expand Up @@ -79,7 +81,7 @@ groups:
<Accordion title="generators.yml for locating an API definition">
```yaml
api:
path: ./api.yaml
path: ./path/to/openapi.yml
```
</Accordion>
</AccordionGroup>
Expand Down
4 changes: 2 additions & 2 deletions generators/commons/src/__test__/SourceFetcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbsoluteFilePath, getDirectoryContents } from "@fern-api/fs-utils";
import { AbsoluteFilePath, getDirectoryContents, getDirectoryContentsForSnapshot } from "@fern-api/fs-utils";
import path from "path";
import { AbstractGeneratorContext } from "../AbstractGeneratorContext";
import { SourceFetcher } from "../SourceFetcher";
Expand Down Expand Up @@ -31,5 +31,5 @@ it("fetch proto.zip", async () => {
"google/api/http.proto",
"user/v1/user.proto"
]);
expect(await getDirectoryContents(FIXTURES)).toMatchSnapshot();
expect(await getDirectoryContentsForSnapshot(FIXTURES)).toMatchSnapshot();
}, 100_000);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbsoluteFilePath, getDirectoryContents, join, RelativeFilePath } from "@fern-api/fs-utils";
import { AbsoluteFilePath, getDirectoryContentsForSnapshot, join, RelativeFilePath } from "@fern-api/fs-utils";
import { createMockTaskContext } from "@fern-api/task-context";
import { cp } from "fs/promises";
import tmp from "tmp-promise";
Expand Down Expand Up @@ -27,7 +27,7 @@ describe("update-directory-structure", () => {
// eslint-disable-next-line no-console
console.log(`Migrated fixture ${fixture} at path ${tmpDir.path}`);

expect(await getDirectoryContents(AbsoluteFilePath.of(tmpDir.path))).toMatchSnapshot();
expect(await getDirectoryContentsForSnapshot(AbsoluteFilePath.of(tmpDir.path))).toMatchSnapshot();
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { VersionMigrations } from "../../types/VersionMigrations";
import RequireGeneratorsYml from "./require-generators-yml";

const versionMigrations: VersionMigrations = {
version: "0.41.0-rc0",
migrations: [RequireGeneratorsYml]
};

export default versionMigrations;
Loading

0 comments on commit 6b62522

Please sign in to comment.