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

Reveal more generation errors (Test only) #18

Merged
merged 1 commit into from
May 27, 2024
Merged

Reveal more generation errors (Test only) #18

merged 1 commit into from
May 27, 2024

Conversation

Tyler-IN
Copy link
Contributor

This PR adds OpenApiGenerator_GenerateMethods and OpenApiGenerator_GenerateConstructors properties to OpenApiGenerator.IntegrationTests.Twitch.Data.csproj to reveal other generation errors.

…structors to OpenApiGenerator.IntegrationTests.Twitch.Data.csproj to reveal other generation errors
@HavenDV HavenDV merged commit 6ac61b5 into tryAGI:main May 27, 2024
1 check passed
@Tyler-IN
Copy link
Contributor Author

Tyler-IN commented May 27, 2024

Looks like setting <OpenApiGenerator_JsonSerializerContext> to non-empty can cause issues, but that might be intended behavior for that project style.

e.g. rename SourceGenerationContext to TwitchSourceGenerationContext

Might be misinterpretation of how to do it correctly. Looks good otherwise! 👍

@HavenDV
Copy link
Collaborator

HavenDV commented May 27, 2024

In order for Trimming to work correctly, you need to use two projects
Here are the instructions
https://github.com/HavenDV/OpenApiGenerator?tab=readme-ov-file#trimming-support
And here is an example of an sdk with trimming support - https://github.com/tryAGI/Ollama

@HavenDV
Copy link
Collaborator

HavenDV commented May 27, 2024

When you set OpenApiGenerator_JsonSerializerContext, it will try to pass the internal properties of this one, but this must be generated by another generator (which is part of System.Text.Json). Due to the fact that generators in dotnet cannot see each other's output, you need to use a workaround with the second project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants