Skip to content

Commit

Permalink
fix: Fix upper/lower case for codegen. (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Oct 1, 2023
1 parent c318505 commit 7073b97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nextgen/codegen/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ pub fn upper_snake_case(value: &Value, _: &HashMap<String, Value>) -> Result<Val
}

pub fn lower_case(value: &Value, _: &HashMap<String, Value>) -> Result<Value> {
to_case("lower_case", Case::Lower, value)
let s = try_get_value!("lower_case", "value", String, value);

Ok(to_value(s.to_lowercase()).unwrap())
}

pub fn upper_case(value: &Value, _: &HashMap<String, Value>) -> Result<Value> {
to_case("upper_case", Case::Upper, value)
let s = try_get_value!("upper_case", "value", String, value);

Ok(to_value(s.to_uppercase()).unwrap())
}

// PATHS
Expand Down
1 change: 1 addition & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#### 🐞 Fixes

- Fixed some `PATH` inconsistencies when executing npm/pnpm/yarn binaries.
- Fixed codegen `lower_case` and `upper_case` stripping characters.

## 1.14.3

Expand Down

0 comments on commit 7073b97

Please sign in to comment.