-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[java/resttemplate] Generate valid code if no Authentication implementations present #2861
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
Conversation
…tations present Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods
@jonfreedman thanks for the PR. Look like the change will results in duplicated import --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java
@@ -59,12 +59,12 @@ import java.util.Map.Entry;
import java.util.TimeZone;
import org.openapitools.client.auth.Authentication;
-import org.openapitools.client.auth.HttpBasicAuth;
-import org.openapitools.client.auth.HttpBearerAuth;
+
+import org.openapitools.client.auth.ApiKeyAuth;
import org.openapitools.client.auth.ApiKeyAuth;
+import org.openapitools.client.auth.HttpBasicAuth;
import org.openapitools.client.auth.OAuth; |
Can you please check the population of the authentications map, if there's a duplicate import I guess there must be a duplicate put too? |
Yes, we have |
Yep I saw that one, but would also need hasBasicAuthMethods, hasTokenAuthMethods etc. which I assume don't exist yet? |
Can you please add hasBasicAuthMethods, hasTokenAuthMethods, etc as part of this PR? |
I can give it a go - can you point me in the right direction? |
Closing this as there's no update. Please open a new one when you've time. Thanks again for the PR. |
…nt (#5788) * generate valid code if no Authentication implementations present resurrects #2861 * remove what I assume are human generated test cases * need to iterate over authMethods in order to pull out name * fix another test * update more tests * rename hasTokenAuthMethods to hasApiKeyAuthMethods * remove duplicate methods, fix hasHttpBearerMethods check * update templates * update windows java-petstore files * update windows java-petstore files * re-generate * re-generate * restore samples.ci tests * restore samples.ci tests
…nt (#5788) * generate valid code if no Authentication implementations present resurrects OpenAPITools/openapi-generator#2861 * remove what I assume are human generated test cases * need to iterate over authMethods in order to pull out name * fix another test * update more tests * rename hasTokenAuthMethods to hasApiKeyAuthMethods * remove duplicate methods, fix hasHttpBearerMethods check * update templates * update windows java-petstore files * update windows java-petstore files * re-generate * re-generate * restore samples.ci tests * restore samples.ci tests
…nt (#5788) * generate valid code if no Authentication implementations present resurrects OpenAPITools/openapi-generator#2861 * remove what I assume are human generated test cases * need to iterate over authMethods in order to pull out name * fix another test * update more tests * rename hasTokenAuthMethods to hasApiKeyAuthMethods * remove duplicate methods, fix hasHttpBearerMethods check * update templates * update windows java-petstore files * update windows java-petstore files * re-generate * re-generate * restore samples.ci tests * restore samples.ci tests
Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods
@bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog