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
Describe the bug
Spring Data REST allows you to define an excerpt projection for an entity. Adding this will automatically embed this projection whenever the entity is shown as part of a parent collection.
From the docs:
(...) The preceding example directs Spring Data REST to use the NoAddresses projection when embedding Person resources into collections or related resources.
It looks like this excerpt projection functionality is not (correctly) covered by Spring Doc because the embed is not showing up in the generated OpenAPI spec.
I'm having a similar use-case where I want to use Spring Data Rest to provide the standard CRUD endpoints. I do not have the answer to OP, but want to voice my journey so far since it is the same use-case.
Additional to the standard out-of-the-box configuration of SDR, in order to minimize http calls, I want to use Excerpts and Projections, as mentioned in OP, to return more data than is strictly REST in these endpoints. Unfortunately I encountered the same problem that these Projections are not represented in the resulting OpenAPI spec.
Unfortunately, my mind slowly implodes with my attempts to make sense of its main resolve function comprising of 800 lines.
My current understanding is that this is a recursive function that is called for each property of an object, which is a yet rather superficial description of what it does. My attempts at overriding the methods all failed due to me not properly understanding how to add properties to the current Schema object.
Describe the bug
Spring Data REST allows you to define an excerpt projection for an entity. Adding this will automatically embed this projection whenever the entity is shown as part of a parent collection.
From the docs:
It looks like this excerpt projection functionality is not (correctly) covered by Spring Doc because the embed is not showing up in the generated OpenAPI spec.
To Reproduce
Steps to reproduce the behavior:
3.2.5
org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0
org.springdoc:springdoc-openapi-starter-webmvc-api:2.5.0
org.springdoc:springdoc-openapi-starter-common:2.5.0
Reproducer project: https://github.com/janjouketjalsma/spring-doc-excerpt-projection-issue-reproducer
Current behaviour
Only the direct properties of the main entity end up in the spec.
Expected behavior
I expect the excerpt projection to be part of the spec for the main entity.
Example: (Bookstore is the main entity, Book is the one with the excerpt projection)
(or maybe with a
$ref
, not sure what would be the implementation)The text was updated successfully, but these errors were encountered: