4
4
//! security spec](https://swagger.io/docs/specification/authentication/).
5
5
6
6
use crate :: Extension ;
7
+ use indexmap:: IndexMap ;
7
8
use serde:: { Deserialize , Serialize } ;
8
9
use serde_json:: Value ;
9
- use std:: collections:: HashMap ;
10
10
11
11
/// The authentication extension fields.
12
12
#[ derive( Debug , Serialize , Deserialize ) ]
13
13
pub struct Authentication {
14
14
/// A property that contains all of the [scheme definitions](Scheme) used by
15
15
/// [Assets](stac::Asset) and [Links](stac::Link) in the STAC [Item](crate::Item) or [Collection](crate::Collection).
16
- #[ serde( default , skip_serializing_if = "HashMap ::is_empty" ) ]
17
- pub schemes : HashMap < String , Scheme > ,
16
+ #[ serde( default , skip_serializing_if = "IndexMap ::is_empty" ) ]
17
+ pub schemes : IndexMap < String , Scheme > ,
18
18
19
19
/// A property that specifies which schemes may be used to access an [Asset](stac::Asset)
20
20
/// or [Link](stac::Link).
@@ -60,8 +60,8 @@ pub struct Scheme {
60
60
/// OAuth flows: `authorizationCode` | `implicit` | `password` |
61
61
/// `clientCredentials`. The OAuth2 Flow Object applies for oauth2, the
62
62
/// Signed URL Object applies to signedUrl.
63
- #[ serde( skip_serializing_if = "HashMap ::is_empty" , default ) ]
64
- pub flows : HashMap < String , Flow > ,
63
+ #[ serde( skip_serializing_if = "IndexMap ::is_empty" , default ) ]
64
+ pub flows : IndexMap < String , Flow > ,
65
65
66
66
/// OpenID Connect URL to discover OpenID configuration values.
67
67
///
@@ -94,7 +94,7 @@ pub enum Flow {
94
94
/// The available scopes for the authentication scheme.
95
95
///
96
96
/// A map between the scope name and a short description for it. The map MAY be empty.
97
- scopes : HashMap < String , String > ,
97
+ scopes : IndexMap < String , String > ,
98
98
99
99
/// The URL to be used for obtaining refresh tokens.
100
100
///
@@ -115,8 +115,8 @@ pub enum Flow {
115
115
authorization_api : Option < String > ,
116
116
117
117
/// Parameter definition for requests to the authorizationApi
118
- #[ serde( skip_serializing_if = "HashMap ::is_empty" ) ]
119
- parameters : HashMap < String , Parameter > ,
118
+ #[ serde( skip_serializing_if = "IndexMap ::is_empty" ) ]
119
+ parameters : IndexMap < String , Parameter > ,
120
120
121
121
/// Key name for the signed URL field in an authorizationApi response
122
122
#[ serde( skip_serializing_if = "Option::is_none" , rename = "responseField" ) ]
@@ -138,7 +138,7 @@ pub struct Parameter {
138
138
pub description : Option < String > ,
139
139
140
140
/// Schema object following the [JSON Schema draft-07](Schema object following the JSON Schema draft-07).
141
- pub schema : HashMap < String , Value > ,
141
+ pub schema : IndexMap < String , Value > ,
142
142
}
143
143
144
144
/// Query, header, or cookie.
0 commit comments