You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON schema has a field requiredProperties but this should be required per the JSON Schema spec #2518
As the title says, when generating a JSON schema from a Spring Boot application with Spring Data REST the resulting schema contains a field requiredProperties with all non-nullable fields. This field should be named required instead. The field is defined here:
I also found this issue that mentions a requiredProperties field, perhaps that might be related / have caused some confusion.
For extra context, I generated the JSON schema like this (for a companies repo): curl --header 'Accept: application/schema+json' http://localhost:8080/api/v1/profile/companies
Can someone point me to the current state of affairs in JSON Schema? Did we do this wrong from the start, or has anything changed in JSON Schema since we originally shipped this?
I also checked the history in between 2015 and now, but I haven't found any mention of a requiredProperties field other than the one proposed in the issue I linked earlier.
My opinion is that we should just rename the field (and maybe keep the old field with an alias?). It would break the serialized output, i.e. change the JSON output. But now it just doesn't work. In my use-case I wanted to use the JSON schema with https://quicktype.io/ to generate TypeScript interfaces for my frontend code, currently that just throws an error because the JSON schema from Spring is not a correct JSON schema.
Hi, I’m new to contributing to Spring projects and I’d like to work on this issue as my first contribution.
I’ve built the project successfully locally and I’m starting to look into the existing JsonSchema implementation and tests.
Would this issue be suitable for a contribution, and is the expected change to rename/serialize requiredProperties as required, or is there additional compatibility context I should consider before implementing it?
Activity
oTAETAEo commentedon Jan 9, 2026
Hi @odrotbohm,
I’d like to work on this issue. I’ve confirmed the problem and identified the
change in JsonSchema.java.
Proposed Change
Rename the field from requiredProperties to required (three occurrences).
Questions
spec-compliance fix, or would you prefer a deprecation phase?
@JsonProperty is needed—please confirm.
covered?
If that looks good, I can proceed with a PR.
Thanks!
odrotbohm commentedon Jan 15, 2026
Can someone point me to the current state of affairs in JSON Schema? Did we do this wrong from the start, or has anything changed in JSON Schema since we originally shipped this?
lion7 commentedon Jan 24, 2026
As far as I can tell, this was wrongly done from the start. This is the very first commit on the JSON schema repo, it looks like it always was just
required: https://github.com/json-schema-org/json-schema-spec/blob/314b5c3040c5af13f838165189df3e0585b35a26/schema.json#L92I also checked the history in between 2015 and now, but I haven't found any mention of a
requiredPropertiesfield other than the one proposed in the issue I linked earlier.My opinion is that we should just rename the field (and maybe keep the old field with an alias?). It would break the serialized output, i.e. change the JSON output. But now it just doesn't work. In my use-case I wanted to use the JSON schema with https://quicktype.io/ to generate TypeScript interfaces for my frontend code, currently that just throws an error because the JSON schema from Spring is not a correct JSON schema.
Davidlazer18 commentedon Sep 16, 2026
Hi, I’m new to contributing to Spring projects and I’d like to work on this issue as my first contribution.
I’ve built the project successfully locally and I’m starting to look into the existing
JsonSchemaimplementation and tests.Would this issue be suitable for a contribution, and is the expected change to rename/serialize
requiredPropertiesasrequired, or is there additional compatibility context I should consider before implementing it?