-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add new
@info
decorator (#2169)
fix [#980](#980) Add new `@info` decorator providing the ability to specify the additional fields from openapi info object. --------- Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
- Loading branch information
1 parent
09c2561
commit 5e53967
Showing
11 changed files
with
263 additions
and
2 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
common/changes/@typespec/openapi/feature-openapi-info_2023-07-11-15-24.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,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@typespec/openapi", | ||
"comment": "Add new `@info` decorator providing the ability to specify the additional fields from openapi info object.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@typespec/openapi" | ||
} |
10 changes: 10 additions & 0 deletions
10
common/changes/@typespec/openapi3/feature-openapi-info_2023-07-11-15-24.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,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@typespec/openapi3", | ||
"comment": "Add support for `@info` decorator providing the ability to specify the additional fields from openapi info object.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@typespec/openapi3" | ||
} |
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,33 @@ | ||
--- | ||
title: "Data types" | ||
toc_min_heading_level: 2 | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
# Data types | ||
|
||
## OpenAPI | ||
|
||
### `AdditionalInfo` {#OpenAPI.AdditionalInfo} | ||
|
||
Additional information for the OpenAPI document. | ||
|
||
```typespec | ||
model OpenAPI.AdditionalInfo | ||
``` | ||
|
||
### `Contact` {#OpenAPI.Contact} | ||
|
||
Contact information for the exposed API. | ||
|
||
```typespec | ||
model OpenAPI.Contact | ||
``` | ||
|
||
### `License` {#OpenAPI.License} | ||
|
||
License information for the exposed API. | ||
|
||
```typespec | ||
model OpenAPI.License | ||
``` |
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 |
---|---|---|
@@ -1 +1,34 @@ | ||
export type ExtensionKey = `x-${string}`; | ||
|
||
/** | ||
* OpenAPI additional information | ||
*/ | ||
export interface AdditionalInfo { | ||
/** A URL to the Terms of Service for the API. MUST be in the format of a URL. */ | ||
termsOfService?: string; | ||
|
||
/** The contact information for the exposed API. */ | ||
contact?: Contact; | ||
|
||
/** The license information for the exposed API. */ | ||
license?: License; | ||
} | ||
|
||
export interface Contact { | ||
/** The identifying name of the contact person/organization. */ | ||
name?: string; | ||
|
||
/** The URL pointing to the contact information. MUST be in the format of a URL. */ | ||
url?: string; | ||
|
||
/** The email address of the contact person/organization. MUST be in the format of an email address. */ | ||
email?: string; | ||
} | ||
|
||
export interface License { | ||
/** The license name used for the API. */ | ||
name: string; | ||
|
||
/** A URL to the license used for the API. MUST be in the format of a URL. */ | ||
url?: string; | ||
} |
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