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

Commit 8ee7043

Browse files
authored
Java, documentation improvements (#421)
* Fixes api doc path info and link * Java petstore regen * Sample regen with defaultHeaders and additionalProperties data acessible to templates * Java removes request body headers * Updates server schema names * Fixes server variables filenames * Fixes schema names for xparams and for server variables * Samples updated * Fixes schema variable names * Fixes server schema names in java + default user agent in java * Samples regen, additionalProperties added in missing location * Sample regen to remove unused java fiiles
1 parent 9593967 commit 8ee7043

File tree

2,438 files changed

+13466
-6703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,438 files changed

+13466
-6703
lines changed

samples/client/3_0_3_unit_test/java/.openapi-generator/FILES

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ docs/components/schemas/UniqueitemsValidation.md
8787
docs/components/schemas/UriFormat.md
8888
docs/components/schemas/UriReferenceFormat.md
8989
docs/components/schemas/UriTemplateFormat.md
90-
docs/servers/Server0.md
90+
docs/servers/RootServer0.md
9191
pom.xml
9292
src/main/java/org/openapijsonschematools/client/RootServerInfo.java
9393
src/main/java/org/openapijsonschematools/client/apiclient/ApiClient.java
@@ -313,8 +313,8 @@ src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsVa
313313
src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java
314314
src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java
315315
src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java
316+
src/main/java/org/openapijsonschematools/client/servers/RootServer0.java
316317
src/main/java/org/openapijsonschematools/client/servers/Server.java
317-
src/main/java/org/openapijsonschematools/client/servers/Server0.java
318318
src/main/java/org/openapijsonschematools/client/servers/ServerProvider.java
319319
src/main/java/org/openapijsonschematools/client/servers/ServerWithVariables.java
320320
src/main/java/org/openapijsonschematools/client/servers/ServerWithoutVariables.java

samples/client/3_0_3_unit_test/java/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#
1+
# petstore
22
sample spec for testing openapi functionality, built from json schema tests for draft6
33

44
This Java package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project:
55

6-
- API version: 0.0.1
7-
- Package version:
8-
- Build package: JavaClientGenerator
6+
- OpenAPI document version: 0.0.1
7+
- Java Package version: 0.0.1
8+
- OpenAPI JSON Schema Generator, Generator: JavaClientGenerator
99

1010
## Requirements
1111

@@ -149,7 +149,7 @@ allowed input and output types.
149149
## Servers
150150
| server_index | Class | Description |
151151
| ------------ | ----- | ----------- |
152-
| 0 | [Server0](docs/servers/Server0.md) | |
152+
| 0 | [RootServer0](docs/servers/RootServer0.md) | |
153153

154154
## Endpoints
155155
All URIs are relative to the selected server

samples/client/3_0_3_unit_test/java/docs/RootServerInfo.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ A class that stores servers and allows one to be returned with a ServerIndex ins
2323
### Constructor Summary
2424
| Constructor and Description |
2525
| --------------------------- |
26-
| RootServerInfo1(@Nullable [Server0](servers/Server0.md) server0)<br>Creates an instance using passed in servers |
26+
| RootServerInfo1(@Nullable [RootServer0](servers/RootServer0.md) server0)<br>Creates an instance using passed in servers |
2727

2828
### Field Summary
2929
| Modifier and Type | Field and Description |
3030
| ----------------- | --------------------- |
31-
| [Server0](servers/Server0.md) | server0 |
31+
| [RootServer0](servers/RootServer0.md) | server0 |
3232

3333
### Method Summary
3434
| Modifier and Type | Method and Description |
@@ -47,7 +47,7 @@ a builder for [RootServerInfo1](#rootserverinfo1)
4747
### Method Summary
4848
| Modifier and Type | Method and Description |
4949
| ----------------- | ---------------------- |
50-
| [RootServerInfoBuilder](#rootserverinfobuilder) | server0([Server0](servers/Server0.md) server0)<br>sets the server |
50+
| [RootServerInfoBuilder](#rootserverinfobuilder) | rootServer0([RootServer0](servers/RootServer0.md) server0)<br>sets the server |
5151
| [RootServerInfo1](#rootserverinfo1) | build() |
5252

5353
## ServerIndex

samples/client/3_0_3_unit_test/java/docs/servers/Server0.md renamed to samples/client/3_0_3_unit_test/java/docs/servers/RootServer0.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
org.openapijsonschematools.client.servers.Server0
2-
# Server Server0
3-
public class Server0
1+
org.openapijsonschematools.client.servers.RootServer0
2+
# Server RootServer0
3+
public class RootServer0
44

55
A class that stores a server url
66

77
### Constructor Summary
88
| Constructor and Description |
99
| --------------------------- |
10-
| Server0()<br>Creates a server |
10+
| RootServer0()<br>Creates a server |
1111

1212
### Field Summary
1313
| Modifier and Type | Field and Description |

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/RootServerInfo.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.openapijsonschematools.client;
22

3-
import org.openapijsonschematools.client.servers.Server0;
3+
import org.openapijsonschematools.client.servers.RootServer0;
44
import org.openapijsonschematools.client.servers.Server;
55
import org.openapijsonschematools.client.servers.ServerProvider;
66
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -9,12 +9,12 @@
99

1010
public class RootServerInfo {
1111
public static class RootServerInfo1 implements ServerProvider<ServerIndex> {
12-
private final Server0 server0;
12+
private final RootServer0 server0;
1313

1414
RootServerInfo1(
15-
@Nullable Server0 server0
15+
@Nullable RootServer0 server0
1616
) {
17-
this.server0 = Objects.requireNonNullElseGet(server0, Server0::new);
17+
this.server0 = Objects.requireNonNullElseGet(server0, RootServer0::new);
1818
}
1919

2020
@Override
@@ -24,11 +24,11 @@ public Server getServer(ServerIndex serverIndex) {
2424
}
2525

2626
public static class RootServerInfoBuilder {
27-
private @Nullable Server0 server0;
27+
private @Nullable RootServer0 server0;
2828

2929
public RootServerInfoBuilder() {}
3030

31-
public RootServerInfoBuilder server0(Server0 server0) {
31+
public RootServerInfoBuilder rootServer0(RootServer0 server0) {
3232
this.server0 = server0;
3333
return this;
3434
}

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/configurations/ApiConfiguration.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ public class ApiConfiguration {
1414
private final ServerInfo serverInfo;
1515
private final ServerIndexInfo serverIndexInfo;
1616
private final @Nullable Duration timeout;
17+
private final Map<String, List< String>> defaultHeaders;
1718

1819
public ApiConfiguration() {
1920
serverInfo = new ServerInfoBuilder().build();
2021
serverIndexInfo = new ServerIndexInfoBuilder().build();
2122
timeout = null;
23+
defaultHeaders = new HashMap<>();
2224
}
2325

24-
public ApiConfiguration(ServerInfo serverInfo, ServerIndexInfo serverIndexInfo, Duration timeout) {
26+
public ApiConfiguration(ServerInfo serverInfo, ServerIndexInfo serverIndexInfo, Duration timeout, Map<String, List< String>> defaultHeaders) {
2527
this.serverInfo = serverInfo;
2628
this.serverIndexInfo = serverIndexInfo;
2729
this.timeout = timeout;
30+
this.defaultHeaders = defaultHeaders;
2831
}
2932

3033
public static class ServerInfo {
@@ -89,7 +92,7 @@ public Server getServer(RootServerInfo. @Nullable ServerIndex serverIndex) {
8992
}
9093

9194
public Map<String, List< String>> getDefaultHeaders() {
92-
return new HashMap<>();
95+
return defaultHeaders;
9396
}
9497

9598
public @Nullable Duration getTimeout() {
+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import org.openapijsonschematools.client.servers.ServerWithoutVariables;
44

5-
public class Server0 extends ServerWithoutVariables {
6-
public Server0() {
5+
public class RootServer0 extends ServerWithoutVariables {
6+
public RootServer0() {
77
super("https://someserver.com/v1");
88
}
99
}

samples/client/3_0_3_unit_test/python/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ sample spec for testing openapi functionality, built from json schema tests for
33

44
This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project:
55

6-
- API version: 0.0.1
7-
- Package version: 1.0.0
8-
- Build package: PythonClientGenerator
6+
- OpenAPI document version: 0.0.1
7+
- Python Package version: 1.0.0
8+
- OpenAPI JSON Schema Generator, Generator: PythonClientGenerator
99

1010
## Requirements
1111

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_int_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_number_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

samples/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# coding: utf-8
22

33
"""
4+
openapi 3.0.3 sample spec
5+
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
6+
The version of the OpenAPI document: 0.0.1
47
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
58
"""
69

0 commit comments

Comments
 (0)