Represents a JSON number stored as a String to preserve exact representation.
Attributes
- Companion
- object
- Source
- Json.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Jsonclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Narrows this JSON value to the specified type, returning Some if the types match or None otherwise. The return type is path-dependent on the jsonType parameter.
Narrows this JSON value to the specified type, returning Some if the types match or None otherwise. The return type is path-dependent on the jsonType parameter.
Attributes
- Example
-
json.as(JsonType.Object) // Option[Json.Object] json.as(JsonType.String) // Option[Json.String] - Definition Classes
- Source
- Json.scala
Compares this JSON value with another for ordering. Objects are compared as sorted key-value pairs (order-independent).
Compares this JSON value with another for ordering. Objects are compared as sorted key-value pairs (order-independent).
Attributes
- Definition Classes
- Source
- Json.scala
Returns the JsonType of this JSON value.
Returns the type index for ordering: Null=0, Boolean=1, Number=2, String=3, Array=4, Object=5
Returns the type index for ordering: Null=0, Boolean=1, Number=2, String=3, Array=4, Object=5
Attributes
- Definition Classes
- Source
- Json.scala
Extracts the underlying value from this JSON if it matches the specified type. The return type is path-dependent on the jsonType parameter.
Extracts the underlying value from this JSON if it matches the specified type. The return type is path-dependent on the jsonType parameter.
Attributes
- Example
-
json.unwrap(JsonType.String) // Option[String] json.unwrap(JsonType.Number) // Option[BigDecimal] json.unwrap(JsonType.Object) // Option[Chunk[(String, Json)]] - Definition Classes
- Source
- Json.scala
Inherited methods
Decodes this JSON value to a value of type A using the implicit JsonDecoder.
Decodes this JSON value to a value of type A using the implicit JsonDecoder.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Decodes this JSON value to a value of type A, throwing SchemaError on failure.
Decodes this JSON value to a value of type A, throwing SchemaError on failure.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Checks if this JSON conforms to a JSON Schema.
Returns true if this JSON conforms to a JSON Schema.
Returns true if this JSON conforms to a JSON Schema.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Deletes the value at the given path. If the path doesn't exist, returns the original JSON unchanged.
Deletes the value at the given path. If the path doesn't exist, returns the original JSON unchanged.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Deletes the value at the given path. Returns Left with an error if the path doesn't exist.
Deletes the value at the given path. Returns Left with an error if the path doesn't exist.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Computes the difference between this JSON and another.
Computes the difference between this JSON and another.
Value parameters
- that
-
The target JSON value
Attributes
- Returns
-
A JsonPatch that transforms this to that
- Inherited from:
- Json
- Source
- Json.scala
Recursively removes empty objects and arrays.
Recursively removes all null values from objects.
Returns the elements if this is an array, otherwise an empty Chunk.
Returns the elements if this is an array, otherwise an empty Chunk.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Returns the fields if this is an object, otherwise an empty Chunk.
Returns the fields if this is an object, otherwise an empty Chunk.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Folds over the JSON structure top-down. The function receives the current path, the JSON value, and the accumulator. Parent values are folded before their children.
Folds over the JSON structure top-down. The function receives the current path, the JSON value, and the accumulator. Parent values are folded before their children.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Folds over the JSON structure top-down, allowing failure.
Folds over the JSON structure top-down, allowing failure.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Folds over the JSON structure bottom-up. The function receives the current path, the JSON value, and the accumulator. Child values are folded before their parents.
Folds over the JSON structure bottom-up. The function receives the current path, the JSON value, and the accumulator. Child values are folded before their parents.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Folds over the JSON structure bottom-up, allowing failure.
Folds over the JSON structure bottom-up, allowing failure.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Navigates to the value(s) at the given path. Returns a JsonSelection that may contain zero or more values.
Navigates to the value(s) at the given path. Returns a JsonSelection that may contain zero or more values.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Navigates to an element in an array by index. Returns a JsonSelection containing the value, or an error if index is out of bounds.
Navigates to an element in an array by index. Returns a JsonSelection containing the value, or an error if index is out of bounds.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Navigates to a field in an object by key. Returns a JsonSelection containing the value, or an error if not found.
Navigates to a field in an object by key. Returns a JsonSelection containing the value, or an error if not found.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Inserts a value at the given path. For arrays, inserts at the specified index. For objects, adds the field. If the path already exists, returns the original JSON unchanged.
Inserts a value at the given path. For arrays, inserts at the specified index. For objects, adds the field. If the path already exists, returns the original JSON unchanged.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Inserts a value at the given path. Returns Left with an error if the path already exists or the parent doesn't exist.
Inserts a value at the given path. Returns Left with an error if the path already exists or the parent doesn't exist.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Returns true if this JSON value is of the specified type.
Returns true if this JSON value is of the specified type.
Attributes
- Example
-
json.is(JsonType.Object) // true if json is an object json.is(JsonType.String) // true if json is a string - Inherited from:
- Json
- Source
- Json.scala
Merges this JSON value with another using the specified strategy.
Merges this JSON value with another using the specified strategy.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Modifies the value at the given path using a function. If the path doesn't exist, returns the original JSON unchanged.
Modifies the value at the given path using a function. If the path doesn't exist, returns the original JSON unchanged.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Modifies the value at the given path using a partial function. Returns Left with an error if the path doesn't exist or the partial function is not defined.
Modifies the value at the given path using a partial function. Returns Left with an error if the path doesn't exist or the partial function is not defined.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Applies dropNulls, dropEmpty, and sortKeys, but more efficiently than just their calls in a sequence.
Applies dropNulls, dropEmpty, and sortKeys, but more efficiently than just their calls in a sequence.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Partitions elements/fields based on a predicate on the value. Returns a tuple of (matching, non-matching) JSON values.
Partitions elements/fields based on a predicate on the value. Returns a tuple of (matching, non-matching) JSON values.
Attributes
- Example
-
json.partition(_.is(JsonType.Number)) // (numbers, non-numbers) - Inherited from:
- Json
- Source
- Json.scala
Partitions elements/fields based on a predicate on both path and value. Returns a tuple of (matching, non-matching) JSON values.
Partitions elements/fields based on a predicate on both path and value. Returns a tuple of (matching, non-matching) JSON values.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Partitions elements/fields based on a predicate on the path. Returns a tuple of (matching, non-matching) JSON values.
Partitions elements/fields based on a predicate on the path. Returns a tuple of (matching, non-matching) JSON values.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Applies a JSON patch to this value.
Applies a JSON patch to this value.
Value parameters
- mode
-
The patch mode controlling failure handling (default: Strict)
- patch
-
The patch to apply
Attributes
- Returns
-
Either an error or the patched value
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value to a string using the specified WriterConfig.
Prints this JSON value to a string using the specified WriterConfig.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value to a string using the default WriterConfig.
Prints this JSON value to a string using the default WriterConfig.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value to a byte array with the specified config.
Prints this JSON value to a byte array with the specified config.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value to a byte array.
Prints this JSON value to a Chunk of bytes (UTF-8) with configuration.
Prints this JSON value to a Chunk of bytes (UTF-8) with configuration.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value to a Chunk of bytes (UTF-8).
Prints this JSON value to a Chunk of bytes (UTF-8).
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value into the provided ByteBuffer with config.
Prints this JSON value into the provided ByteBuffer with config.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Prints this JSON value into the provided ByteBuffer.
Prints this JSON value into the provided ByteBuffer.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala
Projects only the specified paths from this JSON value. Creates a new JSON containing only values at the given paths.
Projects only the specified paths from this JSON value. Creates a new JSON containing only values at the given paths.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Recursively removes elements/fields for which the predicate returns true.
Recursively removes elements/fields for which the predicate returns true.
Attributes
- Example
-
json.prune(_.is(JsonType.Null)) // removes all null values - Inherited from:
- Json
- Source
- Json.scala
Recursively removes elements/fields for which the predicate on both path and value returns true.
Recursively removes elements/fields for which the predicate on both path and value returns true.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Recursively removes elements/fields at paths for which the predicate returns true.
Recursively removes elements/fields at paths for which the predicate returns true.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Recursively keeps only elements/fields for which the predicate returns true.
Recursively keeps only elements/fields for which the predicate returns true.
Attributes
- Example
-
json.retain(_.is(JsonType.Number)) // keeps only numbers - Inherited from:
- Json
- Source
- Json.scala
Recursively keeps only elements/fields for which the predicate on both path and value returns true.
Recursively keeps only elements/fields for which the predicate on both path and value returns true.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Recursively keeps only elements/fields at paths for which the predicate returns true.
Recursively keeps only elements/fields at paths for which the predicate returns true.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Wraps this JSON value in a JsonSelection if its type matches the specified JsonType, otherwise returns an empty selection.
Wraps this JSON value in a JsonSelection if its type matches the specified JsonType, otherwise returns an empty selection.
This is a flat (non-recursive) type check on the current node only.
Attributes
- Example
-
json.select(JsonType.Object) // selection if json is object, else empty - Inherited from:
- Json
- Source
- Json.scala
Wraps this JSON value in a JsonSelection.
Wraps this JSON value in a JsonSelection.
Attributes
- Example
-
json.select // JsonSelection containing this value - Inherited from:
- Json
- Source
- Json.scala
Sets a value at the given path. If the path doesn't exist, returns the original JSON unchanged.
Sets a value at the given path. If the path doesn't exist, returns the original JSON unchanged.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Sets a value at the given path. Returns Left with an error if the path doesn't exist.
Sets a value at the given path. Returns Left with an error if the path doesn't exist.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Recursively sorts all object keys alphabetically.
Converts this JSON value to a DynamicValue.
Converts this JSON to a Chunk of path-value pairs. Each pair contains the path to a leaf value and the value itself.
Converts this JSON to a Chunk of path-value pairs. Each pair contains the path to a leaf value and the value itself.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Pretty print Json value to string.
Pretty print Json value to string.
Attributes
- Definition Classes
-
Json -> Any
- Inherited from:
- Json
- Source
- Json.scala
Transforms this JSON value top-down using the given function. The function receives the current path and the JSON value at that path. Parent values are transformed before their children.
Transforms this JSON value top-down using the given function. The function receives the current path and the JSON value at that path. Parent values are transformed before their children.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Transforms all object keys using the given function. The function receives the current path and the key at that path.
Transforms all object keys using the given function. The function receives the current path and the key at that path.
Attributes
- Inherited from:
- Json
- Source
- Json.scala
Transforms this JSON value bottom-up using the given function. The function receives the current path and the JSON value at that path. Child values are transformed before their parents.
Transforms this JSON value bottom-up using the given function. The function receives the current path and the JSON value at that path. Child values are transformed before their parents.
Attributes
- Inherited from:
- Json
- Source
- Json.scala