Skip to content

Commit

Permalink
test: udpate spec and spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoenig134 committed Jul 11, 2024
1 parent 00b83f9 commit 6eba208
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
17 changes: 13 additions & 4 deletions src/modules/coreHttpApi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,18 @@ paths:
schema:
$ref: "#/components/schemas/AttributeID"
responses:
204:
200:
description: Success
content:
application/json:
schema:
type: object
properties:
result:
nullable: false
$ref: "#/components/schemas/Attribute"
required:
- result
headers:
X-Response-Duration-ms:
schema:
Expand All @@ -1029,9 +1039,8 @@ paths:
schema:
$ref: "#/components/schemas/AttributeID"
responses:
200:
description: |
Success. Deleting an repository attribute.
204:
description: Success. Deleting an repository attribute.
headers:
X-Response-Duration-ms:
schema:
Expand Down
5 changes: 3 additions & 2 deletions test/spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ describe("test openapi spec against routes", () => {

test("all routes should have the same HTTP methods", () => {
const manualPaths = getPaths(manualOpenApiSpec);
// Paths to ignore in regard to return code consistency (Post requests that return 200 due to no creation)
// Paths to ignore in regard to return code consistency (Post requests that return 200 due to no creation, deletes that return 204)
/* eslint-disable @typescript-eslint/naming-convention */
const returnCodeOverwrite: Record<string, Record<string, string> | undefined> = {
"/api/v2/Account/Sync": { post: "200" },
"/api/v2/Attributes/ExecuteIQLQuery": { post: "200" },
"/api/v2/Attributes/ValidateIQLQuery": { post: "200" },
"/api/v2/Challenges/Validate": { post: "200" },
"/api/v2/Relationships/{param}": { delete: "204" }
"/api/v2/Relationships/{param}": { delete: "204" },
"/api/v2/Attributes/{param}": { delete: "204" }
};
/* eslint-enable @typescript-eslint/naming-convention */

Expand Down

0 comments on commit 6eba208

Please sign in to comment.