Skip to content
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

Support OpenApi Schema Service in CommunityToolkit.Datasync.Server.OpenApi #266

Open
adrianhall opened this issue Feb 10, 2025 · 0 comments
Labels
Server Improvements or additions to the server code
Milestone

Comments

@adrianhall
Copy link
Collaborator

In .NET 9, we can't inject the entity schema into the OpenApi definition when using the new .NET9 AddOpenApi / MapOpenApi.

This is because:

  • OpenApiSchemaService is internal sealed and in a different assmebly (preventing reflection)
  • We cannot add a [Consumes<T>] or [ProducesResponseType<T>] to the controller method (since TableController is generic)

In Swashbuckle and NSwag, we generate the schema for the entity type, but this is not possible in .NET 9 OpenApi.

Once Microsoft.AspNetCore.OpenApi allows us to inject schema (or C# allows us to add attributes based on a generic type), we can add such functionality to the OpenApi transformers.

@adrianhall adrianhall added the Server Improvements or additions to the server code label Feb 10, 2025
@adrianhall adrianhall added this to the 10.0.0 milestone Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Server Improvements or additions to the server code
Projects
None yet
Development

No branches or pull requests

1 participant