File tree Expand file tree Collapse file tree 3 files changed +1533
-1220
lines changed
compiler-rs/clients_schema_to_openapi/src Expand file tree Collapse file tree 3 files changed +1533
-1220
lines changed Original file line number Diff line number Diff line change @@ -156,18 +156,22 @@ pub fn availability_as_extensions(availabilities: &Option<Availabilities>) -> In
156
156
// We may have several availabilities, but since generally exists only on stateful (stack)
157
157
for ( _, availability) in avails {
158
158
if let Some ( stability) = & availability. stability {
159
+ let mut since_str = "" . to_string ( ) ;
160
+ if let Some ( since) = & availability. since {
161
+ since_str = "; Added in " . to_string ( ) + since;
162
+ }
159
163
match stability {
160
164
Stability :: Beta => {
161
- result. insert ( "x-beta" . to_string ( ) , serde_json:: Value :: Bool ( true ) ) ;
165
+ let beta_since = "Beta" . to_string ( ) + & since_str;
166
+ result. insert ( "x-state" . to_string ( ) , serde_json:: Value :: String ( beta_since) ) ;
162
167
}
163
168
Stability :: Experimental => {
164
- result. insert ( "x-state" . to_string ( ) , serde_json:: Value :: String ( "Technical preview" . to_string ( ) ) ) ;
169
+ let exp_since = "Technical preview" . to_string ( ) + & since_str;
170
+ result. insert ( "x-state" . to_string ( ) , serde_json:: Value :: String ( exp_since) ) ;
165
171
}
166
172
Stability :: Stable => {
167
- if let Some ( since) = & availability. since {
168
- let stable_since = "Added in " . to_string ( ) + since;
169
- result. insert ( "x-state" . to_string ( ) , serde_json:: Value :: String ( stable_since) ) ;
170
- }
173
+ let stable_since = "Generally available" . to_string ( ) + & since_str;
174
+ result. insert ( "x-state" . to_string ( ) , serde_json:: Value :: String ( stable_since) ) ;
171
175
}
172
176
}
173
177
}
You can’t perform that action at this time.
0 commit comments