Skip to content

Commit 4960f8b

Browse files
committed
docs: document security scheme fields
1 parent 8c8441e commit 4960f8b

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

crates/oas3/src/spec/security_scheme.rs

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,61 +16,86 @@ use super::Flows;
1616
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
1717
#[serde(tag = "type")]
1818
pub enum SecurityScheme {
19+
/// API key authentication.
1920
#[serde(rename = "apiKey")]
2021
ApiKey {
21-
/// A description for security scheme.
22+
/// Description for security scheme.
2223
///
23-
/// CommonMark syntax MAY be used for rich text representation.
24+
/// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text
25+
/// representation.
2426
#[serde(skip_serializing_if = "Option::is_none")]
2527
description: Option<String>,
2628

29+
/// The name of the header, query or cookie parameter to be used.
2730
name: String,
2831

32+
/// The location of the API key. Valid values are `"query"`, `"header"`, or `"cookie"`.
2933
#[serde(rename = "in")]
3034
location: String,
3135
},
3236

37+
/// HTTP authentication.
3338
#[serde(rename = "http")]
3439
Http {
35-
/// A description for security scheme.
40+
/// Description for security scheme.
3641
///
37-
/// CommonMark syntax MAY be used for rich text representation.
42+
/// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text
43+
/// representation.
3844
#[serde(skip_serializing_if = "Option::is_none")]
3945
description: Option<String>,
4046

47+
/// Name of the HTTP Authorization scheme to be used in the Authorization header as defined
48+
/// in RFC 7235.
49+
///
50+
/// The values used SHOULD be registered in the IANA Authentication Scheme registry.
4151
scheme: String,
52+
53+
/// A hint to the client to identify how the bearer token is formatted.
54+
///
55+
/// Bearer tokens are usually generated by an authorization server, so this information is
56+
/// primarily for documentation purposes.
4257
#[serde(rename = "bearerFormat")]
4358
bearer_format: Option<String>,
4459
},
4560

61+
/// OAuth2 authentication.
4662
#[serde(rename = "oauth2")]
4763
OAuth2 {
48-
/// A description for security scheme.
64+
/// Description for security scheme.
4965
///
50-
/// CommonMark syntax MAY be used for rich text representation.
66+
/// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text
67+
/// representation.
5168
#[serde(skip_serializing_if = "Option::is_none")]
5269
description: Option<String>,
5370

71+
/// An object containing configuration information for the flow types supported.
5472
flows: Flows,
5573
},
5674

75+
/// OpenID Connect authentication.
5776
#[serde(rename = "openIdConnect")]
5877
OpenIdConnect {
59-
/// A description for security scheme.
78+
/// Description for security scheme.
6079
///
61-
/// CommonMark syntax MAY be used for rich text representation.
80+
/// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text
81+
/// representation.
6282
#[serde(skip_serializing_if = "Option::is_none")]
6383
description: Option<String>,
6484

85+
/// OpenID Connect URL to discover OAuth2 configuration values.
86+
///
87+
/// The OpenID Connect standard requires the use of TLS.
6588
#[serde(rename = "openIdConnectUrl")]
6689
open_id_connect_url: String,
6790
},
6891

92+
/// Mutual TLS authentication.
6993
#[serde(rename = "mutualTLS")]
7094
MutualTls {
71-
/// A description for security scheme.
95+
/// Description for security scheme.
7296
///
73-
/// CommonMark syntax MAY be used for rich text representation.
97+
/// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text
98+
/// representation.
7499
#[serde(skip_serializing_if = "Option::is_none")]
75100
description: Option<String>,
76101
},

0 commit comments

Comments
 (0)