spring-projects / spring-projects/spring-data-rest

JSON schema has a field `requiredProperties` but this should be `required` per the JSON Schema spec

Open
#2,518 4 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Oct 20, 2025.

status: waiting-for-triage
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

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:

https://github.com/spring-projects/spring-data-rest/blob/66589c60a59273f8ab0ee6503761a26eddc31e5d/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JsonSchema.java#L210

See this page for the exact spec: https://json-schema.org/understanding-json-schema/reference/object#required .

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.