-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
externalDocs
when converting operations to OpenAPI
- Loading branch information
1 parent
567d7af
commit d693438
Showing
4 changed files
with
98 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
50 changes: 50 additions & 0 deletions
50
...c/test/resources/software/amazon/smithy/openapi/fromsmithy/externaldocs-test.openapi.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,50 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "MyDocs", | ||
"version": "2018-01-01" | ||
}, | ||
"externalDocumentation": { | ||
"description": "API Reference", | ||
"url": "https://localhost/docs/service" | ||
}, | ||
"paths": { | ||
"/": { | ||
"get": { | ||
"externalDocs": { | ||
"description": "API Reference", | ||
"url": "https://localhost/docs/operation" | ||
}, | ||
"operationId": "MyDocsOperation", | ||
"responses": { | ||
"200": { | ||
"description": "MyDocsOperation 200 response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/MyDocsOperationResponseContent" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"MyDocsOperationResponseContent": { | ||
"type": "object", | ||
"properties": { | ||
"foo": { | ||
"type": "string" | ||
} | ||
}, | ||
"externalDocs": { | ||
"description": "API Reference", | ||
"url": "https://localhost/docs/output" | ||
} | ||
} | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...api/src/test/resources/software/amazon/smithy/openapi/fromsmithy/externaldocs-test.smithy
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 @@ | ||
$version: "2.0" | ||
|
||
namespace smithy.example | ||
|
||
@externalDocumentation( | ||
"API Reference": "https://localhost/docs/service" | ||
) | ||
@aws.protocols#restJson1 | ||
service MyDocs { | ||
version: "2018-01-01", | ||
operations: [MyDocsOperation] | ||
} | ||
|
||
@externalDocumentation( | ||
"API Reference": "https://localhost/docs/operation" | ||
) | ||
@http(method: "GET", uri: "/") | ||
@readonly | ||
operation MyDocsOperation { | ||
output: Output | ||
} | ||
|
||
@externalDocumentation( | ||
"API Reference": "https://localhost/docs/output" | ||
) | ||
structure Output { | ||
foo: String | ||
} |