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

Java, documentation improvements #421

Merged
merged 12 commits into from
Apr 12, 2024
Merged
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions samples/client/3_0_3_unit_test/java/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ docs/components/schemas/UniqueitemsValidation.md
docs/components/schemas/UriFormat.md
docs/components/schemas/UriReferenceFormat.md
docs/components/schemas/UriTemplateFormat.md
docs/servers/Server0.md
docs/servers/RootServer0.md
pom.xml
src/main/java/org/openapijsonschematools/client/RootServerInfo.java
src/main/java/org/openapijsonschematools/client/apiclient/ApiClient.java
Expand Down Expand Up @@ -313,8 +313,8 @@ src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsVa
src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java
src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java
src/main/java/org/openapijsonschematools/client/servers/RootServer0.java
src/main/java/org/openapijsonschematools/client/servers/Server.java
src/main/java/org/openapijsonschematools/client/servers/Server0.java
src/main/java/org/openapijsonschematools/client/servers/ServerProvider.java
src/main/java/org/openapijsonschematools/client/servers/ServerWithVariables.java
src/main/java/org/openapijsonschematools/client/servers/ServerWithoutVariables.java
Expand Down
10 changes: 5 additions & 5 deletions samples/client/3_0_3_unit_test/java/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# petstore
sample spec for testing openapi functionality, built from json schema tests for draft6

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

- API version: 0.0.1
- Package version:
- Build package: JavaClientGenerator
- OpenAPI document version: 0.0.1
- Java Package version: 0.0.1
- OpenAPI JSON Schema Generator, Generator: JavaClientGenerator

## Requirements

Expand Down Expand Up @@ -149,7 +149,7 @@ allowed input and output types.
## Servers
| server_index | Class | Description |
| ------------ | ----- | ----------- |
| 0 | [Server0](docs/servers/Server0.md) | |
| 0 | [RootServer0](docs/servers/RootServer0.md) | |

## Endpoints
All URIs are relative to the selected server
Expand Down
6 changes: 3 additions & 3 deletions samples/client/3_0_3_unit_test/java/docs/RootServerInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ A class that stores servers and allows one to be returned with a ServerIndex ins
### Constructor Summary
| Constructor and Description |
| --------------------------- |
| RootServerInfo1(@Nullable [Server0](servers/Server0.md) server0)<br>Creates an instance using passed in servers |
| RootServerInfo1(@Nullable [RootServer0](servers/RootServer0.md) server0)<br>Creates an instance using passed in servers |

### Field Summary
| Modifier and Type | Field and Description |
| ----------------- | --------------------- |
| [Server0](servers/Server0.md) | server0 |
| [RootServer0](servers/RootServer0.md) | server0 |

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

## ServerIndex
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.openapijsonschematools.client.servers.Server0
# Server Server0
public class Server0
org.openapijsonschematools.client.servers.RootServer0
# Server RootServer0
public class RootServer0

A class that stores a server url

### Constructor Summary
| Constructor and Description |
| --------------------------- |
| Server0()<br>Creates a server |
| RootServer0()<br>Creates a server |

### Field Summary
| Modifier and Type | Field and Description |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.openapijsonschematools.client;

import org.openapijsonschematools.client.servers.Server0;
import org.openapijsonschematools.client.servers.RootServer0;
import org.openapijsonschematools.client.servers.Server;
import org.openapijsonschematools.client.servers.ServerProvider;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand All @@ -9,12 +9,12 @@

public class RootServerInfo {
public static class RootServerInfo1 implements ServerProvider<ServerIndex> {
private final Server0 server0;
private final RootServer0 server0;

RootServerInfo1(
@Nullable Server0 server0
@Nullable RootServer0 server0
) {
this.server0 = Objects.requireNonNullElseGet(server0, Server0::new);
this.server0 = Objects.requireNonNullElseGet(server0, RootServer0::new);
}

@Override
Expand All @@ -24,11 +24,11 @@ public Server getServer(ServerIndex serverIndex) {
}

public static class RootServerInfoBuilder {
private @Nullable Server0 server0;
private @Nullable RootServer0 server0;

public RootServerInfoBuilder() {}

public RootServerInfoBuilder server0(Server0 server0) {
public RootServerInfoBuilder rootServer0(RootServer0 server0) {
this.server0 = server0;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ public class ApiConfiguration {
private final ServerInfo serverInfo;
private final ServerIndexInfo serverIndexInfo;
private final @Nullable Duration timeout;
private final Map<String, List< String>> defaultHeaders;

public ApiConfiguration() {
serverInfo = new ServerInfoBuilder().build();
serverIndexInfo = new ServerIndexInfoBuilder().build();
timeout = null;
defaultHeaders = new HashMap<>();
}

public ApiConfiguration(ServerInfo serverInfo, ServerIndexInfo serverIndexInfo, Duration timeout) {
public ApiConfiguration(ServerInfo serverInfo, ServerIndexInfo serverIndexInfo, Duration timeout, Map<String, List< String>> defaultHeaders) {
this.serverInfo = serverInfo;
this.serverIndexInfo = serverIndexInfo;
this.timeout = timeout;
this.defaultHeaders = defaultHeaders;
}

public static class ServerInfo {
Expand Down Expand Up @@ -89,7 +92,7 @@ public Server getServer(RootServerInfo. @Nullable ServerIndex serverIndex) {
}

public Map<String, List< String>> getDefaultHeaders() {
return new HashMap<>();
return defaultHeaders;
}

public @Nullable Duration getTimeout() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.openapijsonschematools.client.servers.ServerWithoutVariables;

public class Server0 extends ServerWithoutVariables {
public Server0() {
public class RootServer0 extends ServerWithoutVariables {
public RootServer0() {
super("https://someserver.com/v1");
}
}
6 changes: 3 additions & 3 deletions samples/client/3_0_3_unit_test/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ sample spec for testing openapi functionality, built from json schema tests for

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

- API version: 0.0.1
- Package version: 1.0.0
- Build package: PythonClientGenerator
- OpenAPI document version: 0.0.1
- Python Package version: 1.0.0
- OpenAPI JSON Schema Generator, Generator: PythonClientGenerator

## Requirements

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# coding: utf-8

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

Expand Down
Loading