This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(oas3): support component aliases
- Loading branch information
Showing
9 changed files
with
331 additions
and
9 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
54 changes: 54 additions & 0 deletions
54
...enapi3-parser/test/integration/fixtures/components/path-item-object-parameters-alias.json
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,54 @@ | ||
{ | ||
"element": "parseResult", | ||
"content": [ | ||
{ | ||
"element": "category", | ||
"meta": { | ||
"classes": { | ||
"element": "array", | ||
"content": [ | ||
{ | ||
"element": "string", | ||
"content": "api" | ||
} | ||
] | ||
}, | ||
"title": { | ||
"element": "string", | ||
"content": "Parameter Component with alias" | ||
} | ||
}, | ||
"attributes": { | ||
"version": { | ||
"element": "string", | ||
"content": "1.0.0" | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"element": "resource", | ||
"attributes": { | ||
"href": { | ||
"element": "string", | ||
"content": "/{?foo}" | ||
}, | ||
"hrefVariables": { | ||
"element": "hrefVariables", | ||
"content": [ | ||
{ | ||
"element": "member", | ||
"content": { | ||
"key": { | ||
"element": "string", | ||
"content": "foo" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
...enapi3-parser/test/integration/fixtures/components/path-item-object-parameters-alias.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,15 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: Parameter Component with alias | ||
paths: | ||
/: | ||
parameters: | ||
- $ref: '#/components/parameters/UserAlias' | ||
components: | ||
parameters: | ||
User: | ||
in: query | ||
name: foo | ||
UserAlias: | ||
$ref: '#/components/parameters/User' |
175 changes: 175 additions & 0 deletions
175
packages/openapi3-parser/test/integration/fixtures/components/schema-alias.json
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,175 @@ | ||
{ | ||
"element": "parseResult", | ||
"content": [ | ||
{ | ||
"element": "category", | ||
"meta": { | ||
"classes": { | ||
"element": "array", | ||
"content": [ | ||
{ | ||
"element": "string", | ||
"content": "api" | ||
} | ||
] | ||
}, | ||
"title": { | ||
"element": "string", | ||
"content": "Schemas Component with alias" | ||
} | ||
}, | ||
"attributes": { | ||
"version": { | ||
"element": "string", | ||
"content": "1.0.0" | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"element": "resource", | ||
"attributes": { | ||
"href": { | ||
"element": "string", | ||
"content": "/" | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"element": "transition", | ||
"content": [ | ||
{ | ||
"element": "httpTransaction", | ||
"content": [ | ||
{ | ||
"element": "httpRequest", | ||
"attributes": { | ||
"method": { | ||
"element": "string", | ||
"content": "GET" | ||
} | ||
} | ||
}, | ||
{ | ||
"element": "httpResponse", | ||
"attributes": { | ||
"headers": { | ||
"element": "httpHeaders", | ||
"content": [ | ||
{ | ||
"element": "member", | ||
"content": { | ||
"key": { | ||
"element": "string", | ||
"content": "Content-Type" | ||
}, | ||
"value": { | ||
"element": "string", | ||
"content": "application/json" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"statusCode": { | ||
"element": "string", | ||
"content": "200" | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"element": "asset", | ||
"meta": { | ||
"classes": { | ||
"element": "array", | ||
"content": [ | ||
{ | ||
"element": "string", | ||
"content": "messageBody" | ||
} | ||
] | ||
} | ||
}, | ||
"attributes": { | ||
"contentType": { | ||
"element": "string", | ||
"content": "application/json" | ||
} | ||
}, | ||
"content": "{\"name\":\"\"}" | ||
}, | ||
{ | ||
"element": "dataStructure", | ||
"content": { | ||
"element": "UserAlias" | ||
} | ||
}, | ||
{ | ||
"element": "copy", | ||
"content": "" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"element": "category", | ||
"meta": { | ||
"classes": { | ||
"element": "array", | ||
"content": [ | ||
{ | ||
"element": "string", | ||
"content": "dataStructures" | ||
} | ||
] | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"element": "dataStructure", | ||
"content": { | ||
"element": "object", | ||
"meta": { | ||
"id": { | ||
"element": "string", | ||
"content": "User" | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"element": "member", | ||
"content": { | ||
"key": { | ||
"element": "string", | ||
"content": "name" | ||
}, | ||
"value": { | ||
"element": "string" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"element": "dataStructure", | ||
"content": { | ||
"element": "User", | ||
"meta": { | ||
"id": { | ||
"element": "string", | ||
"content": "UserAlias" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/openapi3-parser/test/integration/fixtures/components/schema-alias.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,23 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: Schemas Component with alias | ||
paths: | ||
/: | ||
get: | ||
responses: | ||
'200': | ||
description: '' | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/UserAlias' | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
UserAlias: | ||
$ref: '#/components/schemas/User' |
Oops, something went wrong.