Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix upper/lower case for codegen. #1090

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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