-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improves indirect recursion detection (#46)
Co-authored-by: HiDeoo <[email protected]>
- Loading branch information
1 parent
957cae3
commit 506675d
Showing
10 changed files
with
251 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { expect, test } from './test' | ||
|
||
test('displays the recursive tag for a recursive category schema', async ({ docPage }) => { | ||
await docPage.goto('/v3/recursive/operations/listcategories') | ||
const okResponse = docPage.getResponse('200') | ||
await expect(okResponse.getByText('recursive')).toHaveCount(1) | ||
}) | ||
|
||
test('displays the recursive tag for a recursive post schema', async ({ docPage }) => { | ||
await docPage.goto('/v3/recursive/operations/listposts') | ||
const okResponse = docPage.getResponse('200') | ||
await expect(okResponse.getByText('recursive')).toHaveCount(1) | ||
}) | ||
|
||
test('displays the recursive tag for a simpler recursive category schema', async ({ docPage }) => { | ||
await docPage.goto('/v3/recursive-simple/operations/listcategories') | ||
const okResponse = docPage.getResponse('200') | ||
await expect(okResponse.getByText('recursive')).toHaveCount(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Test Simple Recursion | ||
description: Example of the simple recursion issue. | ||
version: 1.0.0 | ||
servers: | ||
- url: 'http://localhost' | ||
paths: | ||
/categories: | ||
get: | ||
summary: List all categories | ||
operationId: listCategories | ||
parameters: | ||
- name: limit | ||
in: query | ||
description: How many categories to return at one time (max 100) | ||
schema: | ||
type: integer | ||
maximum: 50 | ||
format: int32 | ||
nullable: true | ||
- name: offset | ||
in: query | ||
description: The number of categories to skip before starting to collect the result set | ||
required: false | ||
schema: | ||
type: integer | ||
format: int32 | ||
responses: | ||
'200': | ||
description: A paged array of categories | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Categories' | ||
default: | ||
description: unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Error' | ||
components: | ||
schemas: | ||
Category: | ||
type: object | ||
required: | ||
- id | ||
- name | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
parent: | ||
$ref: '#/components/schemas/Category' | ||
Categories: | ||
type: array | ||
maxItems: 100 | ||
items: | ||
$ref: '#/components/schemas/Category' | ||
Error: | ||
type: object | ||
required: | ||
- code | ||
- message | ||
properties: | ||
code: | ||
type: integer | ||
format: int32 | ||
message: | ||
type: string |
Oops, something went wrong.