I propose a feature for dynamic/contextual DTO configurations. This feature aims to address the following challenge: selectively exposing different data fields based on certain conditions (e.g., owners of a resource seeing private data, while other users see a restricted view of the same resource).
Context: A social media platform where users have both public and private information on their profiles.
Functionality: When a user views their own profile, they see all their information, including private data like email address and phone number. However, when another user views someone else's profile, the private information is omitted.
Dynamically determining which DTO configuration to use for each request might introduce a slight overhead, especially if the decision logic is complex. But it's optional, and up to the user to use it.
Generating accurate OpenAPI documentation that reflects different data views based on this multi-configuration scenario can be challenging.
A less complex solution would be allowing a callback for the exclude
and include
fields instead of the entire DTO, but seems like a band-aid solution. Throwing it here anyway.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too