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

Java client, adds responses #391

Merged
merged 50 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
75c5242
Adds ApiResponse interface
spacether Feb 16, 2024
c137649
Adds ApiResponse and ResponseDeserializer
spacether Feb 17, 2024
d2d50f4
Adds partial test of ResponseDeserializer
spacether Feb 18, 2024
e10cb65
Changes all autogen schema classes to use selaed interfaces rather th…
spacether Feb 19, 2024
4c73ce3
Changes all json schema selead clases to sealed interfaces
spacether Feb 20, 2024
de64b78
Updates sealed schema classes to use records
spacether Feb 20, 2024
d622baa
Java petstore sample updated
spacether Feb 20, 2024
27d5654
Fixes typo
spacether Feb 20, 2024
eebf5ec
Adds validateAndBox method to all generated schemas
spacether Feb 20, 2024
8708c65
Adds validateAndBox to all schemas
spacether Feb 20, 2024
8bd8754
Fixes json deserialization of numbers into doubles and longs
spacether Feb 20, 2024
66a67ed
Changes request bodies to use sealed interface nd record, updates sch…
spacether Feb 20, 2024
f481db5
Adds missing methods and line breaks to docs
spacether Feb 20, 2024
9ae8ac2
Handles case where response lacks content
spacether Feb 20, 2024
6d44b6f
Adds subpackage to responses
spacether Feb 20, 2024
6d58b78
Fixes response filenames in java
spacether Feb 20, 2024
a02629c
Fixes MediaType usages in RequestBodySerializer and ResponseDeserializer
spacether Feb 21, 2024
8e9e50e
Changes MediaType into sealed interface and record classes
spacether Feb 21, 2024
d1fd075
Updates response deserializer gson instance
spacether Feb 21, 2024
a0d00a3
Updates request body dos to show sealed media type interface
spacether Feb 21, 2024
3ecbfc6
Fixes request body doc for content value, adds comment about schema g…
spacether Feb 21, 2024
b7050c2
Fixes response class names
spacether Feb 21, 2024
85f5a6d
Fixes handling or responses with no schema definition
spacether Feb 21, 2024
c8c734b
Fixes solidus package path
spacether Feb 21, 2024
a6bda62
Adds validateAndBox method requiremnt for JsonSchemas
spacether Feb 21, 2024
d55f61b
Passes generic into JsonSchema classes
spacether Feb 21, 2024
8491d21
Adds more needed JsonSchema ? generics
spacether Feb 21, 2024
8eef9b8
Adds and uses deserializeBody method
spacether Feb 21, 2024
35b07e4
Adds more needed ? generecs for JsonSchemas
spacether Feb 21, 2024
1791850
Improves RequestBodySerializerTest
spacether Feb 21, 2024
85ff121
Fixes validator tests
spacether Feb 22, 2024
2315ac9
Fixes build warnings
spacether Feb 22, 2024
da1a181
Fixes java tests
spacether Feb 22, 2024
925be6b
Response getBody methods generated
spacether Feb 22, 2024
63ca8a1
Uses MapUtils.makeMap when there are no response schemas
spacether Feb 22, 2024
b77a4b6
Petstore updated with response docs
spacether Feb 22, 2024
b6af9a8
Samples and docs updated
spacether Feb 22, 2024
735c5fd
Sample regen with python fix
spacether Feb 23, 2024
e7337a9
Samples regen
spacether Feb 23, 2024
8eab4df
Fixes nullable check when using gson toJson
spacether Feb 23, 2024
9519fc9
Adds missing import
spacether Feb 23, 2024
62c11c8
Adds missing response class for java
spacether Feb 23, 2024
389f2c4
Adds another nullness fix
spacether Feb 23, 2024
8a1acbc
Adds -e and -X flags to mvn test
spacether Feb 23, 2024
ce87ad9
Adds mvn version info to log
spacether Feb 23, 2024
b9192c2
Adds java.net.http as a module when building
spacether Feb 24, 2024
50fe209
Adds testCompilerArgument
spacether Feb 24, 2024
77df7f2
Surefire plugin updated
spacether Feb 25, 2024
abf0a55
Samples updated, maven-surefire-plugin version updated
spacether Feb 25, 2024
97b8334
Updates parallelism to use classes
spacether Feb 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .circleci/parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ elif [ "$JOB_ID" = "testPythonClientSamples" ]; then
elif [ "$JOB_ID" = "testJava17ClientSamples" ]; then
echo "Running job $JOB_ID ..."
java -version
mvn -version
cat ./.circleci/testJava17ClientSamples.sh | parallel

else
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|schemas|✓|OAS3
|responses||OAS3
|responses||OAS3
|parameters|✗|OAS3
|examples|✗|OAS3
|requestBodies|✓|OAS3
Expand Down Expand Up @@ -220,7 +220,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Servers|✓|OAS3
|Security|✗|OAS2,OAS3
|ComponentSchemas|✓|OAS3
|ComponentResponses||OAS3
|ComponentResponses||OAS3
|ComponentParameters|✗|OAS3
|ComponentRequestBodies|✓|OAS3
|ComponentHeaders|✗|OAS3
Expand Down
4 changes: 4 additions & 0 deletions samples/client/3_0_3_unit_test/java/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ src/main/java/org/openapijsonschematools/client/parameter/ParameterStyle.java
src/main/java/org/openapijsonschematools/client/requestbody/GenericRequestBody.java
src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java
src/main/java/org/openapijsonschematools/client/requestbody/SerializedRequestBody.java
src/main/java/org/openapijsonschematools/client/response/ApiResponse.java
src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java
src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java
src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java
Expand Down Expand Up @@ -292,6 +295,7 @@ src/main/java/org/openapijsonschematools/client/servers/ServerWithVariables.java
src/main/java/org/openapijsonschematools/client/servers/ServerWithoutVariables.java
src/test/java/org/openapijsonschematools/client/configurations/JsonSchemaKeywordFlagsTest.java
src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java
src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java
src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java
src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java
src/test/java/org/openapijsonschematools/client/schemas/BooleanSchemaTest.java
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,46 @@ public class AdditionalpropertiesCanExistByItself<br>

A class that contains necessary nested
- schema classes (which validate payloads), extends JsonSchema
- abstract sealed classes which store validated payloads, java version of a sum type
- sealed interfaces which store validated payloads, java version of a sum type
- boxed classes which store validated payloads, sealed permits class implementations
- classes to store validated map payloads, extends FrozenMap
- classes to build inputs for map payloads

## Nested Class Summary
| Modifier and Type | Class and Description |
| ----------------- | ---------------------- |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)<br> abstract sealed validated payload class |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)<br> boxed class to store validated Map payloads |
| sealed interface | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)<br> sealed interface for validated payloads |
| record | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)<br> boxed class to store validated Map payloads |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1](#additionalpropertiescanexistbyitself1)<br> schema class |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMapBuilder](#additionalpropertiescanexistbyitselfmapbuilder)<br> builder for Map payloads |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap)<br> output class for Map payloads |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxed](#additionalpropertiesboxed)<br> abstract sealed validated payload class |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)<br> boxed class to store validated boolean payloads |
| sealed interface | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxed](#additionalpropertiesboxed)<br> sealed interface for validated payloads |
| record | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)<br> boxed class to store validated boolean payloads |
| static class | [AdditionalpropertiesCanExistByItself.AdditionalProperties](#additionalproperties)<br> schema class |

## AdditionalpropertiesCanExistByItself1Boxed
public static abstract sealed class AdditionalpropertiesCanExistByItself1Boxed<br>
public sealed interface AdditionalpropertiesCanExistByItself1Boxed<br>
permits<br>
[AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)

abstract sealed class that stores validated payloads using boxed classes
sealed interface that stores validated payloads using boxed classes

## AdditionalpropertiesCanExistByItself1BoxedMap
public static final class AdditionalpropertiesCanExistByItself1BoxedMap<br>
extends [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)
public record AdditionalpropertiesCanExistByItself1BoxedMap<br>
implements [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)

a boxed class to store validated Map payloads, sealed permits class implementation
record that stores validated Map payloads, sealed permits implementation

### Constructor Summary
| Constructor and Description |
| --------------------------- |
| AdditionalpropertiesCanExistByItself1BoxedMap([AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) data)<br>Creates an instance, private visibility |

### Field Summary
| Modifier and Type | Field and Description |
### Method Summary
| Modifier and Type | Method and Description |
| ----------------- | ---------------------- |
| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | data<br>validated payload |
| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | data()<br>validated payload |
| @Nullable Object | getData()<br>validated payload |

## AdditionalpropertiesCanExistByItself1
public static class AdditionalpropertiesCanExistByItself1<br>
Expand Down Expand Up @@ -87,7 +88,9 @@ AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap val
| ----------------- | ---------------------- |
| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | validate([Map&lt;?, ?&gt;](#additionalpropertiescanexistbyitselfmapbuilder) arg, SchemaConfiguration configuration) |
| [AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap) | validateAndBox([Map&lt;?, ?&gt;](#additionalpropertiescanexistbyitselfmapbuilder) arg, SchemaConfiguration configuration) |
| [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |

## AdditionalpropertiesCanExistByItselfMapBuilder
public class AdditionalpropertiesCanExistByItselfMapBuilder<br>
builder for `Map<String, Boolean>`
Expand Down Expand Up @@ -118,27 +121,28 @@ A class to store validated Map payloads
| boolean | getAdditionalProperty(String name)<br>provides type safety for additional properties |

## AdditionalPropertiesBoxed
public static abstract sealed class AdditionalPropertiesBoxed<br>
public sealed interface AdditionalPropertiesBoxed<br>
permits<br>
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)

abstract sealed class that stores validated payloads using boxed classes
sealed interface that stores validated payloads using boxed classes

## AdditionalPropertiesBoxedBoolean
public static final class AdditionalPropertiesBoxedBoolean<br>
extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed)
public record AdditionalPropertiesBoxedBoolean<br>
implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed)

a boxed class to store validated boolean payloads, sealed permits class implementation
record that stores validated boolean payloads, sealed permits implementation

### Constructor Summary
| Constructor and Description |
| --------------------------- |
| AdditionalPropertiesBoxedBoolean(boolean data)<br>Creates an instance, private visibility |

### Field Summary
| Modifier and Type | Field and Description |
### Method Summary
| Modifier and Type | Method and Description |
| ----------------- | ---------------------- |
| boolean | data<br>validated payload |
| boolean | data()<br>validated payload |
| @Nullable Object | getData()<br>validated payload |

## AdditionalProperties
public static class AdditionalProperties<br>
Expand Down
Loading