Swagger-codegen: [C#] Base64Encode does not exist in the current context

Created on 12 Mar 2016  路  3Comments  路  Source: swagger-api/swagger-codegen

Revision: 62fbcb9e8bec4a40569e51c7f316af85806628ee

I'm getting this error in generated csharp clients:

error CS0103: The name `Base64Encode' does not exist in the current context

The issue appears to be Base64Encode being called within a scope not including the method. I've fixed it by adding ApiClient. to all the call-sites. See https://github.com/DocRaptor/docraptor-csharp/commit/f2e33e6697f4fd02278e2f691cc684ea08a58dba. I'm not a C# programmer so I'm not entirely sure this is the right fix, but it does work for me :)

Anyhow, I see no way for this code to work as-is. It seems like we must be missing a test case for the HTTP authentication in C#.

C-Sharp Bug

Most helpful comment

@jqr I didn't have a chance to try to repeat it but from what you've reported it's a bug and we should have a test case to cover it for C#. I'll try to fix it as part of the user-agent change tomorrow (Sunday) if it's not too urgent.

All 3 comments

@jqr I didn't have a chance to try to repeat it but from what you've reported it's a bug and we should have a test case to cover it for C#. I'll try to fix it as part of the user-agent change tomorrow (Sunday) if it's not too urgent.

@jqr I could repeat the issue and have filed #2369 to fix it in C# API client.

I'll also need to review other API clients to ensure HTTP basic works as expected.

FYI. With the new test case for HTTP basic authentication, I've checked Java, Android, Ruby, Perl, PHP, Python, Swift, Objc and all test cases run fine without any compilation error.

For Javascript, all except one test case failed, which requires a manual update to the affected test case.

Was this page helpful?
0 / 5 - 0 ratings