FasterXML / FasterXML/jackson-module-jsonSchema

JsonIgnore issue

未关闭
#130 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
387
派生
136
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。