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

GenerateDto and ManualTest no longer 100% compatible with current V4 API #38

Open
alanmartello opened this issue Jul 20, 2023 · 1 comment

Comments

@alanmartello
Copy link

alanmartello commented Jul 20, 2023

First, your TVDBApi V4 library is by far the cleanest and easiest to use; other OpenAPI to C# generators make a real mess out of the generated code.

As of 20 July 2023 using Visual Studio 2023 (free version) and dotnet6, GenerateDto and ManualTest are no longer compatible with the current swagger 4.7.5 documentation. In particular

(a) in CodeBuilder.cs MethodNameMap I added the following items (not sure if these are correct or not, but got it to run)
{ "getAllEpisodes", "Episodes" },
{ "getAllPeople", "People" },
{ "getListBySlug", "List" },
{ "getMovieBaseBySlug", "Movie" },
{ "getSearchResultsByRemoteId", "SearchRemote" },
{ "getSeriesBaseBySlug", "Series" },
{ "getSeriesNextAired", "SeriesNextAired" },
{ "getUserInfo", "UserInfo" },
{ "getUserInfoById", "UserInfo" },

(b) in CodeBuilder.cs comment out the following items in Dictionary (no longer needed because they're correctly handled by the yml I think)
EpisodeExtendedRecordDto
MovieExtendedRecordDto
PeopleExtendedRecordDto
SeriesExtendedRecordDto

(c) the UserInfo schema is not being generated correctly for the "/user" and "/user/{id}" API calls. The problem can be seen at line 70 of Program.cs in GenerateDto if you set a breakpoint when path == "/user" then returnType is left set to "unknown".

(d) the generated TvDbClientGenerated.cs had to be modified as follows:
changed "boolean" to "bool" in a few places (they are obvious, it won't build)

(e) comment out the following tests which won't run in ManualTests Program.cs
Test("ListExtended(6007)", await client.ListExtended(6007));
Test("Search(Query = stargate)", await client.Search(new SearchOptionalParams { Query = "stargate" }));
Test("SeasonTranslation(530667, 'eng')", await client.SeasonTranslation(530667, "eng"));
... obviously there were no tests for /user and any other new API's which would not have run correctly.

None of this is holding up my work for what I need, I just thought that you may find my 6 hours of debugging helpful if/when you next open up the project.

Again, thanks for a tremendously helpful and well written project!

@HristoKolev
Copy link
Owner

Hi @alanmartello for spending the time. Unfortunately currently I don't have the time to support this project and I don't know when I will. I haven't needed it since 2016 and It's hard for me to justify the time when I have other priorities. I don't have any intention to abandon the project. I will get back to it at some point and will use what you've learned debugging the API.

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

No branches or pull requests

2 participants