-
-
Notifications
You must be signed in to change notification settings - Fork 528
Spring Data Rest: Relations to exported Repositories are handled as if they were embedded #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
Something isn't working
Comments
This was referenced Mar 16, 2021
Closed
Closed
Closed
This was referenced Mar 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When I create 2 entities A and B with a relation from A to B, the generated api doc describes the relation as B being embedded in A instead of modelling an href to another entity.
To Reproduce
Spring Boot: 2.4.3
Springdoc: 1.5.5
The generated api doc for
GET /pets/{id}
The
owner
property is not part of the response body of theGET
call but it is a link in the_links
section.For the
POST
call, we getIn this case, the
owner
property should be a String, not anOwner
.Expected behavior
In the
GET
-case, the model should not include any properties that are relationsIn the
POST
-case theowner
property should be a string, since the entity is references via href.Current Workaround
I found a workaround by adding
@Schema(implementation = String.class, accessMode = AccessMode.WRITE_ONLY)
to the relation property in the data model as follows, but I think the springdoc should do it right out of the box.The text was updated successfully, but these errors were encountered: