FasterXML / FasterXML/jackson-module-jsonSchema
Generate json schema which should rejects all additional content
- 主要言語
- Java
- スター
- 387
- フォーク
- 136
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Provide JSON schema generation where "additionalProperties" : false will be applied for all classes which I have.
Suppose I have following classes:
```java
class A{
private String s;
private B b;
public String getS() {
return s;
}
public B getB() {
return b;
}
}
class B{
private BigDecimal bd;
public BigDecimal getBd() {
return bd;
}
}
```
Generating schema as following like below code the schema property "additionalProperties" : false was applying only for the class A.
```java
ObjectMapper mapper = new ObjectMapper();
JsonSchemaGenerator schemaGen = new JsonSchemaGenerator(mapper);
ObjectSchema schema = schemaGen.generateSchema(A.class).asObjectSchema();
schema.rejectAdditionalProperties();
mapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema);
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。