Skip to content

Commit

Permalink
Output x-state instead of x-technical-preview and x-available-since (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Oct 8, 2024
1 parent 7af8515 commit dbde402
Show file tree
Hide file tree
Showing 4 changed files with 851 additions and 1,052 deletions.
12 changes: 7 additions & 5 deletions compiler-rs/clients_schema_to_openapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,20 @@ pub fn availability_as_extensions(availabilities: &Option<Availabilities>) -> In
if let Some(avails) = availabilities {
// We may have several availabilities, but since generally exists only on stateful (stack)
for (_, availability) in avails {
if let Some(since) = &availability.since {
result.insert("x-available-since".to_string(), serde_json::Value::String(since.clone()));
}
if let Some(stability) = &availability.stability {
match stability {
Stability::Beta => {
result.insert("x-beta".to_string(), serde_json::Value::Bool(true));
}
Stability::Experimental => {
result.insert("x-technical-preview".to_string(), serde_json::Value::Bool(true));
result.insert("x-state".to_string(), serde_json::Value::String("Technical preview".to_string()));
}
Stability::Stable => {
if let Some(since) = &availability.since {
let stable_since = "Added in ".to_string() + since;
result.insert("x-state".to_string(), serde_json::Value::String(stable_since));
}
}
_ => {}
}
}
}
Expand Down
Binary file modified compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
Binary file not shown.
Loading

0 comments on commit dbde402

Please sign in to comment.