Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Sep 29, 2024
1 parent 794bf4d commit 644c46c
Show file tree
Hide file tree
Showing 81 changed files with 4,447 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{#withXml}}
@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
{{/withXml}}
{{{name}}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}},
{{{name}}}({{^isUri}}{{^isString}}{{dataType}}.valueOf({{/isString}}{{/isUri}}{{{value}}}{{^isUri}}{{^isString}}){{/isString}}{{/isUri}}){{^-last}},
{{/-last}}{{#-last}};{{/-last}}
{{/enumVars}}
{{/allowableValues}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ public UUID getUUID() throws ClassCastException {
* @return The actual instance of `List<Integer>`
* @throws ClassCastException if the instance is not `List<Integer>`
*/
public List<Integer> getListInteger() throws ClassCastException {
public List<Integer> getListInteger() throws ClassCastException {
return (List<Integer>)super.getActualInstance();
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ public Object getActualInstance() {
* @return The actual instance of `List<BigDecimal>`
* @throws ClassCastException if the instance is not `List<BigDecimal>`
*/
public List<BigDecimal> getListBigDecimal() throws ClassCastException {
public List<BigDecimal> getListBigDecimal() throws ClassCastException {
return (List<BigDecimal>)super.getActualInstance();
}
}

/**
* Get the actual instance of `List<Integer>`. If the actual instance is not `List<Integer>`,
Expand All @@ -207,9 +207,9 @@ public List<BigDecimal> getListBigDecimal() throws ClassCastException {
* @return The actual instance of `List<Integer>`
* @throws ClassCastException if the instance is not `List<Integer>`
*/
public List<Integer> getListInteger() throws ClassCastException {
public List<Integer> getListInteger() throws ClassCastException {
return (List<Integer>)super.getActualInstance();
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -172,9 +172,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -160,9 +160,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -159,9 +159,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -162,9 +162,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -162,9 +162,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
18 changes: 18 additions & 0 deletions samples/client/petstore/java/jersey3/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ build.sbt
docs/AdditionalPropertiesClass.md
docs/Animal.md
docs/AnotherFakeApi.md
docs/AnyOf1.md
docs/AnyOf2.md
docs/AnyofArray200Response.md
docs/AnyofArrayOneOfParamParameter.md
docs/AnyofArrayRequest.md
docs/AnyofArrayRequestMapProp.md
docs/Apple.md
docs/AppleReq.md
docs/ArrayOfArrayOfNumberOnly.md
Expand Down Expand Up @@ -124,6 +130,12 @@ src/main/java/org/openapitools/client/auth/OAuthFlow.java
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
src/main/java/org/openapitools/client/model/Animal.java
src/main/java/org/openapitools/client/model/AnyOf1.java
src/main/java/org/openapitools/client/model/AnyOf2.java
src/main/java/org/openapitools/client/model/AnyofArray200Response.java
src/main/java/org/openapitools/client/model/AnyofArrayOneOfParamParameter.java
src/main/java/org/openapitools/client/model/AnyofArrayRequest.java
src/main/java/org/openapitools/client/model/AnyofArrayRequestMapProp.java
src/main/java/org/openapitools/client/model/Apple.java
src/main/java/org/openapitools/client/model/AppleReq.java
src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
Expand Down Expand Up @@ -197,3 +209,9 @@ src/main/java/org/openapitools/client/model/TriangleInterface.java
src/main/java/org/openapitools/client/model/User.java
src/main/java/org/openapitools/client/model/Whale.java
src/main/java/org/openapitools/client/model/Zebra.java
src/test/java/org/openapitools/client/model/AnyOf1Test.java
src/test/java/org/openapitools/client/model/AnyOf2Test.java
src/test/java/org/openapitools/client/model/AnyofArray200ResponseTest.java
src/test/java/org/openapitools/client/model/AnyofArrayOneOfParamParameterTest.java
src/test/java/org/openapitools/client/model/AnyofArrayRequestMapPropTest.java
src/test/java/org/openapitools/client/model/AnyofArrayRequestTest.java
7 changes: 7 additions & 0 deletions samples/client/petstore/java/jersey3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*FakeApi* | [**anyofArray**](docs/FakeApi.md#anyofArray) | **POST** /anyof-array |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
Expand Down Expand Up @@ -164,6 +165,12 @@ Class | Method | HTTP request | Description

- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Animal](docs/Animal.md)
- [AnyOf1](docs/AnyOf1.md)
- [AnyOf2](docs/AnyOf2.md)
- [AnyofArray200Response](docs/AnyofArray200Response.md)
- [AnyofArrayOneOfParamParameter](docs/AnyofArrayOneOfParamParameter.md)
- [AnyofArrayRequest](docs/AnyofArrayRequest.md)
- [AnyofArrayRequestMapProp](docs/AnyofArrayRequestMapProp.md)
- [Apple](docs/Apple.md)
- [AppleReq](docs/AppleReq.md)
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
Expand Down
89 changes: 89 additions & 0 deletions samples/client/petstore/java/jersey3/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,37 @@ paths:
- fake
x-accepts:
- application/json
/anyof-array:
post:
description: Response with anyof containing arrays and a oneof parameter as
well as a map request body
operationId: anyof-array
parameters:
- explode: false
in: path
name: oneOfParam
required: true
schema:
$ref: '#/components/schemas/anyof_array_oneOfParam_parameter'
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/anyof_array_request'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/anyof_array_200_response'
description: Response
tags:
- fake
x-content-type: application/json
x-accepts:
- application/json
/fake/{petId}/uploadImageWithRequiredFile:
post:
description: ""
Expand Down Expand Up @@ -1263,6 +1294,15 @@ paths:
x-accepts:
- application/json
components:
parameters:
oneOfParam:
explode: false
in: path
name: oneOfParam
required: true
schema:
$ref: '#/components/schemas/anyof_array_oneOfParam_parameter'
style: simple
requestBodies:
UserArray:
content:
Expand Down Expand Up @@ -1483,6 +1523,30 @@ components:
type: object
xml:
name: Pet
AnyOf1:
example:
code: 0
type: type
message: message
properties:
code:
format: int32
type: integer
type:
type: string
message:
type: string
type: object
AnyOf2:
properties:
code:
format: int32
type: integer
type:
type: string
message:
type: string
type: object
ApiResponse:
example:
code: 0
Expand Down Expand Up @@ -2432,6 +2496,31 @@ components:
someProperty:
type: string
type: object
anyof_array_request_mapProp:
oneOf:
- additionalProperties: true
type: object
- default: "false"
enum:
- "true"
- "false"
type: string
anyof_array_request:
properties:
mapProp:
$ref: '#/components/schemas/anyof_array_request_mapProp'
anyof_array_oneOfParam_parameter:
oneOf:
- type: integer
- type: string
anyof_array_200_response:
anyOf:
- items:
$ref: '#/components/schemas/AnyOf1'
type: array
- items:
$ref: '#/components/schemas/AnyOf2'
type: array
uploadFileWithRequiredFile_request:
properties:
additionalMetadata:
Expand Down
15 changes: 15 additions & 0 deletions samples/client/petstore/java/jersey3/docs/AnyOf1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# AnyOf1


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**code** | **Integer** | | [optional] |
|**type** | **String** | | [optional] |
|**message** | **String** | | [optional] |



15 changes: 15 additions & 0 deletions samples/client/petstore/java/jersey3/docs/AnyOf2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# AnyOf2


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**code** | **Integer** | | [optional] |
|**type** | **String** | | [optional] |
|**message** | **String** | | [optional] |



Loading

0 comments on commit 644c46c

Please sign in to comment.