FasterXML / FasterXML/jackson-module-jsonSchema

JsonIgnore issue

Open
#130 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
387
Forks
136
PR merge metrics
No merged PRs in 30d

Description

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.

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.