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

update-json #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "A package for keeping your encoders and decoders in sync."

[dependencies]
gleam_stdlib = "~> 0.31"
gleam_json = "~> 1.0"
gleam_json = ">= 2.0.0 and < 3.0.0"

[dev-dependencies]
gleeunit = "~> 1.0"
9 changes: 4 additions & 5 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_json", version = "0.7.0", build_tools = ["gleam"], requirements = ["thoas", "gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "CB405BD93A8828BCD870463DE29375E7B2D252D9D124C109E5B618AAC00B86FC" },
{ name = "gleam_stdlib", version = "0.35.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "5443EEB74708454B65650FEBBB1EF5175057D1DEC62AEA9D7C6D96F41DA79152" },
{ name = "gleeunit", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D364C87AFEB26BDB4FB8A5ABDE67D635DC9FA52D6AB68416044C35B096C6882D" },
{ name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" },
{ name = "gleam_json", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "0A57FB5666E695FD2BEE74C0428A98B0FC11A395D2C7B4CDF5E22C5DD32C74C6" },
{ name = "gleam_stdlib", version = "0.49.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "A7DB09F15738198A87255425FBCE049B4B84C77CC522786DC923DABA73911F13" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
]

[requirements]
gleam_json = { version = "~> 0.5" }
gleam_json = { version = ">= 2.0.0 and < 3.0.0" }
gleam_stdlib = { version = "~> 0.31" }
gleeunit = { version = "~> 1.0" }
8 changes: 4 additions & 4 deletions src/gleam_community/codec.gleam
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// IMPORTS ---------------------------------------------------------------------

import gleam/dict.{type Dict}
import gleam/dynamic.{
type DecodeError as DynamicError, type Dynamic, DecodeError as DynamicError,
}
import gleam/function
import gleam/int
import gleam/json.{type DecodeError as JsonError, type Json}
import gleam/list
import gleam/dict.{type Dict}
import gleam/option.{type Option}
import gleam/pair
import gleam/result
import gleam/string_builder.{type StringBuilder}
import gleam/int
import gleam/string_tree.{type StringTree}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using gleam/string_tree means we need to bump our gleam_stdlib constraint to at least 0.42.0


// TYPES -----------------------------------------------------------------------

Expand Down Expand Up @@ -567,7 +567,7 @@ pub fn encode_string(value: a, codec: Codec(a)) -> String {

///
///
pub fn encode_string_custom_from(value: a, codec: Codec(a)) -> StringBuilder {
pub fn encode_string_custom_from(value: a, codec: Codec(a)) -> StringTree {
codec.encode(value)
|> json.to_string_builder
}
Expand Down
Loading