FasterXML / FasterXML/jackson-module-jsonSchema

Long data type changed to integer

Abierto
#160 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
387
Forks
136
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This was mentioned in an older issue but I want to bring it up again: the JsonSchema generator does not differentiate between longs and ints. Both types end up as "integer" in the schema. It is said that when data is retrieved, it will be treated as long or int based on its size and that may be so. But when one examines the JsonSchema object, everything is "integer". You can see this from the code shown in the Readme for this package. [Here](https://github.com/ajr3-gen/long-jsonSchema/tree/main) is a very simple demonstration of it; generating a schema from an object with an `int`, a `long`, and a `Long` simply represents them all as "integer".

```
Mapped object: {
"type" : "object",
"id" : "urn:jsonschema:org:example:Demonstrator",
"properties" : {
"myId" : {
"type" : "string"
},
"myInteger" : {
"type" : "integer"
},
"myLongPrimitive" : {
"type" : "integer"
},
"myLongObject" : {
"type" : "integer"
}
}
}
```

Is there any way to preserve the original type information for the properties?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.