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

gRPC JSON transcoding documentation with Swagger / OpenAPI error #50177

Closed
1 task done
Varorbc opened this issue Aug 18, 2023 · 15 comments
Closed
1 task done

gRPC JSON transcoding documentation with Swagger / OpenAPI error #50177

Varorbc opened this issue Aug 18, 2023 · 15 comments
Assignees
Labels
area-grpc Includes: GRPC wire-up, templates NativeAOT Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity

Comments

@Varorbc
Copy link
Contributor

Varorbc commented Aug 18, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I followed the tutorial and enabled Aot, the program got an exception

image

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-grpc Includes: GRPC wire-up, templates label Aug 18, 2023
@ghost ghost added the NativeAOT label Aug 18, 2023
@adityamandaleeka
Copy link
Member

This sounds a lot like what @captainsafia fixed in #49393

@Varorbc
Copy link
Contributor Author

Varorbc commented Aug 24, 2023

The latest daily build still throws exceptions
image

@adityamandaleeka
Copy link
Member

@captainsafia can you take a look at this?

@captainsafia
Copy link
Member

@Varorbc Are you able to share a repro for this issue?

From the original details in your report, this error is expected because it appears that you have enabled PublishAoT in an app that uses System.Text.Json to serialize types but did not configure the JSON source generator correctly by defining a JsonSerializerContext as outlined here.

@captainsafia captainsafia added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Aug 26, 2023
@ghost
Copy link

ghost commented Aug 26, 2023

Hi @Varorbc. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Varorbc
Copy link
Contributor Author

Varorbc commented Aug 26, 2023

@captainsafia I followed the tutorial and enabled Aot

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Aug 26, 2023
@captainsafia
Copy link
Member

From the original details in your report, this error is expected because it appears that you have enabled PublishAoT in an app that uses System.Text.Json to serialize types but did not configure the JSON source generator correctly by defining a JsonSerializerContext as outlined here.

@Varorbc Do you repro the issue when you enable AoT without configuring the Swagger?

FYI, although you see Swagger UI middleware in the stacktrace, this is an artifact of the way the Swashbuckle is configured in the middleware pipeline and not exactly related to it.

The exception message you've shared with me leads me to believe that it's related to enabling AoT in your application and not having the STJ generator enabled in your project per the instructions above.

If you're able to upload a repro of your project to GitHub, that might also help.

@captainsafia captainsafia added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Aug 28, 2023
@ghost
Copy link

ghost commented Aug 28, 2023

Hi @Varorbc. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Varorbc
Copy link
Contributor Author

Varorbc commented Aug 29, 2023

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Aug 29, 2023
@adityamandaleeka
Copy link
Member

@Varorbc Can you please share that as a public GitHub repo? Per policy we don't open zips.

@Varorbc
Copy link
Contributor Author

Varorbc commented Aug 29, 2023

@adityamandaleeka I'm done

@adityamandaleeka
Copy link
Member

Thank you @Varorbc!

@captainsafia
Copy link
Member

Thanks, @Varorbc! It looks like you are running into domaindrivendev/Swashbuckle.AspNetCore#2550. The Swashbuckle.AspNetCore dependency doesn't support native AoT yet so you're running into issues with that.

Since this impacts the UI, you can try downloading the OpenAPI JSON definition and uploading it to a tool like Postman to interact with it visually.

@captainsafia captainsafia added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Sep 15, 2023
@ghost
Copy link

ghost commented Sep 15, 2023

Hi @Varorbc. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost
Copy link

ghost commented Sep 19, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Sep 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 23, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-grpc Includes: GRPC wire-up, templates NativeAOT Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity
Projects
None yet
Development

No branches or pull requests

3 participants