FasterXML / FasterXML/jackson-module-jsonSchema

JsonIgnore issue

Aperta
#130 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
387
Fork
136
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I have an issue where I am trying to produce a schema for an object that has a password field. Obviously the field should be write-only and never be be serialised so it is marked as such in the entity but when I try to create the schema the field is omitted completely.

I have tried all of the following but they all result in the same outcome, no password field in the schema.

```java
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String password;
```
```java
@JsonIgnoreProperties(value="password", allowSetters = true)
class User {
private String password;
}
```
```java
class User {
@JsonIgnore
private String password;

@JsonIgnore
public String getPassword() {
return password;
}

@JsonProperty
public void setPassword(String password) {
this.password = password;
}
}
```
I think that from a schema perspective the field should be defined as it is write-only and and clients of the service will need to send the field under different circumstances. I'm guessing this has something to do with the underlying use of jackson databind module but can you give any advice on how to achieve the desired outcome?

Thanks, Andy.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.