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 摘要。