File tree Expand file tree Collapse file tree 3 files changed +3309
-557
lines changed
compiler-rs/clients_schema_to_openapi/src Expand file tree Collapse file tree 3 files changed +3309
-557
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
156156 // We may have several availabilities, but since generally exists only on stateful (stack)
157157 for ( _, availability) in avails {
158158 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+ }
159163 match stability {
160164 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) ) ;
162167 }
163168 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) ) ;
165171 }
166172 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) ) ;
171175 }
172176 }
173177 }
You can’t perform that action at this time.
0 commit comments