FasterXML / FasterXML/jackson-databind

Unsigned integers

Open
#3,359 1 comment 5 reactions 0 assignees View on GitHub
most-wanted
Dominant language
Java
Stars
3.7k
Forks
1.5k
Avg merge
3d 6h
Merged PRs (30d)
28

Description

**Is your feature request related to a problem? Please describe.**
There is no clear and efficient way to exchange JSON and CBOR with other programming languages when those other programming languages use unsigned integer fields.

**Describe the solution you'd like**
Would it be possible to have an annotation on integer fields and fields holding integer arrays that would cause Jackson to treat them as unsigned numbers?

**Usage example**
```java
@JsonUnsigned int field;
@JsonUnsigned long[] data;
```

**Additional context**
Java has unsigned arithmetic since Java 8. See for example [Long.parseUnsignedLong()](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Long.html#parseUnsignedLong(java.lang.String)). CBOR has built-in support for unsigned integers. Byte arrays frequently contain 8-bit unsigned values.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.