Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,23 @@ paths:
type: string
description: request body
required: true
/fake/nullable:
post:
tags:
- fake
summary: test nullable parent property
description: ""
operationId: testNullable
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ChildWithNullable'
description: request body
required: true
responses:
"200":
description: successful operation
/fake/body-with-query-params:
put:
tags:
Expand Down Expand Up @@ -1826,6 +1843,25 @@ components:
OuterBoolean:
type: boolean
x-codegen-body-parameter-name: boolean_post_body
ParentWithNullable:
type: object
discriminator:
propertyName: type
properties:
type:
type: string
enum:
- ChildWithNullable
nullableProperty:
type: string
nullable: true
ChildWithNullable:
allOf:
- $ref: '#/components/schemas/ParentWithNullable'
- type: object
properties:
otherProperty:
type: string
StringBooleanMap:
additionalProperties:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,23 @@ paths:
responses:
"200":
description: successful operation
/fake/nullable:
post:
tags:
- fake
summary: test nullable parent property
description: ""
operationId: testNullable
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ChildWithNullable'
description: request body
required: true
responses:
"200":
description: successful operation
/fake/body-with-query-params:
put:
tags:
Expand Down Expand Up @@ -1743,6 +1760,25 @@ components:
OuterBoolean:
type: boolean
x-codegen-body-parameter-name: boolean_post_body
ParentWithNullable:
type: object
discriminator:
propertyName: type
properties:
type:
type: string
enum:
- ChildWithNullable
nullableProperty:
type: string
nullable: true
ChildWithNullable:
allOf:
- $ref: '#/components/schemas/ParentWithNullable'
- type: object
properties:
otherProperty:
type: string
StringBooleanMap:
additionalProperties:
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/elixir/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ lib/openapi_petstore/model/array_test.ex
lib/openapi_petstore/model/capitalization.ex
lib/openapi_petstore/model/cat.ex
lib/openapi_petstore/model/category.ex
lib/openapi_petstore/model/child_with_nullable.ex
lib/openapi_petstore/model/class_model.ex
lib/openapi_petstore/model/client.ex
lib/openapi_petstore/model/deprecated_model.ex
Expand Down Expand Up @@ -53,6 +54,7 @@ lib/openapi_petstore/model/outer_enum_default_value.ex
lib/openapi_petstore/model/outer_enum_integer.ex
lib/openapi_petstore/model/outer_enum_integer_default_value.ex
lib/openapi_petstore/model/outer_object_with_enum_property.ex
lib/openapi_petstore/model/parent_with_nullable.ex
lib/openapi_petstore/model/pet.ex
lib/openapi_petstore/model/read_only_first.ex
lib/openapi_petstore/model/return.ex
Expand Down
31 changes: 31 additions & 0 deletions samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,37 @@ defmodule OpenapiPetstore.Api.Fake do
])
end

@doc """
test nullable parent property


### Parameters

- `connection` (OpenapiPetstore.Connection): Connection to server
- `child_with_nullable` (ChildWithNullable): request body
- `opts` (keyword): Optional parameters

### Returns

- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec test_nullable(Tesla.Env.client, OpenapiPetstore.Model.ChildWithNullable.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def test_nullable(connection, child_with_nullable, _opts \\ []) do
request =
%{}
|> method(:post)
|> url("/fake/nullable")
|> add_param(:body, :body, child_with_nullable)
|> Enum.into([])

connection
|> Connection.request(request)
|> evaluate_response([
{200, false}
])
end

@doc """
To test the collection format in query parameters

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# NOTE: This file is auto generated by OpenAPI Generator 7.0.1-SNAPSHOT (https://openapi-generator.tech).
# Do not edit this file manually.

defmodule OpenapiPetstore.Model.ChildWithNullable do
@moduledoc """

"""

@derive Jason.Encoder
defstruct [
:type,
:nullableProperty,
:otherProperty
]

@type t :: %__MODULE__{
:type => String.t | nil,
:nullableProperty => String.t | nil,
:otherProperty => String.t | nil
}

def decode(value) do
value
end
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# NOTE: This file is auto generated by OpenAPI Generator 7.0.1-SNAPSHOT (https://openapi-generator.tech).
# Do not edit this file manually.

defmodule OpenapiPetstore.Model.ParentWithNullable do
@moduledoc """

"""

@derive Jason.Encoder
defstruct [
:type,
:nullableProperty
]

@type t :: %__MODULE__{
:type => String.t | nil,
:nullableProperty => String.t | nil
}

def decode(value) do
value
end
end

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ docs/ArrayTest.md
docs/Capitalization.md
docs/Cat.md
docs/Category.md
docs/ChildWithNullable.md
docs/ClassModel.md
docs/Client.md
docs/DefaultApi.md
Expand Down Expand Up @@ -44,6 +45,7 @@ docs/OuterEnumDefaultValue.md
docs/OuterEnumInteger.md
docs/OuterEnumIntegerDefaultValue.md
docs/OuterObjectWithEnumProperty.md
docs/ParentWithNullable.md
docs/Pet.md
docs/PetApi.md
docs/ReadOnlyFirst.md
Expand Down Expand Up @@ -74,6 +76,7 @@ src/main/java/org/openapitools/client/model/ArrayTest.java
src/main/java/org/openapitools/client/model/Capitalization.java
src/main/java/org/openapitools/client/model/Cat.java
src/main/java/org/openapitools/client/model/Category.java
src/main/java/org/openapitools/client/model/ChildWithNullable.java
src/main/java/org/openapitools/client/model/ClassModel.java
src/main/java/org/openapitools/client/model/Client.java
src/main/java/org/openapitools/client/model/DeprecatedObject.java
Expand Down Expand Up @@ -106,6 +109,7 @@ src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java
src/main/java/org/openapitools/client/model/OuterEnumInteger.java
src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java
src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java
src/main/java/org/openapitools/client/model/ParentWithNullable.java
src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
src/main/java/org/openapitools/client/model/SingleRefType.java
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


# ChildWithNullable


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**otherProperty** | **String** | | [optional] |



36 changes: 36 additions & 0 deletions samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) |
| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data |
| [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property |
| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | |


Expand Down Expand Up @@ -640,6 +641,41 @@ No authorization required
| **200** | successful operation | - |


## testNullable

> void testNullable(childWithNullable)

test nullable parent property



### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.md)| request body | |

### Return type

[**void**](Void.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |


## testQueryParameterCollectionFormat

> void testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@


# ParentWithNullable


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**type** | [**TypeEnum**](#TypeEnum) | | [optional] |
|**nullableProperty** | **String** | | [optional] |



## Enum: TypeEnum

| Name | Value |
|---- | -----|
| CHILDWITHNULLABLE | "ChildWithNullable" |



Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import java.math.BigDecimal;
import org.openapitools.client.model.ChildWithNullable;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
Expand Down Expand Up @@ -169,6 +170,15 @@ public interface FakeApi {
@Consumes({ "application/x-www-form-urlencoded" })
void testJsonFormData(@FormParam("param") String param, @FormParam("param2") String param2) throws ApiException, ProcessingException;

/**
* test nullable parent property
*
*/
@POST
@Path("/nullable")
@Consumes({ "application/json" })
void testNullable(ChildWithNullable childWithNullable) throws ApiException, ProcessingException;

@PUT
@Path("/test-query-parameters")
void testQueryParameterCollectionFormat(@QueryParam("pipe") List<String> pipe, @QueryParam("ioutil") List<String> ioutil, @QueryParam("http") List<String> http, @QueryParam("url") List<String> url, @QueryParam("context") List<String> context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map<String, String> language) throws ApiException, ProcessingException;
Expand Down
Loading