Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit cc93f6f

Browse files
committed
Samples regen
1 parent f88b4fc commit cc93f6f

File tree

12 files changed

+183
-142
lines changed

12 files changed

+183
-142
lines changed

docs/generators/java.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
183183
|examples|✗|OAS3
184184
|requestBodies|✗|OAS3
185185
|headers|✗|OAS3
186-
|securitySchemes||OAS3
186+
|securitySchemes||OAS3
187187
|links|✗|OAS3
188188
|callbacks|✗|OAS3
189189
|pathItems|✗|OAS3
@@ -320,10 +320,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
320320
### Security Feature
321321
| Name | Supported | Defined By |
322322
| ---- | --------- | ---------- |
323-
|HTTP_Basic||OAS2,OAS3
324-
|ApiKey||OAS2,OAS3
323+
|HTTP_Basic||OAS2,OAS3
324+
|ApiKey||OAS2,OAS3
325325
|OpenIDConnect|✗|OAS3
326-
|HTTP_Bearer||OAS2,OAS3
326+
|HTTP_Bearer||OAS2,OAS3
327327
|OAuth2_Implicit|✗|OAS2,OAS3
328328
|OAuth2_Password|✗|OAS2,OAS3
329329
|OAuth2_ClientCredentials|✗|OAS2,OAS3

samples/client/petstore/java/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ allowed input and output types.
306306
| [ApiKey](docs/components/securityschemes/ApiKey.md) | apiKey in header |
307307
| [ApiKeyQuery](docs/components/securityschemes/ApiKeyQuery.md) | apiKey in query |
308308
| [BearerTest](docs/components/securityschemes/BearerTest.md) | http bearer with JWT bearer format |
309-
| [HttpBasicTest](docs/components/securitysschemes/HttpBasicTest.md) | http basic |
309+
| [HttpBasicTest](docs/components/securityschemes/HttpBasicTest.md) | http basic |
310310
| [HttpSignatureTest](docs/components/securityschemes/HttpSignatureTest.md) | http + signature |
311311
| [OpenIdConnectTest](docs/components/securityschemes/OpenIdConnectTest.md) | openIdConnect |
312312
| [PetstoreAuth](docs/components/securityschemes/PetstoreAuth.md) | oauth2 implicit flow with two scopes |
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.ApiKey
1+
org.openapijsonschematools.client.components.securityschemes.ApiKey
22
# SecurityScheme ApiKey
33

4-
## Description
5-
apiKey in header
4+
public class ApiKey
5+
extends ApiKeySecurityScheme
66

7-
## Type
8-
API_KEY
7+
A class that is used to apply auth to a request
98

10-
## Name
11-
"api_key"
9+
### Description
10+
apiKey in header
1211

13-
## api_key
14-
Type | Notes
15-
---- | ------
16-
str | Set by the developer
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
1716

18-
## In Location
19-
ApiKeyInLocation.HEADER
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| ApiKey(String apiKey)<br>for header apiKey auth |
2021

2122
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.ApiKeyQuery
1+
org.openapijsonschematools.client.components.securityschemes.ApiKeyQuery
22
# SecurityScheme ApiKeyQuery
33

4-
## Description
5-
apiKey in query
4+
public class ApiKeyQuery
5+
extends ApiKeySecurityScheme
66

7-
## Type
8-
API_KEY
7+
A class that is used to apply auth to a request
98

10-
## Name
11-
"api_key_query"
9+
### Description
10+
apiKey in query
1211

13-
## api_key
14-
Type | Notes
15-
---- | ------
16-
str | Set by the developer
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
1716

18-
## In Location
19-
ApiKeyInLocation.QUERY
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| ApiKeyQuery(String apiKey)<br>for query apiKey auth |
2021

2122
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.BearerTest
1+
org.openapijsonschematools.client.components.securityschemes.BearerTest
22
# SecurityScheme BearerTest
33

4-
## Description
5-
http bearer with JWT bearer format
4+
public class BearerTest
5+
extends HttpBearerSecurityScheme
66

7-
## Type
8-
HTTP
7+
A class that is used to apply auth to a request
98

10-
## Scheme
11-
BEARER
9+
### Description
10+
http bearer with JWT bearer format
1211

13-
## Bearer Format
14-
"JWT"
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
1516

16-
## access_token
17-
Type | Notes
18-
---- | ------
19-
str | Set by the developer
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| BearerTest(String accessToken) |
2021

2122
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.HttpBasicTest
1+
org.openapijsonschematools.client.components.securityschemes.HttpBasicTest
22
# SecurityScheme HttpBasicTest
33

4-
## Description
5-
http basic
4+
public class HttpBasicTest
5+
extends HttpBasicSecurityScheme
66

7-
## Type
8-
HTTP
7+
A class that is used to apply auth to a request
98

10-
## Scheme
11-
BASIC
9+
### Description
10+
http basic
1211

13-
## user_id
14-
Type | Notes
15-
---- | ------
16-
str | Set by the developer
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
1716

18-
## password
19-
Type | Notes
20-
---- | ------
21-
str | Set by the developer
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| HttpBasicTest(String userId, String password) |
2221

2322
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.HttpSignatureTest
1+
org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest
22
# SecurityScheme HttpSignatureTest
33

4-
## Description
5-
http + signature
4+
public class HttpSignatureTest
5+
extends HttpSignatureSecurityScheme
6+
7+
A class that is used to apply auth to a request
68

7-
## Type
8-
HTTP
9+
### Description
10+
http + signature
911

10-
## Scheme
11-
SIGNATURE
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
1216

13-
## signing_info
14-
Type | Notes
15-
---- | ------
16-
org.openapijsonschematools.client.signing.HttpSigningConfiguration | Set by the developer
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| todo |
1721

1822
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.OpenIdConnectTest
1+
org.openapijsonschematools.client.components.securityschemes.OpenIdConnectTest
22
# SecurityScheme OpenIdConnectTest
33

4-
## Description
4+
public class OpenIdConnectTest
5+
extends OpenIdConnectSecurityScheme
6+
7+
A class that is used to apply auth to a request
8+
9+
### Description
510
openIdConnect
611

7-
## Type
8-
OPENID_CONNECT
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
916

10-
## OpenIdConnect Url
11-
"https://somesite.com/.well-known/openid-configuration"
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| todo |
1221

1322
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
org.openapijsonschematools.client.components.security_schemes.PetstoreAuth
1+
org.openapijsonschematools.client.components.securityschemes.PetstoreAuth
22
# SecurityScheme PetstoreAuth
33

4-
## Description
4+
public class PetstoreAuth
5+
extends Oauth2SecurityScheme
6+
7+
A class that is used to apply auth to a request
8+
9+
### Description
510
oauth2 implicit flow with two scopes
611

7-
## Type
8-
OAUTH_2
12+
### Method Summary
13+
| Modifier and Type | Method and Description |
14+
| ----------------- | ---------------------- |
15+
| void | applyAuth(Map<String, List<String>> headers, String resourcePath, String method, HttpRequest.BodyPublisher bodyPublisher, @Nullable String queryParamsSuffix, List<String> scopeNames) |
16+
17+
### Constructor Summary
18+
| Constructor and Description |
19+
| --------------------------- |
20+
| todo |
921

1022
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)

src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.openapijsonschematools.codegen.generators.generatormetadata.features.SchemaFeature;
3636
import org.openapijsonschematools.codegen.common.CodegenConstants;
3737
import org.openapijsonschematools.codegen.generators.generatormetadata.GeneratorType;
38+
import org.openapijsonschematools.codegen.generators.generatormetadata.features.SecurityFeature;
3839
import org.openapijsonschematools.codegen.generators.models.CliOption;
3940
import org.openapijsonschematools.codegen.generators.openapimodels.CodegenHeader;
4041
import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKey;
@@ -281,7 +282,13 @@ public JavaClientGenerator() {
281282
GlobalFeature.Servers
282283
)
283284
.includeComponentsFeatures(
284-
ComponentsFeature.schemas
285+
ComponentsFeature.schemas,
286+
ComponentsFeature.securitySchemes
287+
)
288+
.includeSecurityFeatures(
289+
SecurityFeature.ApiKey,
290+
SecurityFeature.HTTP_Basic,
291+
SecurityFeature.HTTP_Bearer
285292
)
286293
.includeSchemaFeatures(
287294
SchemaFeature.AdditionalProperties,

0 commit comments

Comments
 (0)