swagger-api / swagger-api/swagger-codegen

[JAVA] swagger-codegen ApiClient with Security/SSL

Open
#3,866 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java General: Question
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Question on Swagger's generated code for ApiClient. I noticed that you have a sample that generates SSL code for ApiClient. My Rest API uses swagger and gradle to generate the Rest API. I would like to know how to generate the same type of ApiClient with the use of SSL.My yaml spec has both 'http' and 'https' as schemes but does not produce any generated code that uses SSL.

I would like to be able to generate the sample ApiClient as shown below:

https://github.com/swagger-api/swagger-codegen/blob/c5724a46d6cbbed03d292a361b3a0d07d1a64dae/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java

Appreciate any input you can give.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the generated client in samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java with the client produced from the reporter's YAML and Gradle setup. Determine how the sample's SSL behavior is enabled and what generated output is expected when both http and https schemes are declared; done means the generation path and required configuration are documented or supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.