FasterXML / FasterXML/jackson-annotations

Rename ambiguous `JsonProperty.Access.*` constants

Abierto
#233 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
1.1k
Forks
342
Merge medio
8 h 53 min
PR fusionados (30 d)
2

Descripción

I'd like to request a rather trivial change, however it is API-breaking, so I fully understand this can only be done for the next major version:

Today, I got confused by `@JsonProperty(value = "...", access = JsonProperty.Access.WRITE_ONLY)`. I'm in a context, where I _read from_ and _write to_ a json file. So "write" means "serialize" and "read" means "deserialize" in my context.

However, the above constants `WRITE_ONLY` and `READ_ONLY` are named from the object mapper's perspective writing values to the java object ("setting") or reading values from java objects ("getting").

In other words: The constant names are highly dependent from the perspective, to say the least. Therefore I'm suggesting to rename them as follows:

| old | new |
|------------|------------------|
| `AUTO` | `AUTO` |
| `READ_ONLY` | `SERIALIZE_ONLY` |
| `WRITE_ONLY` | `DESERIALIZE_ONLY` |
| `READ_WRITE` | `ANY` |

(Jackson 2.15.2)

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.