spring-projects / spring-projects/spring-data-rest
Wrong property type in JSON Schema for lists with a @DBRef annotation [DATAREST-1096]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Marc Mannig opened DATAREST-1096 and commented
We found a confusing problem with the returned JSON Schema in combination with the mongoDB @DBRef annotation and lists. List of objects which are embedded in the document are correctly described by the JSON Schema i get from /profile/theresource. But if i want to store the objects in a different mongoDB collection and simply add @DBRef to my list in the root object, the JSON Schema returns "string" instead "array" as type for the list property.
You can find a simple example with unittests which describes the problem under:
https://bitbucket.org/martinschueller/data-mongo-rest-test
(No DB needed)
The last test "shouldAlsoRetrieveTypeArrayWithDefinition" failed, because of the wrong type.
The problem occurred with all springboot versions
Affects: 3.0 M4 (Kay)
Reference URL: https://bitbucket.org/martinschueller/data-mongo-rest-test
2 votes, 5 watchers
Contributor guide
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.
Assessment
This issue has not been assessed yet.