-
Notifications
You must be signed in to change notification settings - Fork 148
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
2fde553
commit c9e47b8
Showing
30 changed files
with
340 additions
and
71 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
__tests__/bundle/bundle-arazzo-valid-test-description/museum.yaml
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 @@ | ||
arazzo: 1.0.0 | ||
info: | ||
title: Redocly Museum API Tickets | ||
description: >- | ||
A part of imaginary, but delightful Museum API for interacting with museum services | ||
and information. Built with love by Redocly. | ||
version: 1.0.0 | ||
|
||
sourceDescriptions: | ||
- name: museum-api | ||
type: openapi | ||
url: museum-api.yaml | ||
|
||
workflows: | ||
- workflowId: get-museum-tickets | ||
description: >- | ||
This workflow demonstrates how to buy tickets for the museum. | ||
parameters: | ||
- $ref: './parameter.yaml' | ||
steps: | ||
- stepId: buy-tickets | ||
description: >- | ||
Buy museum tickets resolving request details with buyMuseumTickets operationId from museum-api.yaml description. | ||
operationId: buyMuseumTickets | ||
requestBody: | ||
$ref: './request-body.yaml#/requestBody' | ||
successCriteria: | ||
- condition: $statusCode == 201 | ||
outputs: | ||
ticketId: $response.body.ticketId | ||
outputs: | ||
ticketId: $steps.buy-tickets.outputs.ticketId |
3 changes: 3 additions & 0 deletions
3
__tests__/bundle/bundle-arazzo-valid-test-description/parameter.yaml
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,3 @@ | ||
in: header | ||
name: Authorization | ||
value: Basic Og== |
5 changes: 5 additions & 0 deletions
5
__tests__/bundle/bundle-arazzo-valid-test-description/request-body.yaml
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,5 @@ | ||
requestBody: | ||
payload: | ||
ticketType: general | ||
ticketDate: 2023-09-07 | ||
email: [email protected] |
40 changes: 40 additions & 0 deletions
40
__tests__/lint/arazzo-type-extensions-with-plugin/museum.yaml
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,40 @@ | ||
arazzo: 1.0.0 | ||
info: | ||
title: Redocly Museum API Tickets | ||
description: >- | ||
A part of imaginary, but delightful Museum API for interacting with museum services | ||
and information. Built with love by Redocly. | ||
version: 1.0.0 | ||
wrong-key: wrong-value | ||
metadata: | ||
lifecycle: production | ||
owner-team: Engineering/Integrations | ||
sourceDescriptions: | ||
- name: museum-api | ||
type: openapi | ||
url: museum-api.yaml | ||
|
||
workflows: | ||
- workflowId: get-museum-tickets | ||
description: >- | ||
This workflow demonstrates how to buy tickets for the museum. | ||
parameters: | ||
- in: header | ||
name: Authorization | ||
value: Basic Og== | ||
steps: | ||
- stepId: buy-tickets | ||
description: >- | ||
Buy museum tickets resolving request details with buyMuseumTickets operationId from museum-api.yaml description. | ||
operationId: buyMuseumTickets | ||
requestBody: | ||
payload: | ||
ticketType: general | ||
ticketDate: 2023-09-07 | ||
email: [email protected] | ||
successCriteria: | ||
- condition: $statusCode == 201 | ||
outputs: | ||
ticketId: $response.body.ticketId | ||
outputs: | ||
ticketId: $steps.buy-tickets.outputs.ticketId |
28 changes: 28 additions & 0 deletions
28
__tests__/lint/arazzo-type-extensions-with-plugin/plugins/type-extention.js
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,28 @@ | ||
const XMetaData = { | ||
properties: { | ||
lifecycle: { type: 'string', enum: ['development', 'staging', 'production'] }, | ||
'owner-team': { type: 'string' }, | ||
}, | ||
required: ['lifecycle'], | ||
}; | ||
|
||
module.exports = { | ||
id: 'type-extension', | ||
typeExtension: { | ||
arazzo(types) { | ||
newTypes = { | ||
...types, | ||
XMetaData: XMetaData, | ||
'Root.info': { | ||
...types['Root.info'], | ||
properties: { | ||
...types['Root.info'].properties, | ||
metadata: 'XMetaData', | ||
}, | ||
}, | ||
}; | ||
|
||
return newTypes; | ||
}, | ||
}, | ||
}; |
5 changes: 5 additions & 0 deletions
5
__tests__/lint/arazzo-type-extensions-with-plugin/redocly.yaml
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,5 @@ | ||
plugins: | ||
- plugins/type-extention.js | ||
|
||
arazzoRules: | ||
spec: error |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.