-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fb6a96
commit 295a90d
Showing
252 changed files
with
46,413 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'dart:io'; | ||
import 'package:path/path.dart' as p; | ||
import 'package:test/test.dart'; | ||
|
||
import 'package:openapi_spec/openapi_spec.dart'; | ||
|
||
void main() { | ||
final tmp = Directory( | ||
p.join('test', 'tmp', 'static'), | ||
); | ||
|
||
group("Static", () { | ||
setUpAll(() { | ||
if (!tmp.existsSync()) { | ||
tmp.createSync(recursive: true); | ||
} | ||
}); | ||
|
||
for (final version in ['v3.0', 'v3.1']) { | ||
final schema = Directory(p.join('test', 'static', version)); | ||
final allSchemas = schema.listSync().whereType<File>().where((element) => | ||
element.path.endsWith('.json') || element.path.endsWith('.yaml')); | ||
for (final e in allSchemas) { | ||
final dest = p.join(tmp.path, p.basenameWithoutExtension(e.path)); | ||
test(p.basenameWithoutExtension(e.path), () async { | ||
final spec = OpenApi.fromFile(source: e.path); | ||
await spec.generate(destination: dest); | ||
}); | ||
} | ||
} | ||
}); | ||
} |
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,27 @@ | ||
components: | ||
schemas: | ||
StringWithRegexWithThreeFlags: | ||
format: uuid | ||
pattern: /a./sim | ||
type: string | ||
UUID: | ||
format: uuid | ||
pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' | ||
type: string | ||
info: | ||
title: Test | ||
version: 1.0.0-SNAPSHOT | ||
openapi: 3.0.3 | ||
paths: | ||
/test: | ||
get: | ||
parameters: | ||
- in: query | ||
name: uuid | ||
schema: | ||
$ref: '#/components/schemas/UUID' | ||
responses: | ||
'200': | ||
description: OK | ||
tags: | ||
- Test Resource |
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,12 @@ | ||
components: | ||
schemas: | ||
StringEnum: | ||
enum: | ||
- '#367B9C' | ||
- '#FFA5A4' | ||
type: string | ||
info: | ||
title: Test | ||
version: 1.0.0-SNAPSHOT | ||
openapi: 3.0.3 | ||
paths: {} |
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,22 @@ | ||
info: | ||
description: info | ||
title: info | ||
version: 0.1.0 | ||
openapi: 3.0.2 | ||
paths: | ||
/example/api: | ||
post: | ||
description: description | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
properties: | ||
name: | ||
type: string | ||
type: object | ||
required: false | ||
responses: | ||
200: | ||
description: response | ||
summary: summary |
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,25 @@ | ||
info: | ||
description: info | ||
title: info | ||
version: 0.1.0 | ||
openapi: 3.0.2 | ||
paths: | ||
/example/api: | ||
get: | ||
description: description | ||
parameters: | ||
- description: The start time. | ||
in: query | ||
name: start | ||
required: true | ||
schema: | ||
format: date-time | ||
type: string | ||
responses: | ||
200: | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
description: response | ||
summary: summary |
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,44 @@ | ||
components: | ||
parameters: | ||
formatParam: | ||
description: set format | ||
in: query | ||
name: format | ||
required: false | ||
schema: | ||
$ref: '#/components/schemas/format' | ||
requiredQueryParam: | ||
description: set query | ||
in: query | ||
name: query | ||
required: true | ||
schema: | ||
type: string | ||
schemas: | ||
format: | ||
default: json | ||
description: response format | ||
enum: | ||
- json | ||
- csv | ||
type: string | ||
info: | ||
description: info | ||
title: info | ||
version: 0.1.0 | ||
openapi: 3.0.2 | ||
paths: | ||
/example/api: | ||
get: | ||
description: description | ||
parameters: | ||
- $ref: '#/components/parameters/requiredQueryParam' | ||
- $ref: '#/components/parameters/formatParam' | ||
responses: | ||
200: | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
description: response | ||
summary: summary |
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,35 @@ | ||
components: | ||
schemas: | ||
Input: | ||
properties: | ||
age: | ||
format: int32 | ||
type: integer | ||
dt: | ||
format: date-time | ||
type: string | ||
id: | ||
type: string | ||
type: object | ||
info: | ||
title: '' | ||
version: '' | ||
openapi: 3.0.0 | ||
paths: | ||
/examples: | ||
post: | ||
operationId: getFilteredTransactions | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
items: | ||
$ref: '#/components/schemas/Input' | ||
type: array | ||
description: subscription payload | ||
responses: | ||
default: | ||
description: successful operation | ||
summary: Get a list of transactions | ||
tags: | ||
- Examples |
Oops, something went wrong.