Generate json schema which should rejects all additional content
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the example through JsonSchemaGenerator.generateSchema(A.class) and ObjectSchema.rejectAdditionalProperties() with the shown A and B classes. Inspect the generated schema for both classes; done means additionalProperties is false for every generated class, including nested B.
Written by the indexing model from the issue text.
Description
Provide JSON schema generation where "additionalProperties" : false will be applied for all classes which I have.
Suppose I have following classes:
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.
ObjectMapper mapper = new ObjectMapper();
JsonSchemaGenerator schemaGen = new JsonSchemaGenerator(mapper);
ObjectSchema schema = schemaGen.generateSchema(A.class).asObjectSchema();
schema.rejectAdditionalProperties();
mapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema);
- Dominant language
- Java
- Stars
- 387
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FasterXML/jackson-module-jsonSchema
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
FasterXML/jackson-module-jsonSchema#160 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
pr-needed
Difficulty 3/5 1-2 days Newbie friendliness 30/100
FasterXML/jackson-module-jsonSchema#136 · 10 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
FasterXML/jackson-module-jsonSchema#135 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
FasterXML/jackson-module-jsonSchema#134 · 2 comments · 1 reaction ·
All issues in FasterXML/jackson-module-jsonSchema
Similar issues
-
status: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
spring-projects/spring-ai#7206 ·
Maintainers usually reply within 2 days
-
area/cli
Difficulty 2/5 Half a day Newbie friendliness 78/100
quarkusio/quarkus#57623 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jhipster/prettier-java#1113 ·
Maintainers usually reply within 2 days
-
bug follow-up lane:backlog
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Sanne/incus-spawn#1576 · 1 comment ·
Maintainers usually reply within 1 day
-
Pasting code into a comment adds imports for the pasted codePossibly taken @ravnskjaer claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
eclipse-jdt/eclipse.jdt.ui#3275 · 1 comment ·
Maintainers usually reply within 1 day