Skip to content

Commit

Permalink
fix: use updated public REST API endpoint
Browse files Browse the repository at this point in the history
We're just calling "v3" the REST API now; it's now a multiverse of
concurrent versions vervetted together.
  • Loading branch information
cmars committed Mar 24, 2022
1 parent d36f40a commit 76a5160
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/workflows/templates/new-resource-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function baseOpenApiSpec(
"x-singular-name": name.toLowerCase(),
},
servers: [
{ url: "https://api.snyk.io/v3", description: "Public Snyk API" },
{ url: "https://api.snyk.io/rest", description: "Snyk REST API" },
],
tags: [
{
Expand Down
5 changes: 5 additions & 0 deletions src/workflows/tests/templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ function checkTemplate(template) {
template(updatedSpec, {
pluralResourceName: "users",
});
expect(updatedSpec.servers).toEqual(
expect.arrayContaining([
expect.objectContaining({ url: "https://api.snyk.io/rest" }),
]),
);
const results = await check(baseSpec, updatedSpec);
const failedChecks = results.filter((r) => !r.passed);
expect(failedChecks.length).toBe(0);
Expand Down

0 comments on commit 76a5160

Please sign in to comment.