From 705261978dab70980e2ab96b829de3dbdaa21d71 Mon Sep 17 00:00:00 2001 From: Qluxzz Date: Wed, 27 Nov 2024 08:44:21 +0100 Subject: [PATCH 01/40] [Elm] Fix not compiling all elm files in test suite (#20191) * Fix not trying to compile all elm files * Validate that changes to pipeline works --- .github/workflows/samples-elm.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/samples-elm.yaml b/.github/workflows/samples-elm.yaml index a9dad78925a6..b494ffaf4b09 100644 --- a/.github/workflows/samples-elm.yaml +++ b/.github/workflows/samples-elm.yaml @@ -3,10 +3,12 @@ name: Samples Elm on: push: paths: + - .github/workflows/samples-elm.yaml - samples/client/petstore/elm/** - samples/openapi3/client/elm/** pull_request: paths: + - .github/workflows/samples-elm.yaml - samples/client/petstore/elm/** - samples/openapi3/client/elm/** jobs: @@ -32,4 +34,4 @@ jobs: # An .elm file couldn't be compiled # No .elm files were found # No elm.json file could be found in the root of the working directory - run: elm make $(find . -name *.elm) --output=/dev/null + run: elm make $(find . -name "*.elm") --output=/dev/null From 8a94fc667ec8e23fb322f6316b84aba25fad87a8 Mon Sep 17 00:00:00 2001 From: Per Hallgren Date: Wed, 27 Nov 2024 11:09:11 +0100 Subject: [PATCH 02/40] [BUG][GO] use value receiver for JSON marshal (#19962) * chore(go): add failing test for JSON marshalling Adds a small schema (FruitJuice) which contains a required gmFruit, which inherits using AnyOf. This fails to correctly marshal as JSON. * fix(go): use non-pointer receiver for JSON marshal In the case of a required anyOf property, JSON marshalling would has been incorrect. Required properties are not nullable, and thus always use value receivers. For the single case of anyOf models, a pointer receiver was used for MarshalJSON. All other instances of json marshalling use value receivers. This change is simply to use a value receiver instead of a pointer receiver in the template for `MarshalJSON` on anyOf models. --------- Co-authored-by: Per Hallgren --- .../main/resources/go/model_anyof.mustache | 2 +- ...odels-for-testing-with-http-signature.yaml | 28 +-- .../go/oneof-anyof-required/model_object2.go | 2 +- .../go/go-petstore/.openapi-generator/FILES | 2 + .../client/petstore/go/go-petstore/README.md | 1 + .../petstore/go/go-petstore/api/openapi.yaml | 26 ++- .../petstore/go/go-petstore/docs/FakeAPI.md | 2 +- .../petstore/go/go-petstore/docs/FilterAny.md | 35 +++- .../go/go-petstore/docs/FilterTypeRange.md | 23 +-- .../go/go-petstore/docs/FilterTypeRegex.md | 23 +-- .../go/go-petstore/docs/FruitJuice.md | 51 +++++ .../model_any_of_primitive_type.go | 2 +- .../go/go-petstore/model_filter_any.go | 2 +- .../go/go-petstore/model_filter_type_range.go | 70 +------ .../go/go-petstore/model_filter_type_regex.go | 70 +------ .../go/go-petstore/model_fruit_juice.go | 186 ++++++++++++++++++ .../petstore/go/go-petstore/model_gm_fruit.go | 2 +- samples/openapi3/client/petstore/go/go.mod | 6 +- samples/openapi3/client/petstore/go/go.sum | 11 ++ .../openapi3/client/petstore/go/model_test.go | 18 ++ 20 files changed, 348 insertions(+), 214 deletions(-) create mode 100644 samples/openapi3/client/petstore/go/go-petstore/docs/FruitJuice.md create mode 100644 samples/openapi3/client/petstore/go/go-petstore/model_fruit_juice.go diff --git a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache index 5e2d57aad107..21e33137403a 100644 --- a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache @@ -68,7 +68,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } // Marshal data from the first non-nil pointers in the struct to JSON -func (src *{{classname}}) MarshalJSON() ([]byte, error) { +func (src {{classname}}) MarshalJSON() ([]byte, error) { {{#anyOf}} if src.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} != nil { return json.Marshal(&src.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}) diff --git a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index f02e8d9e6c2b..faed76ea4927 100644 --- a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1394,11 +1394,6 @@ components: FilterTypeRegex: type: object properties: - type: - enum: - - set - - range - type: string regex: type: string required: @@ -1406,11 +1401,6 @@ components: FilterTypeRange: type: object properties: - type: - enum: - - set - - range - type: string data: type: array items: @@ -1425,7 +1415,16 @@ components: mapping: set: '#/components/schemas/FilterTypeRegex' range: '#/components/schemas/FilterTypeRange' - propertyName: type + propertyName: type + properties: + type: + enum: + - set + - range + type: string + date: + type: string + format: date-time MapWithDateTime: type: object additionalProperties: @@ -2119,6 +2118,13 @@ components: type: string required: - className + fruitJuice: + type: object + required: + - fruit + properties: + fruit: + $ref: '#/components/schemas/gmFruit' gmFruit: properties: color: diff --git a/samples/client/others/go/oneof-anyof-required/model_object2.go b/samples/client/others/go/oneof-anyof-required/model_object2.go index ee4ff5ec523e..462b5429f900 100644 --- a/samples/client/others/go/oneof-anyof-required/model_object2.go +++ b/samples/client/others/go/oneof-anyof-required/model_object2.go @@ -55,7 +55,7 @@ func (dst *Object2) UnmarshalJSON(data []byte) error { } // Marshal data from the first non-nil pointers in the struct to JSON -func (src *Object2) MarshalJSON() ([]byte, error) { +func (src Object2) MarshalJSON() ([]byte, error) { if src.NestedObject1 != nil { return json.Marshal(&src.NestedObject1) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES index 78d7498ae37b..e6cac5bc3f30 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -47,6 +47,7 @@ docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md docs/Fruit.md +docs/FruitJuice.md docs/FruitReq.md docs/GmFruit.md docs/HasOnlyReadOnly.md @@ -126,6 +127,7 @@ model_filter_type_regex.go model_foo.go model_format_test_.go model_fruit.go +model_fruit_juice.go model_fruit_req.go model_gm_fruit.go model_has_only_read_only.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index b437572d32cf..c346c1155cff 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -161,6 +161,7 @@ Class | Method | HTTP request | Description - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) + - [FruitJuice](docs/FruitJuice.md) - [FruitReq](docs/FruitReq.md) - [GmFruit](docs/GmFruit.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 3a8b28a21ae9..580a6c45a238 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1296,11 +1296,6 @@ components: schemas: FilterTypeRegex: properties: - type: - enum: - - set - - range - type: string regex: type: string required: @@ -1308,11 +1303,6 @@ components: type: object FilterTypeRange: properties: - type: - enum: - - set - - range - type: string data: items: type: string @@ -1329,6 +1319,15 @@ components: set: '#/components/schemas/FilterTypeRegex' range: '#/components/schemas/FilterTypeRange' propertyName: type + properties: + type: + enum: + - set + - range + type: string + date: + format: date-time + type: string MapWithDateTime: additionalProperties: items: @@ -2101,6 +2100,13 @@ components: required: - className type: object + fruitJuice: + properties: + fruit: + $ref: '#/components/schemas/gmFruit' + required: + - fruit + type: object gmFruit: anyOf: - $ref: '#/components/schemas/apple' diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md index 5a6d632f7c40..f533a395e2fa 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md @@ -1197,7 +1197,7 @@ import ( ) func main() { - filter := *openapiclient.NewFilterAny("Type_example") // FilterAny | (optional) + filter := *openapiclient.NewFilterAny() // FilterAny | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FilterAny.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FilterAny.md index beada8f60c06..350b5e261217 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FilterAny.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FilterAny.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | +**Type** | Pointer to **string** | | [optional] +**Date** | Pointer to **time.Time** | | [optional] **Regex** | Pointer to **string** | | [optional] **Data** | Pointer to **[]string** | | [optional] @@ -12,7 +13,7 @@ Name | Type | Description | Notes ### NewFilterAny -`func NewFilterAny(type_ string, ) *FilterAny` +`func NewFilterAny() *FilterAny` NewFilterAny instantiates a new FilterAny object This constructor will assign default values to properties that have it defined, @@ -46,6 +47,36 @@ and a boolean to check if the value has been set. SetType sets Type field to given value. +### HasType + +`func (o *FilterAny) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetDate + +`func (o *FilterAny) GetDate() time.Time` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *FilterAny) GetDateOk() (*time.Time, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDate + +`func (o *FilterAny) SetDate(v time.Time)` + +SetDate sets Date field to given value. + +### HasDate + +`func (o *FilterAny) HasDate() bool` + +HasDate returns a boolean if a field has been set. ### GetRegex diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRange.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRange.md index 436cb910496c..41e657a60169 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRange.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRange.md @@ -4,14 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | **Data** | Pointer to **[]string** | | [optional] ## Methods ### NewFilterTypeRange -`func NewFilterTypeRange(type_ string, ) *FilterTypeRange` +`func NewFilterTypeRange() *FilterTypeRange` NewFilterTypeRange instantiates a new FilterTypeRange object This constructor will assign default values to properties that have it defined, @@ -26,26 +25,6 @@ NewFilterTypeRangeWithDefaults instantiates a new FilterTypeRange object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetType - -`func (o *FilterTypeRange) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *FilterTypeRange) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *FilterTypeRange) SetType(v string)` - -SetType sets Type field to given value. - - ### GetData `func (o *FilterTypeRange) GetData() []string` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRegex.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRegex.md index e11048f19aa9..96946b3f56d2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRegex.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRegex.md @@ -4,14 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | **Regex** | Pointer to **string** | | [optional] ## Methods ### NewFilterTypeRegex -`func NewFilterTypeRegex(type_ string, ) *FilterTypeRegex` +`func NewFilterTypeRegex() *FilterTypeRegex` NewFilterTypeRegex instantiates a new FilterTypeRegex object This constructor will assign default values to properties that have it defined, @@ -26,26 +25,6 @@ NewFilterTypeRegexWithDefaults instantiates a new FilterTypeRegex object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetType - -`func (o *FilterTypeRegex) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *FilterTypeRegex) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *FilterTypeRegex) SetType(v string)` - -SetType sets Type field to given value. - - ### GetRegex `func (o *FilterTypeRegex) GetRegex() string` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FruitJuice.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FruitJuice.md new file mode 100644 index 000000000000..fe9d41d74705 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FruitJuice.md @@ -0,0 +1,51 @@ +# FruitJuice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Fruit** | [**GmFruit**](GmFruit.md) | | + +## Methods + +### NewFruitJuice + +`func NewFruitJuice(fruit GmFruit, ) *FruitJuice` + +NewFruitJuice instantiates a new FruitJuice object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFruitJuiceWithDefaults + +`func NewFruitJuiceWithDefaults() *FruitJuice` + +NewFruitJuiceWithDefaults instantiates a new FruitJuice object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFruit + +`func (o *FruitJuice) GetFruit() GmFruit` + +GetFruit returns the Fruit field if non-nil, zero value otherwise. + +### GetFruitOk + +`func (o *FruitJuice) GetFruitOk() (*GmFruit, bool)` + +GetFruitOk returns a tuple with the Fruit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFruit + +`func (o *FruitJuice) SetFruit(v GmFruit)` + +SetFruit sets Fruit field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go b/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go index c18a0c8a2153..81a52e465acf 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go @@ -69,7 +69,7 @@ func (dst *AnyOfPrimitiveType) UnmarshalJSON(data []byte) error { } // Marshal data from the first non-nil pointers in the struct to JSON -func (src *AnyOfPrimitiveType) MarshalJSON() ([]byte, error) { +func (src AnyOfPrimitiveType) MarshalJSON() ([]byte, error) { if src.OneOfPrimitiveTypeChild != nil { return json.Marshal(&src.OneOfPrimitiveTypeChild) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_filter_any.go b/samples/openapi3/client/petstore/go/go-petstore/model_filter_any.go index f2785ce45ee0..8c1cb3803664 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_filter_any.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_filter_any.go @@ -128,7 +128,7 @@ func (dst *FilterAny) UnmarshalJSON(data []byte) error { } // Marshal data from the first non-nil pointers in the struct to JSON -func (src *FilterAny) MarshalJSON() ([]byte, error) { +func (src FilterAny) MarshalJSON() ([]byte, error) { if src.FilterTypeRange != nil { return json.Marshal(&src.FilterTypeRange) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_range.go b/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_range.go index cfb9c006444c..fb7eeebbcaae 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_range.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_range.go @@ -12,7 +12,6 @@ package petstore import ( "encoding/json" - "fmt" ) // checks if the FilterTypeRange type satisfies the MappedNullable interface at compile time @@ -20,7 +19,6 @@ var _ MappedNullable = &FilterTypeRange{} // FilterTypeRange struct for FilterTypeRange type FilterTypeRange struct { - Type string `json:"type"` Data []string `json:"data,omitempty"` AdditionalProperties map[string]interface{} } @@ -31,9 +29,8 @@ type _FilterTypeRange FilterTypeRange // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFilterTypeRange(type_ string) *FilterTypeRange { +func NewFilterTypeRange() *FilterTypeRange { this := FilterTypeRange{} - this.Type = type_ return &this } @@ -45,31 +42,6 @@ func NewFilterTypeRangeWithDefaults() *FilterTypeRange { return &this } -// GetType returns the Type field value -func (o *FilterTypeRange) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *FilterTypeRange) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *FilterTypeRange) SetType(v string) { - o.Type = v -} - - // GetData returns the Data field value if set, zero value otherwise. func (o *FilterTypeRange) GetData() []string { if o == nil || IsNil(o.Data) { @@ -112,7 +84,6 @@ func (o FilterTypeRange) MarshalJSON() ([]byte, error) { func (o FilterTypeRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type if !IsNil(o.Data) { toSerialize["data"] = o.Data } @@ -125,44 +96,6 @@ func (o FilterTypeRange) ToMap() (map[string]interface{}, error) { } func (o *FilterTypeRange) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - // defaultValueFuncMap captures the default values for required properties. - // These values are used when required properties are missing from the payload. - defaultValueFuncMap := map[string]func() interface{} { - } - var defaultValueApplied bool - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if value, exists := allProperties[requiredProperty]; !exists || value == "" { - if _, ok := defaultValueFuncMap[requiredProperty]; ok { - allProperties[requiredProperty] = defaultValueFuncMap[requiredProperty]() - defaultValueApplied = true - } - } - if value, exists := allProperties[requiredProperty]; !exists || value == ""{ - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - if defaultValueApplied { - data, err = json.Marshal(allProperties) - if err != nil{ - return err - } - } varFilterTypeRange := _FilterTypeRange{} err = json.Unmarshal(data, &varFilterTypeRange) @@ -176,7 +109,6 @@ func (o *FilterTypeRange) UnmarshalJSON(data []byte) (err error) { additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") delete(additionalProperties, "data") o.AdditionalProperties = additionalProperties } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_regex.go b/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_regex.go index 7ee6c5013cb2..c38d1bfdd0de 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_regex.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_filter_type_regex.go @@ -12,7 +12,6 @@ package petstore import ( "encoding/json" - "fmt" ) // checks if the FilterTypeRegex type satisfies the MappedNullable interface at compile time @@ -20,7 +19,6 @@ var _ MappedNullable = &FilterTypeRegex{} // FilterTypeRegex struct for FilterTypeRegex type FilterTypeRegex struct { - Type string `json:"type"` Regex *string `json:"regex,omitempty"` AdditionalProperties map[string]interface{} } @@ -31,9 +29,8 @@ type _FilterTypeRegex FilterTypeRegex // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFilterTypeRegex(type_ string) *FilterTypeRegex { +func NewFilterTypeRegex() *FilterTypeRegex { this := FilterTypeRegex{} - this.Type = type_ return &this } @@ -45,31 +42,6 @@ func NewFilterTypeRegexWithDefaults() *FilterTypeRegex { return &this } -// GetType returns the Type field value -func (o *FilterTypeRegex) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *FilterTypeRegex) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *FilterTypeRegex) SetType(v string) { - o.Type = v -} - - // GetRegex returns the Regex field value if set, zero value otherwise. func (o *FilterTypeRegex) GetRegex() string { if o == nil || IsNil(o.Regex) { @@ -112,7 +84,6 @@ func (o FilterTypeRegex) MarshalJSON() ([]byte, error) { func (o FilterTypeRegex) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type if !IsNil(o.Regex) { toSerialize["regex"] = o.Regex } @@ -125,44 +96,6 @@ func (o FilterTypeRegex) ToMap() (map[string]interface{}, error) { } func (o *FilterTypeRegex) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - // defaultValueFuncMap captures the default values for required properties. - // These values are used when required properties are missing from the payload. - defaultValueFuncMap := map[string]func() interface{} { - } - var defaultValueApplied bool - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if value, exists := allProperties[requiredProperty]; !exists || value == "" { - if _, ok := defaultValueFuncMap[requiredProperty]; ok { - allProperties[requiredProperty] = defaultValueFuncMap[requiredProperty]() - defaultValueApplied = true - } - } - if value, exists := allProperties[requiredProperty]; !exists || value == ""{ - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - if defaultValueApplied { - data, err = json.Marshal(allProperties) - if err != nil{ - return err - } - } varFilterTypeRegex := _FilterTypeRegex{} err = json.Unmarshal(data, &varFilterTypeRegex) @@ -176,7 +109,6 @@ func (o *FilterTypeRegex) UnmarshalJSON(data []byte) (err error) { additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") delete(additionalProperties, "regex") o.AdditionalProperties = additionalProperties } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_juice.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_juice.go new file mode 100644 index 000000000000..972b53f000e5 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_juice.go @@ -0,0 +1,186 @@ +/* +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore + +import ( + "encoding/json" + "fmt" +) + +// checks if the FruitJuice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FruitJuice{} + +// FruitJuice struct for FruitJuice +type FruitJuice struct { + Fruit GmFruit `json:"fruit"` + AdditionalProperties map[string]interface{} +} + +type _FruitJuice FruitJuice + +// NewFruitJuice instantiates a new FruitJuice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFruitJuice(fruit GmFruit) *FruitJuice { + this := FruitJuice{} + this.Fruit = fruit + return &this +} + +// NewFruitJuiceWithDefaults instantiates a new FruitJuice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFruitJuiceWithDefaults() *FruitJuice { + this := FruitJuice{} + return &this +} + +// GetFruit returns the Fruit field value +func (o *FruitJuice) GetFruit() GmFruit { + if o == nil { + var ret GmFruit + return ret + } + + return o.Fruit +} + +// GetFruitOk returns a tuple with the Fruit field value +// and a boolean to check if the value has been set. +func (o *FruitJuice) GetFruitOk() (*GmFruit, bool) { + if o == nil { + return nil, false + } + return &o.Fruit, true +} + +// SetFruit sets field value +func (o *FruitJuice) SetFruit(v GmFruit) { + o.Fruit = v +} + + +func (o FruitJuice) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FruitJuice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["fruit"] = o.Fruit + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FruitJuice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "fruit", + } + + // defaultValueFuncMap captures the default values for required properties. + // These values are used when required properties are missing from the payload. + defaultValueFuncMap := map[string]func() interface{} { + } + var defaultValueApplied bool + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if value, exists := allProperties[requiredProperty]; !exists || value == "" { + if _, ok := defaultValueFuncMap[requiredProperty]; ok { + allProperties[requiredProperty] = defaultValueFuncMap[requiredProperty]() + defaultValueApplied = true + } + } + if value, exists := allProperties[requiredProperty]; !exists || value == ""{ + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + if defaultValueApplied { + data, err = json.Marshal(allProperties) + if err != nil{ + return err + } + } + varFruitJuice := _FruitJuice{} + + err = json.Unmarshal(data, &varFruitJuice) + + if err != nil { + return err + } + + *o = FruitJuice(varFruitJuice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "fruit") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFruitJuice struct { + value *FruitJuice + isSet bool +} + +func (v NullableFruitJuice) Get() *FruitJuice { + return v.value +} + +func (v *NullableFruitJuice) Set(val *FruitJuice) { + v.value = val + v.isSet = true +} + +func (v NullableFruitJuice) IsSet() bool { + return v.isSet +} + +func (v *NullableFruitJuice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFruitJuice(val *FruitJuice) *NullableFruitJuice { + return &NullableFruitJuice{value: val, isSet: true} +} + +func (v NullableFruitJuice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFruitJuice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go index 59c6cbea0d1b..8823193a061b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go @@ -55,7 +55,7 @@ func (dst *GmFruit) UnmarshalJSON(data []byte) error { } // Marshal data from the first non-nil pointers in the struct to JSON -func (src *GmFruit) MarshalJSON() ([]byte, error) { +func (src GmFruit) MarshalJSON() ([]byte, error) { if src.Apple != nil { return json.Marshal(&src.Apple) } diff --git a/samples/openapi3/client/petstore/go/go.mod b/samples/openapi3/client/petstore/go/go.mod index 6f5244096148..98cece85532f 100644 --- a/samples/openapi3/client/petstore/go/go.mod +++ b/samples/openapi3/client/petstore/go/go.mod @@ -6,10 +6,10 @@ replace go-petstore => ./go-petstore require ( cloud.google.com/go/compute v1.20.1 // indirect - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go-petstore v0.0.0-00010101000000-000000000000 - golang.org/x/net v0.27.0 // indirect - golang.org/x/oauth2 v0.21.0 + golang.org/x/net v0.31.0 // indirect + golang.org/x/oauth2 v0.24.0 google.golang.org/protobuf v1.31.0 // indirect gopkg.in/validator.v2 v2.0.1 // indirect ) diff --git a/samples/openapi3/client/petstore/go/go.sum b/samples/openapi3/client/petstore/go/go.sum index 3dda4241110b..857525aa9d07 100644 --- a/samples/openapi3/client/petstore/go/go.sum +++ b/samples/openapi3/client/petstore/go/go.sum @@ -859,6 +859,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -898,6 +900,7 @@ golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1m golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1040,6 +1043,8 @@ golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1087,6 +1092,8 @@ golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1107,6 +1114,7 @@ golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1192,6 +1200,7 @@ golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1209,6 +1218,7 @@ golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1230,6 +1240,7 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/samples/openapi3/client/petstore/go/model_test.go b/samples/openapi3/client/petstore/go/model_test.go index cc6eabbeaa0a..fe4dde50935e 100644 --- a/samples/openapi3/client/petstore/go/model_test.go +++ b/samples/openapi3/client/petstore/go/model_test.go @@ -1,7 +1,9 @@ package main import ( + "bytes" "encoding/json" + "strings" "testing" sw "go-petstore" @@ -63,3 +65,19 @@ func TestRequiredFieldsAreValidated(t *testing.T) { assert.ErrorContains(err, expected, "Pet should return error when missing required fields") } + +func TestRequiredAnyOfMarshalling(t *testing.T) { + // Given + bodyBuf := &bytes.Buffer{} + bananaLengthCm := float32(23.4) + req := &sw.FruitJuice{Fruit: sw.GmFruit{ + Banana: &sw.Banana{LengthCm: &bananaLengthCm}, + }} + + // When + err := json.NewEncoder(bodyBuf).Encode(req) + + // Then + assert.Nil(t, err) + assert.Equal(t, strings.TrimSpace(bodyBuf.String()), "{\"fruit\":{\"lengthCm\":23.4}}") +} From 47665aaa97cb1975c5382165f9048eeb9918034f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Fern=C3=A1ndez?= Date: Wed, 27 Nov 2024 07:16:10 -0300 Subject: [PATCH 03/40] Fix a few issues with the C generator (part 1 version 2) (#14434) * C: add a template for an empty any_type.h header Some generated C apis fail to build because the source files get '#include "any_type.h"' lines, but no such header gets generated. As a simple fix, add a new template for an empty file with that name. This is enough to fix the problem for us, because all the generic type stuff is handled by object_t. * C: fix enums I'm guessing that enums have not been used much with the C generator before, because they always seem to produce code that doesn't build, or that tries to free them after use. This patch fixes all the problems we've encountered so far, except for those that need checking the return type. I'll come back to that later. * C: fix confusion of 'classname'/'classFilename' * C: fix issues with returned enums Currently, the C templates never check if a function returns an enum inside mustache, so when that happens the generated code has broken return types and doesn't build. I originally tried to fix this by extending CodegenOperation to implement a 'returnTypeIsEnum' check, but William Cheng suggested[1] that I use the existing 'returnProperty' instead: https://github.com/OpenAPITools/openapi-generator/pull/14379#discussion_r1064636735 So do that. * C: update the samples As required for a pull request, run the generate-samples.sh script and commit the changes. * update samples --------- Co-authored-by: William Cheng --- .../languages/CLibcurlClientCodegen.java | 1 + .../C-libcurl/CMakeLists.txt.mustache | 1 + .../C-libcurl/any_type-header.mustache | 5 +++ .../resources/C-libcurl/api-body.mustache | 14 ++++---- .../resources/C-libcurl/api-header.mustache | 2 +- .../resources/C-libcurl/model-body.mustache | 34 ++++++++++++++++--- .../resources/C-libcurl/model-header.mustache | 16 +++++++-- .../.openapi-generator/FILES | 1 + .../c-useJsonUnformatted/CMakeLists.txt | 1 + .../c-useJsonUnformatted/model/any_type.h | 5 +++ .../petstore/c/.openapi-generator/FILES | 1 + samples/client/petstore/c/model/any_type.h | 5 +++ 12 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/C-libcurl/any_type-header.mustache create mode 100644 samples/client/petstore/c-useJsonUnformatted/model/any_type.h create mode 100644 samples/client/petstore/c/model/any_type.h diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index b6864a92cc1e..397c1c666045 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -368,6 +368,7 @@ public void processOpts() { // Object files in model folder supportingFiles.add(new SupportingFile("object-body.mustache", "model", "object.c")); supportingFiles.add(new SupportingFile("object-header.mustache", "model", "object.h")); + supportingFiles.add(new SupportingFile("any_type-header.mustache", "model", "any_type.h")); } @Override diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 34c311601440..eafd251fced4 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -76,6 +76,7 @@ set(HDRS include/keyValuePair.h external/cJSON.h model/object.h + model/any_type.h {{#models}} {{#model}} model/{{classFilename}}.h diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/any_type-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/any_type-header.mustache new file mode 100644 index 000000000000..7bdc92487f5b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/C-libcurl/any_type-header.mustache @@ -0,0 +1,5 @@ +/* + * any_type.h + * + * A placeholder for now, this type isn't really needed. + */ diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 8f04538fa163..191a408cbd1e 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -98,7 +98,7 @@ end: // {{{.}}} // {{/notes}} -{{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} +{{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#returnProperty}}{{^isEnum}}{{{returnType}}}_t*{{/isEnum}}{{#isEnum}}{{projectName}}_{{{returnType}}}_{{returnEnumName}}_e{{/isEnum}}{{/returnProperty}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} {{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}} {{/isNumber}}{{#isLong}}{{{dataType}}} {{/isLong}}{{#isInteger}}{{{dataType}}} *{{/isInteger}}{{#isDouble}}{{{dataType}}} {{/isDouble}}{{#isFloat}}{{{dataType}}} {{/isFloat}}{{#isBoolean}}{{dataType}} *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e {{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}} {{/isDate}}{{#isDateTime}}{{{dataType}}} {{/isDateTime}}{{#isFile}}{{{dataType}}} {{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e {{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e {{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}} {{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}{{dataType}}_t *{{/isArray}}{{#isMap}}{{dataType}} {{/isMap}}{{/isContainer}}{{{paramName}}}{{/allParams}}) { list_t *localVarQueryParameters = {{#hasQueryParams}}list_createList();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} @@ -263,7 +263,7 @@ end: {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueForm_{{paramName}} = 0; keyValuePair_t *keyPairForm_{{paramName}} = 0; {{/isFile}} - if ({{paramName}} != NULL) + if ({{paramName}} != {{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}}) { {{#isFile}} keyForm_{{paramName}} = strdup("{{{baseName}}}"); @@ -399,9 +399,9 @@ end: {{^returnContainer}} //nonprimitive not container cJSON *{{classname}}localVarJSON = cJSON_Parse(apiClient->dataReceived); - {{{returnBaseType}}}_t *elementToReturn = {{{returnBaseType}}}_parseFromJSON({{classname}}localVarJSON); + {{#returnProperty}}{{^isEnum}}{{{returnBaseType}}}_t *{{/isEnum}}{{#isEnum}}{{projectName}}_{{{returnType}}}_{{returnEnumName}}_e {{/isEnum}}{{/returnProperty}}elementToReturn = {{{returnBaseType}}}_parseFromJSON({{classname}}localVarJSON); cJSON_Delete({{classname}}localVarJSON); - if(elementToReturn == NULL) { + if(elementToReturn == {{#returnProperty}}{{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}}{{/returnProperty}}) { // return 0; } @@ -524,8 +524,10 @@ end: keyForm_{{{paramName}}} = NULL; } if (valueForm_{{{paramName}}}) { + {{^isEnum}} free(valueForm_{{{paramName}}}); - valueForm_{{{paramName}}} = NULL; + {{/isEnum}} + valueForm_{{{paramName}}} = {{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}}; } free(keyPairForm_{{paramName}}); {{/isString}} @@ -541,7 +543,7 @@ end: return elementToReturn; end: free(localVarPath); - return NULL; + return {{#returnProperty}}{{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}}{{/returnProperty}}; {{/returnType}} {{^returnType}} //No return type diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache index 223043ec1ed6..78ac5f576782 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache @@ -32,7 +32,7 @@ typedef enum { {{projectName}}_{{operationId}}_{{enumName}}_NULL = 0{{#enumVars // {{{.}}} // {{/notes}} -{{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} +{{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#returnProperty}}{{^isEnum}}{{{returnType}}}_t*{{/isEnum}}{{#isEnum}}{{projectName}}_{{{returnType}}}_{{returnEnumName}}_e{{/isEnum}}{{/returnProperty}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} {{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}} {{/isNumber}}{{#isLong}}{{{dataType}}} {{/isLong}}{{#isInteger}}{{{dataType}}} *{{/isInteger}}{{#isDouble}}{{{dataType}}} {{/isDouble}}{{#isFloat}}{{{dataType}}} {{/isFloat}}{{#isBoolean}}{{dataType}} *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e {{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}} {{/isDate}}{{#isDateTime}}{{{dataType}}} {{/isDateTime}}{{#isFile}}{{{dataType}}} {{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e {{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e {{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}} {{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}{{dataType}}_t *{{/isArray}}{{#isMap}}{{dataType}} {{/isMap}}{{/isContainer}}{{{paramName}}}{{/allParams}}); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index 028ea6db4202..af6e1127e5bb 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -25,7 +25,7 @@ char* {{classFilename}}_{{classname}}_ToString({{projectName}}_{{classVarName}}_ return 0; } -cJSON *{{classFilename}}_{{classname}}_convertToJSON({{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}) { +cJSON *{{classname}}_convertToJSON({{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}) { cJSON *item = cJSON_CreateObject(); {{#isString}} if(cJSON_AddStringToObject(item, "{{{classname}}}", {{classFilename}}_{{{classname}}}_ToString({{{classname}}})) == NULL) { @@ -48,7 +48,7 @@ fail: return NULL; } -{{projectName}}_{{classVarName}}_{{enumName}}_e {{classFilename}}_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON) { +{{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}_parseFromJSON(cJSON *{{classname}}JSON) { {{projectName}}_{{classVarName}}_{{enumName}}_e *{{classname}} = NULL; {{#isEnum}} {{#isNumeric}} @@ -75,6 +75,7 @@ end: {{^isEnum}} {{#vars}} {{^isContainer}} + {{#isPrimitiveType}} {{^isModel}} {{#isEnum}} char* {{classname}}_{{name}}_ToString({{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}) { @@ -96,6 +97,7 @@ char* {{classname}}_{{name}}_ToString({{projectName}}_{{classVarName}}_{{enumNam } {{/isEnum}} {{/isModel}} + {{/isPrimitiveType}} {{/isContainer}} {{#isContainer}} {{#items}} @@ -138,7 +140,12 @@ char* {{classname}}_{{name}}_ToString({{projectName}}_{{classVarName}}_{{enumNam {{/isModel}} {{^isModel}} {{^isFreeFormObject}} + {{^isEnum}} {{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isEnum}} + {{#isEnum}} + {{projectName}}_{{dataType}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}} + {{/isEnum}} {{/isFreeFormObject}} {{/isModel}} {{#isUuid}} @@ -227,10 +234,12 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { {{/isModel}} {{^isModel}} {{^isFreeFormObject}} + {{^isEnum}} if ({{{classname}}}->{{{name}}}) { {{{complexType}}}_free({{{classname}}}->{{{name}}}); {{classname}}->{{name}} = NULL; } + {{/isEnum}} {{/isFreeFormObject}} {{/isModel}} {{#isUuid}} @@ -337,7 +346,12 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) { } {{/isEnum}} {{#isEnum}} + {{#isPrimitiveType}} if ({{projectName}}_{{classVarName}}_{{enumName}}_NULL == {{{classname}}}->{{{name}}}) { + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if ({{projectName}}_{{dataType}}_{{enumName}}_NULL == {{{classname}}}->{{{name}}}) { + {{/isPrimitiveType}} goto fail; } {{/isEnum}} @@ -347,7 +361,12 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) { if({{{classname}}}->{{{name}}}) { {{/isEnum}} {{#isEnum}} + {{#isPrimitiveType}} if({{{classname}}}->{{{name}}} != {{projectName}}_{{classVarName}}_{{enumName}}_NULL) { + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if({{{classname}}}->{{{name}}} != {{projectName}}_{{dataType}}_{{enumName}}_NULL) { + {{/isPrimitiveType}} {{/isEnum}} {{/required}} {{^isContainer}} @@ -589,7 +608,12 @@ fail: {{^isModel}} {{^isFreeFormObject}} // define the local variable for {{{classname}}}->{{{name}}} + {{^isEnum}} {{complexType}}_t *{{name}}_local_nonprim = NULL; + {{/isEnum}} + {{#isEnum}} + {{projectName}}_{{dataType}}_{{enumName}}_e {{name}}_local_nonprim = 0; + {{/isEnum}} {{/isFreeFormObject}} {{/isModel}} @@ -853,7 +877,7 @@ fail: {{/isModel}} {{^isModel}} {{^isFreeFormObject}} - {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : {{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}}{{/required}}{{^-last}},{{/-last}} {{/isFreeFormObject}} {{/isModel}} {{#isUuid}} @@ -929,8 +953,10 @@ end: {{^isModel}} {{^isFreeFormObject}} if ({{{name}}}_local_nonprim) { + {{^isEnum}} {{complexType}}_free({{{name}}}_local_nonprim); - {{{name}}}_local_nonprim = NULL; + {{/isEnum}} + {{{name}}}_local_nonprim = {{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}}; } {{/isFreeFormObject}} {{/isModel}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache index f86b1ba7edac..d69dc8d5cd34 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache @@ -30,14 +30,15 @@ char* {{classFilename}}_{{classname}}_ToString({{projectName}}_{{classVarName}}_ {{projectName}}_{{classVarName}}_{{enumName}}_e {{classFilename}}_{{classname}}_FromString(char* {{classname}}); -//cJSON *{{classFilename}}_{{classname}}_convertToJSON({{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}); +cJSON *{{classname}}_convertToJSON({{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}); -//{{projectName}}_{{classVarName}}_{{enumName}}_e {{classFilename}}_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON); +{{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}_parseFromJSON(cJSON *{{classname}}JSON); {{/isEnum}} {{^isEnum}} {{#vars}} {{^isContainer}} + {{#isPrimitiveType}} {{^isModel}} {{#isEnum}} // Enum {{enumName}} for {{classVarName}} @@ -52,6 +53,7 @@ char* {{classFilename}}_{{name}}_ToString({{projectName}}_{{classVarName}}_{{enu {{/isEnum}} {{/isModel}} + {{/isPrimitiveType}} {{/isContainer}} {{#isContainer}} {{#items}} @@ -88,7 +90,12 @@ typedef struct {{classname}}_t { {{/isModel}} {{^isModel}} {{^isFreeFormObject}} + {{^isEnum}} {{datatype}}_t *{{name}}; // custom + {{/isEnum}} + {{#isEnum}} + {{projectName}}_{{dataType}}_{{enumName}}_e {{name}}; //referenced enum + {{/isEnum}} {{/isFreeFormObject}} {{/isModel}} {{#isUuid}} @@ -163,7 +170,12 @@ typedef struct {{classname}}_t { {{/isModel}} {{^isModel}} {{^isFreeFormObject}} + {{^isEnum}} {{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isEnum}} + {{#isEnum}} + {{projectName}}_{{dataType}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}} + {{/isEnum}} {{/isFreeFormObject}} {{/isModel}} {{#isUuid}} diff --git a/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES b/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES index de78f2c09bb8..56afd08ac99d 100644 --- a/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES +++ b/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES @@ -26,6 +26,7 @@ include/binary.h include/keyValuePair.h include/list.h libcurl.licence +model/any_type.h model/api_response.c model/api_response.h model/category.c diff --git a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt index 9d01b09104dc..e41b31d33abb 100644 --- a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt +++ b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt @@ -75,6 +75,7 @@ set(HDRS include/keyValuePair.h external/cJSON.h model/object.h + model/any_type.h model/mapped_model.h model/api_response.h model/category.h diff --git a/samples/client/petstore/c-useJsonUnformatted/model/any_type.h b/samples/client/petstore/c-useJsonUnformatted/model/any_type.h new file mode 100644 index 000000000000..7bdc92487f5b --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/model/any_type.h @@ -0,0 +1,5 @@ +/* + * any_type.h + * + * A placeholder for now, this type isn't really needed. + */ diff --git a/samples/client/petstore/c/.openapi-generator/FILES b/samples/client/petstore/c/.openapi-generator/FILES index 974bd47125f3..4f6e6397e71e 100644 --- a/samples/client/petstore/c/.openapi-generator/FILES +++ b/samples/client/petstore/c/.openapi-generator/FILES @@ -25,6 +25,7 @@ include/binary.h include/keyValuePair.h include/list.h libcurl.licence +model/any_type.h model/api_response.c model/api_response.h model/category.c diff --git a/samples/client/petstore/c/model/any_type.h b/samples/client/petstore/c/model/any_type.h new file mode 100644 index 000000000000..7bdc92487f5b --- /dev/null +++ b/samples/client/petstore/c/model/any_type.h @@ -0,0 +1,5 @@ +/* + * any_type.h + * + * A placeholder for now, this type isn't really needed. + */ From f8ca36b97ede3f4b13ea0747a56c796b2f999a2d Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Wed, 27 Nov 2024 15:09:21 +0100 Subject: [PATCH 04/40] =?UTF-8?q?Erlang=20server=20=E2=80=93=20minor=20fix?= =?UTF-8?q?=20to=20return=20type=20and=20generated=20doc=20(#20197)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * erlang-server: add jesse to app.up release * erlang-server: remove dialyzer errors that might not be related to the program * erlang-server: minor fixes to return types and generated docs --- .../src/main/resources/erlang-server/api.mustache | 2 +- .../src/main/resources/erlang-server/logic_handler.mustache | 2 +- samples/server/echo_api/erlang-server/src/openapi_api.erl | 2 +- .../server/echo_api/erlang-server/src/openapi_logic_handler.erl | 2 +- samples/server/petstore/erlang-server/src/openapi_api.erl | 2 +- .../server/petstore/erlang-server/src/openapi_logic_handler.erl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/erlang-server/api.mustache b/modules/openapi-generator/src/main/resources/erlang-server/api.mustache index 1f0a90e2cd96..157e2b7a39ef 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/api.mustache @@ -90,7 +90,7 @@ prepare_validator(SchemaVer) -> prepare_validator(get_openapi_path(), SchemaVer). -doc """ -Loads the JSON schema and the desired validation draft into a `t:jesse_state:state()`. +Loads the JSON schema and the desired validation draft into a `t:jesse_state:state/0`. """. -spec prepare_validator(file:name_all(), binary()) -> jesse_state:state(). prepare_validator(OpenApiPath, SchemaVer) -> diff --git a/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache b/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache index e69edcc81414..3dcaea8c91b2 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache @@ -34,7 +34,7 @@ {accept_callback_return(), cowboy_req:req(), context()}. -callback provide_callback({{packageName}}_api:class(), {{packageName}}_api:operation_id(), cowboy_req:req(), context()) -> - {cowboy_req:resp_body(), cowboy_req:req(), context()}. + {provide_callback_return(), cowboy_req:req(), context()}. -export([api_key_callback/2, accept_callback/4, provide_callback/4]). -ignore_xref([api_key_callback/2, accept_callback/4, provide_callback/4]). diff --git a/samples/server/echo_api/erlang-server/src/openapi_api.erl b/samples/server/echo_api/erlang-server/src/openapi_api.erl index 30e7447bcfbd..f528518af8c5 100644 --- a/samples/server/echo_api/erlang-server/src/openapi_api.erl +++ b/samples/server/echo_api/erlang-server/src/openapi_api.erl @@ -121,7 +121,7 @@ prepare_validator(SchemaVer) -> prepare_validator(get_openapi_path(), SchemaVer). -doc """ -Loads the JSON schema and the desired validation draft into a `t:jesse_state:state()`. +Loads the JSON schema and the desired validation draft into a `t:jesse_state:state/0`. """. -spec prepare_validator(file:name_all(), binary()) -> jesse_state:state(). prepare_validator(OpenApiPath, SchemaVer) -> diff --git a/samples/server/echo_api/erlang-server/src/openapi_logic_handler.erl b/samples/server/echo_api/erlang-server/src/openapi_logic_handler.erl index d47132f08238..b0daeb1f9f55 100644 --- a/samples/server/echo_api/erlang-server/src/openapi_logic_handler.erl +++ b/samples/server/echo_api/erlang-server/src/openapi_logic_handler.erl @@ -34,7 +34,7 @@ {accept_callback_return(), cowboy_req:req(), context()}. -callback provide_callback(openapi_api:class(), openapi_api:operation_id(), cowboy_req:req(), context()) -> - {cowboy_req:resp_body(), cowboy_req:req(), context()}. + {provide_callback_return(), cowboy_req:req(), context()}. -export([api_key_callback/2, accept_callback/4, provide_callback/4]). -ignore_xref([api_key_callback/2, accept_callback/4, provide_callback/4]). diff --git a/samples/server/petstore/erlang-server/src/openapi_api.erl b/samples/server/petstore/erlang-server/src/openapi_api.erl index 42c168b7a731..f8922a379cf2 100644 --- a/samples/server/petstore/erlang-server/src/openapi_api.erl +++ b/samples/server/petstore/erlang-server/src/openapi_api.erl @@ -111,7 +111,7 @@ prepare_validator(SchemaVer) -> prepare_validator(get_openapi_path(), SchemaVer). -doc """ -Loads the JSON schema and the desired validation draft into a `t:jesse_state:state()`. +Loads the JSON schema and the desired validation draft into a `t:jesse_state:state/0`. """. -spec prepare_validator(file:name_all(), binary()) -> jesse_state:state(). prepare_validator(OpenApiPath, SchemaVer) -> diff --git a/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl b/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl index d47132f08238..b0daeb1f9f55 100644 --- a/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl +++ b/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl @@ -34,7 +34,7 @@ {accept_callback_return(), cowboy_req:req(), context()}. -callback provide_callback(openapi_api:class(), openapi_api:operation_id(), cowboy_req:req(), context()) -> - {cowboy_req:resp_body(), cowboy_req:req(), context()}. + {provide_callback_return(), cowboy_req:req(), context()}. -export([api_key_callback/2, accept_callback/4, provide_callback/4]). -ignore_xref([api_key_callback/2, accept_callback/4, provide_callback/4]). From 037cb12f348baa9afffb9d03545e1458e06670da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Fern=C3=A1ndez?= Date: Thu, 28 Nov 2024 05:27:42 -0300 Subject: [PATCH 05/40] Tests for recent C fixes (#20200) * [C] Add test schemas for the recent changes The recent commit 47665aaa97cb ("Fix a few issues with the C generator (part 1 version 2) (#14434)") didn't include any test schemas. Add them now, as requested: https://github.com/OpenAPITools/openapi-generator/pull/14434#issuecomment-2497497110 * Update samples * Fix sample update with missing files * More fixes for sample updates --- .../src/test/resources/2_0/c/petstore.yaml | 35 +++++++ .../.openapi-generator/FILES | 3 + .../c-useJsonUnformatted/CMakeLists.txt | 2 + .../petstore/c-useJsonUnformatted/README.md | 2 + .../c-useJsonUnformatted/api/PetAPI.c | 64 +++++++++++++ .../c-useJsonUnformatted/api/PetAPI.h | 9 ++ .../c-useJsonUnformatted/docs/PetAPI.md | 31 ++++++ .../c-useJsonUnformatted/docs/preference.md | 9 ++ .../c-useJsonUnformatted/docs/user.md | 2 + .../c-useJsonUnformatted/model/preference.c | 47 +++++++++ .../c-useJsonUnformatted/model/preference.h | 32 +++++++ .../c-useJsonUnformatted/model/user.c | 96 ++++++++++++++++++- .../c-useJsonUnformatted/model/user.h | 8 +- .../unit-test/test_preference.c | 56 +++++++++++ .../petstore/c/.openapi-generator/FILES | 3 + samples/client/petstore/c/README.md | 2 + samples/client/petstore/c/api/PetAPI.c | 64 +++++++++++++ samples/client/petstore/c/api/PetAPI.h | 9 ++ samples/client/petstore/c/docs/PetAPI.md | 31 ++++++ samples/client/petstore/c/docs/preference.md | 9 ++ samples/client/petstore/c/docs/user.md | 2 + samples/client/petstore/c/model/preference.c | 47 +++++++++ samples/client/petstore/c/model/preference.h | 32 +++++++ samples/client/petstore/c/model/user.c | 96 ++++++++++++++++++- samples/client/petstore/c/model/user.h | 8 +- .../petstore/c/unit-test/test_preference.c | 56 +++++++++++ 26 files changed, 749 insertions(+), 6 deletions(-) create mode 100644 samples/client/petstore/c-useJsonUnformatted/docs/preference.md create mode 100644 samples/client/petstore/c-useJsonUnformatted/model/preference.c create mode 100644 samples/client/petstore/c-useJsonUnformatted/model/preference.h create mode 100644 samples/client/petstore/c-useJsonUnformatted/unit-test/test_preference.c create mode 100644 samples/client/petstore/c/docs/preference.md create mode 100644 samples/client/petstore/c/model/preference.c create mode 100644 samples/client/petstore/c/model/preference.h create mode 100644 samples/client/petstore/c/unit-test/test_preference.c diff --git a/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml b/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml index c5125f976e74..082c039eadb9 100644 --- a/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml @@ -75,6 +75,24 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + /pet/specialty: + get: + tags: + - pet + summary: Specialty of the shop + description: Returns the kind of pet the store specializes in + operationId: specialtyPet + produces: + - application/xml + - application/json + parameters: [] + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Preference' + security: + - api_key: [] /pet/findByStatus: get: tags: @@ -626,6 +644,17 @@ definitions: type: string xml: name: Category + Preference: + title: Pet preference + description: A user's preference in pets + type: string + enum: + - cats + - dogs + - birds + - fish + - snakes + - other User: title: a User description: A User who is purchasing from the pet store @@ -650,6 +679,12 @@ definitions: type: integer format: int32 description: User Status + extra: + type: object + nullable: true + additionalProperties: true + preference: + $ref: '#/definitions/Preference' xml: name: User Tag: diff --git a/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES b/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES index 56afd08ac99d..043461c7a2e2 100644 --- a/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES +++ b/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES @@ -16,6 +16,7 @@ docs/category.md docs/model_with_set_propertes.md docs/order.md docs/pet.md +docs/preference.md docs/tag.md docs/user.md external/cJSON.c @@ -41,6 +42,8 @@ model/order.c model/order.h model/pet.c model/pet.h +model/preference.c +model/preference.h model/tag.c model/tag.h model/user.c diff --git a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt index e41b31d33abb..7eab107fda2f 100644 --- a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt +++ b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt @@ -60,6 +60,7 @@ set(SRCS model/model_with_set_propertes.c model/order.c model/pet.c + model/preference.c model/tag.c model/user.c api/PetAPI.c @@ -82,6 +83,7 @@ set(HDRS model/model_with_set_propertes.h model/order.h model/pet.h + model/preference.h model/tag.h model/user.h api/PetAPI.h diff --git a/samples/client/petstore/c-useJsonUnformatted/README.md b/samples/client/petstore/c-useJsonUnformatted/README.md index a2724768f151..707999204fbe 100644 --- a/samples/client/petstore/c-useJsonUnformatted/README.md +++ b/samples/client/petstore/c-useJsonUnformatted/README.md @@ -70,6 +70,7 @@ Category | Method | HTTP request | Description *PetAPI* | [**PetAPI_findPetsByStatus**](docs/PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status *PetAPI* | [**PetAPI_findPetsByTags**](docs/PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags *PetAPI* | [**PetAPI_getPetById**](docs/PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetAPI* | [**PetAPI_specialtyPet**](docs/PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop *PetAPI* | [**PetAPI_updatePet**](docs/PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet *PetAPI* | [**PetAPI_updatePetWithForm**](docs/PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetAPI* | [**PetAPI_uploadFile**](docs/PetAPI.md#PetAPI_uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image @@ -96,6 +97,7 @@ Category | Method | HTTP request | Description - [model_with_set_propertes_t](docs/model_with_set_propertes.md) - [order_t](docs/order.md) - [pet_t](docs/pet.md) + - [preference_t](docs/preference.md) - [tag_t](docs/tag.md) - [user_t](docs/user.md) diff --git a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c index f17d4fd0c26b..6cb279c58bb3 100644 --- a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c +++ b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c @@ -460,6 +460,70 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId) } +// Specialty of the shop +// +// Returns the kind of pet the store specializes in +// +openapi_petstore_preference__e +PetAPI_specialtyPet(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/specialty")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/specialty"); + + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","successful operation"); + //} + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + openapi_petstore_preference__e elementToReturn = preference_parseFromJSON(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); + if(elementToReturn == 0) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return 0; + +} + // Update an existing pet // void diff --git a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h index 9b5c586fda78..d33d0394b2d5 100644 --- a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h +++ b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h @@ -7,6 +7,7 @@ #include "../include/binary.h" #include "../model/api_response.h" #include "../model/pet.h" +#include "../model/preference.h" // Enum STATUS for PetAPI_findPetsByStatus typedef enum { openapi_petstore_findPetsByStatus_STATUS_NULL = 0, openapi_petstore_findPetsByStatus_STATUS_available, openapi_petstore_findPetsByStatus_STATUS_pending, openapi_petstore_findPetsByStatus_STATUS_sold } openapi_petstore_findPetsByStatus_status_e; @@ -48,6 +49,14 @@ pet_t* PetAPI_getPetById(apiClient_t *apiClient, long petId); +// Specialty of the shop +// +// Returns the kind of pet the store specializes in +// +openapi_petstore_preference__e +PetAPI_specialtyPet(apiClient_t *apiClient); + + // Update an existing pet // void diff --git a/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md b/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md index 392ef4d08a7d..bcdc9e8e1c36 100644 --- a/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md +++ b/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**PetAPI_findPetsByStatus**](PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**PetAPI_findPetsByTags**](PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**PetAPI_getPetById**](PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +[**PetAPI_specialtyPet**](PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop [**PetAPI_updatePet**](PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet [**PetAPI_updatePetWithForm**](PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**PetAPI_uploadFile**](PetAPI.md#PetAPI_uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image @@ -153,6 +154,36 @@ Name | Type | Description | Notes [pet_t](pet.md) * +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PetAPI_specialtyPet** +```c +// Specialty of the shop +// +// Returns the kind of pet the store specializes in +// +preference_t* PetAPI_specialtyPet(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[preference_t](preference.md) * + + ### Authorization [api_key](../README.md#api_key) diff --git a/samples/client/petstore/c-useJsonUnformatted/docs/preference.md b/samples/client/petstore/c-useJsonUnformatted/docs/preference.md new file mode 100644 index 000000000000..ab63d47cb7e8 --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/docs/preference.md @@ -0,0 +1,9 @@ +# preference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/c-useJsonUnformatted/docs/user.md b/samples/client/petstore/c-useJsonUnformatted/docs/user.md index 3b9219c158b5..22b807f47efa 100644 --- a/samples/client/petstore/c-useJsonUnformatted/docs/user.md +++ b/samples/client/petstore/c-useJsonUnformatted/docs/user.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **password** | **char \*** | | [optional] **phone** | **char \*** | | [optional] **user_status** | **int** | User Status | [optional] +**extra** | **list_t*** | | [optional] +**preference** | **preference_t \*** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/c-useJsonUnformatted/model/preference.c b/samples/client/petstore/c-useJsonUnformatted/model/preference.c new file mode 100644 index 000000000000..ac7e600fed02 --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/model/preference.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include "preference.h" + + +char* preference_preference_ToString(openapi_petstore_preference__e preference) { + char *preferenceArray[] = { "NULL", "cats", "dogs", "birds", "fish", "snakes", "other" }; + return preferenceArray[preference]; +} + +openapi_petstore_preference__e preference_preference_FromString(char* preference) { + int stringToReturn = 0; + char *preferenceArray[] = { "NULL", "cats", "dogs", "birds", "fish", "snakes", "other" }; + size_t sizeofArray = sizeof(preferenceArray) / sizeof(preferenceArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(preference, preferenceArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + +cJSON *preference_convertToJSON(openapi_petstore_preference__e preference) { + cJSON *item = cJSON_CreateObject(); + if(cJSON_AddStringToObject(item, "preference", preference_preference_ToString(preference)) == NULL) { + goto fail; + } + return item; +fail: + cJSON_Delete(item); + return NULL; +} + +openapi_petstore_preference__e preference_parseFromJSON(cJSON *preferenceJSON) { + openapi_petstore_preference__e *preference = NULL; + openapi_petstore_preference__e preferenceVariable; + cJSON *preferenceVar = cJSON_GetObjectItemCaseSensitive(preferenceJSON, "preference"); + if(!cJSON_IsString(preferenceVar) || (preferenceVar->valuestring == NULL)){ + goto end; + } + preferenceVariable = preference_preference_FromString(preferenceVar->valuestring); + return preferenceVariable; +end: + return 0; +} diff --git a/samples/client/petstore/c-useJsonUnformatted/model/preference.h b/samples/client/petstore/c-useJsonUnformatted/model/preference.h new file mode 100644 index 000000000000..1f6644f08361 --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/model/preference.h @@ -0,0 +1,32 @@ +/* + * preference.h + * + * A user's preference in pets + */ + +#ifndef _preference_H_ +#define _preference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct preference_t preference_t; + + +// Enum for preference + +typedef enum { openapi_petstore_preference__NULL = 0, openapi_petstore_preference__cats, openapi_petstore_preference__dogs, openapi_petstore_preference__birds, openapi_petstore_preference__fish, openapi_petstore_preference__snakes, openapi_petstore_preference__other } openapi_petstore_preference__e; + +char* preference_preference_ToString(openapi_petstore_preference__e preference); + +openapi_petstore_preference__e preference_preference_FromString(char* preference); + +cJSON *preference_convertToJSON(openapi_petstore_preference__e preference); + +openapi_petstore_preference__e preference_parseFromJSON(cJSON *preferenceJSON); + +#endif /* _preference_H_ */ + diff --git a/samples/client/petstore/c-useJsonUnformatted/model/user.c b/samples/client/petstore/c-useJsonUnformatted/model/user.c index eb188153ccf0..b43d428e1ffa 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/user.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/user.c @@ -13,7 +13,9 @@ user_t *user_create( char *email, char *password, char *phone, - int user_status + int user_status, + list_t* extra, + openapi_petstore_preference__e preference ) { user_t *user_local_var = malloc(sizeof(user_t)); if (!user_local_var) { @@ -27,6 +29,8 @@ user_t *user_create( user_local_var->password = password; user_local_var->phone = phone; user_local_var->user_status = user_status; + user_local_var->extra = extra; + user_local_var->preference = preference; return user_local_var; } @@ -61,6 +65,16 @@ void user_free(user_t *user) { free(user->phone); user->phone = NULL; } + if (user->extra) { + list_ForEach(listEntry, user->extra) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(user->extra); + user->extra = NULL; + } free(user); } @@ -130,6 +144,35 @@ cJSON *user_convertToJSON(user_t *user) { } } + + // user->extra + if(user->extra) { + cJSON *extra = cJSON_AddObjectToObject(item, "extra"); + if(extra == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = extra; + listEntry_t *extraListEntry; + if (user->extra) { + list_ForEach(extraListEntry, user->extra) { + keyValuePair_t *localKeyValue = (keyValuePair_t*)extraListEntry->data; + } + } + } + + + // user->preference + if(user->preference != openapi_petstore_preference__NULL) { + cJSON *preference_local_JSON = preference_convertToJSON(user->preference); + if(preference_local_JSON == NULL) { + goto fail; // custom + } + cJSON_AddItemToObject(item, "preference", preference_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + return item; fail: if (item) { @@ -142,6 +185,12 @@ user_t *user_parseFromJSON(cJSON *userJSON){ user_t *user_local_var = NULL; + // define the local map for user->extra + list_t *extraList = NULL; + + // define the local variable for user->preference + openapi_petstore_preference__e preference_local_nonprim = 0; + // user->id cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); if (id) { @@ -214,6 +263,32 @@ user_t *user_parseFromJSON(cJSON *userJSON){ } } + // user->extra + cJSON *extra = cJSON_GetObjectItemCaseSensitive(userJSON, "extra"); + if (extra) { + cJSON *extra_local_map = NULL; + if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(extra)) + { + extraList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(extra_local_map, extra) + { + cJSON *localMapObject = extra_local_map; + list_addElement(extraList , localMapKeyPair); + } + } + } + + // user->preference + cJSON *preference = cJSON_GetObjectItemCaseSensitive(userJSON, "preference"); + if (preference) { + preference_local_nonprim = preference_parseFromJSON(preference); //custom + } + user_local_var = user_create ( id ? id->valuedouble : 0, @@ -223,11 +298,28 @@ user_t *user_parseFromJSON(cJSON *userJSON){ email && !cJSON_IsNull(email) ? strdup(email->valuestring) : NULL, password && !cJSON_IsNull(password) ? strdup(password->valuestring) : NULL, phone && !cJSON_IsNull(phone) ? strdup(phone->valuestring) : NULL, - user_status ? user_status->valuedouble : 0 + user_status ? user_status->valuedouble : 0, + extra ? extraList : NULL, + preference ? preference_local_nonprim : 0 ); return user_local_var; end: + if (extraList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, extraList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(extraList); + extraList = NULL; + } + if (preference_local_nonprim) { + preference_local_nonprim = 0; + } return NULL; } diff --git a/samples/client/petstore/c-useJsonUnformatted/model/user.h b/samples/client/petstore/c-useJsonUnformatted/model/user.h index 45fa42c3f91c..badbc747b308 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/user.h +++ b/samples/client/petstore/c-useJsonUnformatted/model/user.h @@ -15,6 +15,8 @@ typedef struct user_t user_t; +#include "any_type.h" +#include "preference.h" @@ -27,6 +29,8 @@ typedef struct user_t { char *password; // string char *phone; // string int user_status; //numeric + list_t* extra; //map + openapi_petstore_preference__e preference; //referenced enum } user_t; @@ -38,7 +42,9 @@ user_t *user_create( char *email, char *password, char *phone, - int user_status + int user_status, + list_t* extra, + openapi_petstore_preference__e preference ); void user_free(user_t *user); diff --git a/samples/client/petstore/c-useJsonUnformatted/unit-test/test_preference.c b/samples/client/petstore/c-useJsonUnformatted/unit-test/test_preference.c new file mode 100644 index 000000000000..96468361f582 --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/unit-test/test_preference.c @@ -0,0 +1,56 @@ +#ifndef preference_TEST +#define preference_TEST + +// the following is to include only the main from the first c file +#ifndef TEST_MAIN +#define TEST_MAIN +#define preference_MAIN +#endif // TEST_MAIN + +#include +#include +#include +#include +#include "../external/cJSON.h" + +#include "../model/preference.h" +preference_t* instantiate_preference(int include_optional); + + + +preference_t* instantiate_preference(int include_optional) { + preference_t* preference = NULL; + if (include_optional) { + preference = preference_create( + ); + } else { + preference = preference_create( + ); + } + + return preference; +} + + +#ifdef preference_MAIN + +void test_preference(int include_optional) { + preference_t* preference_1 = instantiate_preference(include_optional); + + cJSON* jsonpreference_1 = preference_convertToJSON(preference_1); + printf("preference :\n%s\n", cJSON_PrintUnformatted(jsonpreference_1)); + preference_t* preference_2 = preference_parseFromJSON(jsonpreference_1); + cJSON* jsonpreference_2 = preference_convertToJSON(preference_2); + printf("repeating preference:\n%s\n", cJSON_PrintUnformatted(jsonpreference_2)); +} + +int main() { + test_preference(1); + test_preference(0); + + printf("Hello world \n"); + return 0; +} + +#endif // preference_MAIN +#endif // preference_TEST diff --git a/samples/client/petstore/c/.openapi-generator/FILES b/samples/client/petstore/c/.openapi-generator/FILES index 4f6e6397e71e..eff7ae714342 100644 --- a/samples/client/petstore/c/.openapi-generator/FILES +++ b/samples/client/petstore/c/.openapi-generator/FILES @@ -15,6 +15,7 @@ docs/category.md docs/model_with_set_propertes.md docs/order.md docs/pet.md +docs/preference.md docs/tag.md docs/user.md external/cJSON.c @@ -40,6 +41,8 @@ model/order.c model/order.h model/pet.c model/pet.h +model/preference.c +model/preference.h model/tag.c model/tag.h model/user.c diff --git a/samples/client/petstore/c/README.md b/samples/client/petstore/c/README.md index a2724768f151..707999204fbe 100644 --- a/samples/client/petstore/c/README.md +++ b/samples/client/petstore/c/README.md @@ -70,6 +70,7 @@ Category | Method | HTTP request | Description *PetAPI* | [**PetAPI_findPetsByStatus**](docs/PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status *PetAPI* | [**PetAPI_findPetsByTags**](docs/PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags *PetAPI* | [**PetAPI_getPetById**](docs/PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetAPI* | [**PetAPI_specialtyPet**](docs/PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop *PetAPI* | [**PetAPI_updatePet**](docs/PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet *PetAPI* | [**PetAPI_updatePetWithForm**](docs/PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetAPI* | [**PetAPI_uploadFile**](docs/PetAPI.md#PetAPI_uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image @@ -96,6 +97,7 @@ Category | Method | HTTP request | Description - [model_with_set_propertes_t](docs/model_with_set_propertes.md) - [order_t](docs/order.md) - [pet_t](docs/pet.md) + - [preference_t](docs/preference.md) - [tag_t](docs/tag.md) - [user_t](docs/user.md) diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index 36303a0ef5e0..9cf09a2e4ad9 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -460,6 +460,70 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId) } +// Specialty of the shop +// +// Returns the kind of pet the store specializes in +// +openapi_petstore_preference__e +PetAPI_specialtyPet(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/specialty")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/specialty"); + + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","successful operation"); + //} + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + openapi_petstore_preference__e elementToReturn = preference_parseFromJSON(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); + if(elementToReturn == 0) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return 0; + +} + // Update an existing pet // void diff --git a/samples/client/petstore/c/api/PetAPI.h b/samples/client/petstore/c/api/PetAPI.h index 9b5c586fda78..d33d0394b2d5 100644 --- a/samples/client/petstore/c/api/PetAPI.h +++ b/samples/client/petstore/c/api/PetAPI.h @@ -7,6 +7,7 @@ #include "../include/binary.h" #include "../model/api_response.h" #include "../model/pet.h" +#include "../model/preference.h" // Enum STATUS for PetAPI_findPetsByStatus typedef enum { openapi_petstore_findPetsByStatus_STATUS_NULL = 0, openapi_petstore_findPetsByStatus_STATUS_available, openapi_petstore_findPetsByStatus_STATUS_pending, openapi_petstore_findPetsByStatus_STATUS_sold } openapi_petstore_findPetsByStatus_status_e; @@ -48,6 +49,14 @@ pet_t* PetAPI_getPetById(apiClient_t *apiClient, long petId); +// Specialty of the shop +// +// Returns the kind of pet the store specializes in +// +openapi_petstore_preference__e +PetAPI_specialtyPet(apiClient_t *apiClient); + + // Update an existing pet // void diff --git a/samples/client/petstore/c/docs/PetAPI.md b/samples/client/petstore/c/docs/PetAPI.md index 392ef4d08a7d..bcdc9e8e1c36 100644 --- a/samples/client/petstore/c/docs/PetAPI.md +++ b/samples/client/petstore/c/docs/PetAPI.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**PetAPI_findPetsByStatus**](PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**PetAPI_findPetsByTags**](PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**PetAPI_getPetById**](PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +[**PetAPI_specialtyPet**](PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop [**PetAPI_updatePet**](PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet [**PetAPI_updatePetWithForm**](PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**PetAPI_uploadFile**](PetAPI.md#PetAPI_uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image @@ -153,6 +154,36 @@ Name | Type | Description | Notes [pet_t](pet.md) * +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PetAPI_specialtyPet** +```c +// Specialty of the shop +// +// Returns the kind of pet the store specializes in +// +preference_t* PetAPI_specialtyPet(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[preference_t](preference.md) * + + ### Authorization [api_key](../README.md#api_key) diff --git a/samples/client/petstore/c/docs/preference.md b/samples/client/petstore/c/docs/preference.md new file mode 100644 index 000000000000..ab63d47cb7e8 --- /dev/null +++ b/samples/client/petstore/c/docs/preference.md @@ -0,0 +1,9 @@ +# preference_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/c/docs/user.md b/samples/client/petstore/c/docs/user.md index 3b9219c158b5..22b807f47efa 100644 --- a/samples/client/petstore/c/docs/user.md +++ b/samples/client/petstore/c/docs/user.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **password** | **char \*** | | [optional] **phone** | **char \*** | | [optional] **user_status** | **int** | User Status | [optional] +**extra** | **list_t*** | | [optional] +**preference** | **preference_t \*** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/c/model/preference.c b/samples/client/petstore/c/model/preference.c new file mode 100644 index 000000000000..ac7e600fed02 --- /dev/null +++ b/samples/client/petstore/c/model/preference.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include "preference.h" + + +char* preference_preference_ToString(openapi_petstore_preference__e preference) { + char *preferenceArray[] = { "NULL", "cats", "dogs", "birds", "fish", "snakes", "other" }; + return preferenceArray[preference]; +} + +openapi_petstore_preference__e preference_preference_FromString(char* preference) { + int stringToReturn = 0; + char *preferenceArray[] = { "NULL", "cats", "dogs", "birds", "fish", "snakes", "other" }; + size_t sizeofArray = sizeof(preferenceArray) / sizeof(preferenceArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(preference, preferenceArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + +cJSON *preference_convertToJSON(openapi_petstore_preference__e preference) { + cJSON *item = cJSON_CreateObject(); + if(cJSON_AddStringToObject(item, "preference", preference_preference_ToString(preference)) == NULL) { + goto fail; + } + return item; +fail: + cJSON_Delete(item); + return NULL; +} + +openapi_petstore_preference__e preference_parseFromJSON(cJSON *preferenceJSON) { + openapi_petstore_preference__e *preference = NULL; + openapi_petstore_preference__e preferenceVariable; + cJSON *preferenceVar = cJSON_GetObjectItemCaseSensitive(preferenceJSON, "preference"); + if(!cJSON_IsString(preferenceVar) || (preferenceVar->valuestring == NULL)){ + goto end; + } + preferenceVariable = preference_preference_FromString(preferenceVar->valuestring); + return preferenceVariable; +end: + return 0; +} diff --git a/samples/client/petstore/c/model/preference.h b/samples/client/petstore/c/model/preference.h new file mode 100644 index 000000000000..1f6644f08361 --- /dev/null +++ b/samples/client/petstore/c/model/preference.h @@ -0,0 +1,32 @@ +/* + * preference.h + * + * A user's preference in pets + */ + +#ifndef _preference_H_ +#define _preference_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct preference_t preference_t; + + +// Enum for preference + +typedef enum { openapi_petstore_preference__NULL = 0, openapi_petstore_preference__cats, openapi_petstore_preference__dogs, openapi_petstore_preference__birds, openapi_petstore_preference__fish, openapi_petstore_preference__snakes, openapi_petstore_preference__other } openapi_petstore_preference__e; + +char* preference_preference_ToString(openapi_petstore_preference__e preference); + +openapi_petstore_preference__e preference_preference_FromString(char* preference); + +cJSON *preference_convertToJSON(openapi_petstore_preference__e preference); + +openapi_petstore_preference__e preference_parseFromJSON(cJSON *preferenceJSON); + +#endif /* _preference_H_ */ + diff --git a/samples/client/petstore/c/model/user.c b/samples/client/petstore/c/model/user.c index eb188153ccf0..b43d428e1ffa 100644 --- a/samples/client/petstore/c/model/user.c +++ b/samples/client/petstore/c/model/user.c @@ -13,7 +13,9 @@ user_t *user_create( char *email, char *password, char *phone, - int user_status + int user_status, + list_t* extra, + openapi_petstore_preference__e preference ) { user_t *user_local_var = malloc(sizeof(user_t)); if (!user_local_var) { @@ -27,6 +29,8 @@ user_t *user_create( user_local_var->password = password; user_local_var->phone = phone; user_local_var->user_status = user_status; + user_local_var->extra = extra; + user_local_var->preference = preference; return user_local_var; } @@ -61,6 +65,16 @@ void user_free(user_t *user) { free(user->phone); user->phone = NULL; } + if (user->extra) { + list_ForEach(listEntry, user->extra) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(user->extra); + user->extra = NULL; + } free(user); } @@ -130,6 +144,35 @@ cJSON *user_convertToJSON(user_t *user) { } } + + // user->extra + if(user->extra) { + cJSON *extra = cJSON_AddObjectToObject(item, "extra"); + if(extra == NULL) { + goto fail; //primitive map container + } + cJSON *localMapObject = extra; + listEntry_t *extraListEntry; + if (user->extra) { + list_ForEach(extraListEntry, user->extra) { + keyValuePair_t *localKeyValue = (keyValuePair_t*)extraListEntry->data; + } + } + } + + + // user->preference + if(user->preference != openapi_petstore_preference__NULL) { + cJSON *preference_local_JSON = preference_convertToJSON(user->preference); + if(preference_local_JSON == NULL) { + goto fail; // custom + } + cJSON_AddItemToObject(item, "preference", preference_local_JSON); + if(item->child == NULL) { + goto fail; + } + } + return item; fail: if (item) { @@ -142,6 +185,12 @@ user_t *user_parseFromJSON(cJSON *userJSON){ user_t *user_local_var = NULL; + // define the local map for user->extra + list_t *extraList = NULL; + + // define the local variable for user->preference + openapi_petstore_preference__e preference_local_nonprim = 0; + // user->id cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); if (id) { @@ -214,6 +263,32 @@ user_t *user_parseFromJSON(cJSON *userJSON){ } } + // user->extra + cJSON *extra = cJSON_GetObjectItemCaseSensitive(userJSON, "extra"); + if (extra) { + cJSON *extra_local_map = NULL; + if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) + { + goto end;//primitive map container + } + if(cJSON_IsObject(extra)) + { + extraList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(extra_local_map, extra) + { + cJSON *localMapObject = extra_local_map; + list_addElement(extraList , localMapKeyPair); + } + } + } + + // user->preference + cJSON *preference = cJSON_GetObjectItemCaseSensitive(userJSON, "preference"); + if (preference) { + preference_local_nonprim = preference_parseFromJSON(preference); //custom + } + user_local_var = user_create ( id ? id->valuedouble : 0, @@ -223,11 +298,28 @@ user_t *user_parseFromJSON(cJSON *userJSON){ email && !cJSON_IsNull(email) ? strdup(email->valuestring) : NULL, password && !cJSON_IsNull(password) ? strdup(password->valuestring) : NULL, phone && !cJSON_IsNull(phone) ? strdup(phone->valuestring) : NULL, - user_status ? user_status->valuedouble : 0 + user_status ? user_status->valuedouble : 0, + extra ? extraList : NULL, + preference ? preference_local_nonprim : 0 ); return user_local_var; end: + if (extraList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, extraList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(extraList); + extraList = NULL; + } + if (preference_local_nonprim) { + preference_local_nonprim = 0; + } return NULL; } diff --git a/samples/client/petstore/c/model/user.h b/samples/client/petstore/c/model/user.h index 45fa42c3f91c..badbc747b308 100644 --- a/samples/client/petstore/c/model/user.h +++ b/samples/client/petstore/c/model/user.h @@ -15,6 +15,8 @@ typedef struct user_t user_t; +#include "any_type.h" +#include "preference.h" @@ -27,6 +29,8 @@ typedef struct user_t { char *password; // string char *phone; // string int user_status; //numeric + list_t* extra; //map + openapi_petstore_preference__e preference; //referenced enum } user_t; @@ -38,7 +42,9 @@ user_t *user_create( char *email, char *password, char *phone, - int user_status + int user_status, + list_t* extra, + openapi_petstore_preference__e preference ); void user_free(user_t *user); diff --git a/samples/client/petstore/c/unit-test/test_preference.c b/samples/client/petstore/c/unit-test/test_preference.c new file mode 100644 index 000000000000..8b1e2163fb34 --- /dev/null +++ b/samples/client/petstore/c/unit-test/test_preference.c @@ -0,0 +1,56 @@ +#ifndef preference_TEST +#define preference_TEST + +// the following is to include only the main from the first c file +#ifndef TEST_MAIN +#define TEST_MAIN +#define preference_MAIN +#endif // TEST_MAIN + +#include +#include +#include +#include +#include "../external/cJSON.h" + +#include "../model/preference.h" +preference_t* instantiate_preference(int include_optional); + + + +preference_t* instantiate_preference(int include_optional) { + preference_t* preference = NULL; + if (include_optional) { + preference = preference_create( + ); + } else { + preference = preference_create( + ); + } + + return preference; +} + + +#ifdef preference_MAIN + +void test_preference(int include_optional) { + preference_t* preference_1 = instantiate_preference(include_optional); + + cJSON* jsonpreference_1 = preference_convertToJSON(preference_1); + printf("preference :\n%s\n", cJSON_Print(jsonpreference_1)); + preference_t* preference_2 = preference_parseFromJSON(jsonpreference_1); + cJSON* jsonpreference_2 = preference_convertToJSON(preference_2); + printf("repeating preference:\n%s\n", cJSON_Print(jsonpreference_2)); +} + +int main() { + test_preference(1); + test_preference(0); + + printf("Hello world \n"); + return 0; +} + +#endif // preference_MAIN +#endif // preference_TEST From e3e06af5f4af3e0ac96ee2aa822fe8efe3ead529 Mon Sep 17 00:00:00 2001 From: Matt Pollock Date: Thu, 28 Nov 2024 03:31:21 -0500 Subject: [PATCH 06/40] [R] fix to-list and to-json functionality (#20132) * [r client] fix to-list and to-json functionality * fix type of json string * wip * refactor pr * regenerate samples * update to-dataframe example to use non-superceded tidyverse functions * fix typo --- .../src/main/resources/r/api.mustache | 2 +- .../src/main/resources/r/modelAnyOf.mustache | 29 +-- .../src/main/resources/r/modelEnum.mustache | 22 ++- .../main/resources/r/modelGeneric.mustache | 111 ++++-------- .../src/main/resources/r/modelOneOf.mustache | 28 ++- samples/client/echo_api/r/R/bird.R | 61 ++++--- samples/client/echo_api/r/R/body_api.R | 14 +- samples/client/echo_api/r/R/category.R | 61 ++++--- samples/client/echo_api/r/R/data_query.R | 85 ++++----- samples/client/echo_api/r/R/default_value.R | 111 ++++-------- .../echo_api/r/R/number_properties_only.R | 69 +++---- samples/client/echo_api/r/R/pet.R | 97 ++++------ samples/client/echo_api/r/R/query.R | 61 ++++--- samples/client/echo_api/r/R/string_enum_ref.R | 22 ++- samples/client/echo_api/r/R/tag.R | 61 ++++--- ...est_form_object_multipart_request_marker.R | 53 ++++-- ...rue_object_all_of_query_object_parameter.R | 77 ++++---- ...true_array_string_query_object_parameter.R | 53 ++++-- .../R/allof_tag_api_response.R | 89 ++++----- .../petstore/R-httr2-wrapper/R/animal.R | 65 ++++--- .../petstore/R-httr2-wrapper/R/any_of_pig.R | 29 +-- .../R/any_of_primitive_type_test.R | 28 ++- .../petstore/R-httr2-wrapper/R/basque_pig.R | 65 ++++--- .../client/petstore/R-httr2-wrapper/R/cat.R | 73 ++++---- .../petstore/R-httr2-wrapper/R/category.R | 65 ++++--- .../petstore/R-httr2-wrapper/R/danish_pig.R | 65 ++++--- .../client/petstore/R-httr2-wrapper/R/date.R | 73 ++++---- .../client/petstore/R-httr2-wrapper/R/dog.R | 73 ++++---- .../petstore/R-httr2-wrapper/R/dummy_model.R | 57 +++--- .../petstore/R-httr2-wrapper/R/fake_api.R | 2 +- .../petstore/R-httr2-wrapper/R/format_test.R | 169 ++++-------------- .../petstore/R-httr2-wrapper/R/mammal.R | 28 ++- .../R-httr2-wrapper/R/model_api_response.R | 73 ++++---- .../R-httr2-wrapper/R/nested_one_of.R | 67 +++---- .../R/one_of_primitive_type_test.R | 28 ++- .../client/petstore/R-httr2-wrapper/R/order.R | 97 ++++------ .../client/petstore/R-httr2-wrapper/R/pet.R | 101 ++++------- .../petstore/R-httr2-wrapper/R/pet_api.R | 4 +- .../petstore/R-httr2-wrapper/R/pet_map.R | 57 +++--- .../client/petstore/R-httr2-wrapper/R/pig.R | 28 ++- .../petstore/R-httr2-wrapper/R/special.R | 105 ++++------- .../petstore/R-httr2-wrapper/R/store_api.R | 2 +- .../client/petstore/R-httr2-wrapper/R/tag.R | 65 ++++--- .../R-httr2-wrapper/R/update_pet_request.R | 67 +++---- .../client/petstore/R-httr2-wrapper/R/user.R | 113 ++++-------- .../petstore/R-httr2-wrapper/R/user_api.R | 8 +- .../client/petstore/R-httr2-wrapper/R/whale.R | 73 ++++---- .../client/petstore/R-httr2-wrapper/R/zebra.R | 65 ++++--- .../tests/testthat/test_petstore.R | 6 +- .../R-httr2/R/allof_tag_api_response.R | 85 ++++----- samples/client/petstore/R-httr2/R/animal.R | 61 ++++--- .../client/petstore/R-httr2/R/any_of_pig.R | 29 +-- .../R-httr2/R/any_of_primitive_type_test.R | 28 ++- .../client/petstore/R-httr2/R/basque_pig.R | 61 ++++--- samples/client/petstore/R-httr2/R/cat.R | 69 +++---- samples/client/petstore/R-httr2/R/category.R | 61 ++++--- .../client/petstore/R-httr2/R/danish_pig.R | 61 ++++--- samples/client/petstore/R-httr2/R/date.R | 69 +++---- samples/client/petstore/R-httr2/R/dog.R | 69 +++---- samples/client/petstore/R-httr2/R/fake_api.R | 2 +- .../client/petstore/R-httr2/R/format_test.R | 165 ++++------------- .../client/petstore/R-httr2/R/just_model.R | 53 ++++-- samples/client/petstore/R-httr2/R/mammal.R | 28 ++- .../petstore/R-httr2/R/model_api_response.R | 69 +++---- .../client/petstore/R-httr2/R/nested_one_of.R | 63 ++++--- .../R-httr2/R/one_of_primitive_type_test.R | 28 ++- samples/client/petstore/R-httr2/R/order.R | 93 ++++------ samples/client/petstore/R-httr2/R/pet.R | 97 ++++------ samples/client/petstore/R-httr2/R/pet_api.R | 4 +- samples/client/petstore/R-httr2/R/pet_map.R | 53 ++++-- samples/client/petstore/R-httr2/R/pig.R | 28 ++- samples/client/petstore/R-httr2/R/special.R | 101 ++++------- samples/client/petstore/R-httr2/R/store_api.R | 2 +- samples/client/petstore/R-httr2/R/tag.R | 61 ++++--- .../petstore/R-httr2/R/update_pet_request.R | 63 ++++--- samples/client/petstore/R-httr2/R/user.R | 109 ++++------- samples/client/petstore/R-httr2/R/user_api.R | 8 +- samples/client/petstore/R-httr2/R/whale.R | 69 +++---- samples/client/petstore/R-httr2/R/zebra.R | 61 ++++--- .../R-httr2/tests/testthat/test_petstore.R | 6 +- .../petstore/R/R/allof_tag_api_response.R | 89 ++++----- samples/client/petstore/R/R/animal.R | 65 ++++--- samples/client/petstore/R/R/any_of_pig.R | 29 +-- .../petstore/R/R/any_of_primitive_type_test.R | 28 ++- samples/client/petstore/R/R/basque_pig.R | 65 ++++--- samples/client/petstore/R/R/cat.R | 73 ++++---- samples/client/petstore/R/R/category.R | 65 ++++--- samples/client/petstore/R/R/danish_pig.R | 65 ++++--- samples/client/petstore/R/R/date.R | 73 ++++---- samples/client/petstore/R/R/dog.R | 73 ++++---- samples/client/petstore/R/R/dummy_model.R | 57 +++--- samples/client/petstore/R/R/fake_api.R | 2 +- samples/client/petstore/R/R/format_test.R | 169 ++++-------------- samples/client/petstore/R/R/mammal.R | 28 ++- .../client/petstore/R/R/model_api_response.R | 73 ++++---- samples/client/petstore/R/R/nested_one_of.R | 67 +++---- .../petstore/R/R/one_of_primitive_type_test.R | 28 ++- samples/client/petstore/R/R/order.R | 97 ++++------ samples/client/petstore/R/R/pet.R | 101 ++++------- samples/client/petstore/R/R/pet_api.R | 4 +- samples/client/petstore/R/R/pet_map.R | 57 +++--- samples/client/petstore/R/R/pig.R | 28 ++- samples/client/petstore/R/R/special.R | 105 ++++------- samples/client/petstore/R/R/store_api.R | 2 +- samples/client/petstore/R/R/tag.R | 65 ++++--- .../client/petstore/R/R/update_pet_request.R | 67 +++---- samples/client/petstore/R/R/user.R | 113 ++++-------- samples/client/petstore/R/R/user_api.R | 8 +- samples/client/petstore/R/R/whale.R | 73 ++++---- samples/client/petstore/R/R/zebra.R | 65 ++++--- .../petstore/R/tests/testthat/test_petstore.R | 6 +- 111 files changed, 3072 insertions(+), 3381 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 2895328c09c9..4f18c214f11a 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -456,7 +456,7 @@ local_var_body <- `{{paramName}}`$toJSONString() {{/isArray}} } else { - body <- NULL + local_var_body <- NULL } {{/bodyParams}} diff --git a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache index 62e6dd7e41c1..1cdb306be667 100644 --- a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache @@ -86,27 +86,32 @@ }, #' @description - #' Serialize {{{classname}}} to JSON string. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. + toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert {{{classname}}} to a base R type #' - #' @return JSON string representation of the {{{classname}}}. - toJSONString = function() { + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify((self$actual_instance$toJSONString()))) + return(self$actual_instance$toSimpleType()) } else { NULL } }, #' @description - #' Serialize {{{classname}}} to JSON. + #' Serialize {{{classname}}} to JSON string. #' - #' @return JSON representation of the {{{classname}}}. - toJSON = function() { - if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() - } else { - NULL - } + #' @param ... Parameters passed to `jsonlite::toJSON` + #' @return JSON string representation of the {{{classname}}}. + toJSONString = function(...) { + json <- jsonlite::toJSON(self$toSimpleType(), auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/modules/openapi-generator/src/main/resources/r/modelEnum.mustache b/modules/openapi-generator/src/main/resources/r/modelEnum.mustache index 64d136449be1..c0dc60149aa1 100644 --- a/modules/openapi-generator/src/main/resources/r/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelEnum.mustache @@ -38,11 +38,18 @@ }, #' @description - #' To JSON String - #' - #' @return {{{classname}}} in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { - jsonlite::toJSON(private$value, auto_unbox = TRUE) + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert {{{classname}}} to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { + return(private$value) }, #' @description @@ -60,10 +67,11 @@ #' @description #' To JSON String #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return {{{classname}}} in JSON format - toJSONString = function() { - as.character(jsonlite::toJSON(private$value, - auto_unbox = TRUE)) + toJSONString = function(...) { + json <- jsonlite::toJSON(self$toSimpleType(), auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache index 24f0ddf8c8f0..0da6607925aa 100644 --- a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache @@ -203,10 +203,35 @@ }, #' @description - #' To JSON String - #' - #' @return {{{classname}}} in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return {{{classname}}} as a base R list. + #' @examples + #' # convert array of {{{classname}}} (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert {{{classname}}} to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { {{classname}}Object <- list() {{#vars}} if (!is.null(self$`{{name}}`)) { @@ -217,7 +242,7 @@ self$`{{name}}` {{/isPrimitiveType}} {{^isPrimitiveType}} - lapply(self$`{{name}}`, function(x) x$toJSON()) + lapply(self$`{{name}}`, function(x) x$toSimpleType()) {{/isPrimitiveType}} {{/isArray}} {{#isMap}} @@ -225,7 +250,7 @@ self$`{{name}}` {{/isPrimitiveType}} {{^isPrimitiveType}} - lapply(self$`{{name}}`, function(x) x$toJSON()) + lapply(self$`{{name}}`, function(x) x$toSimpleType()) {{/isPrimitiveType}} {{/isMap}} {{/isContainer}} @@ -234,7 +259,7 @@ self$`{{name}}` {{/isPrimitiveType}} {{^isPrimitiveType}} - self$`{{name}}`$toJSON() + self$`{{name}}`$toSimpleType() {{/isPrimitiveType}} {{/isContainer}} } @@ -245,7 +270,7 @@ } {{/isAdditionalPropertiesTrue}} - {{classname}}Object + return({{classname}}Object) }, #' @description @@ -304,76 +329,18 @@ #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return {{{classname}}} in JSON format - toJSONString = function() { - jsoncontent <- c( - {{#vars}} - if (!is.null(self$`{{name}}`)) { - sprintf( - '"{{baseName}}": - {{#isContainer}} - {{#isArray}} - {{#isPrimitiveType}} - {{#isNumeric}}[%d]{{/isNumeric}}{{^isNumeric}}[%s]{{/isNumeric}} - {{/isPrimitiveType}} - {{^isPrimitiveType}}[%s] - {{/isPrimitiveType}} - {{/isArray}} - {{#isMap}} - {{#isPrimitiveType}} - {{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}{{^isBoolean}}{{/isBoolean}}%s{{^isBoolean}}{{/isBoolean}}{{/isNumeric}} - {{/isPrimitiveType}} - {{^isPrimitiveType}}%s - {{/isPrimitiveType}} - {{/isMap}} - {{/isContainer}} - {{^isContainer}} - {{#isPrimitiveType}} - {{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}{{^isBoolean}}"{{/isBoolean}}%s{{^isBoolean}}"{{/isBoolean}}{{/isNumeric}} - {{/isPrimitiveType}} - {{^isPrimitiveType}}%s - {{/isPrimitiveType}} - {{/isContainer}}', - {{#isContainer}} - {{#isArray}} - {{#isPrimitiveType}} - paste(unlist(lapply(self$`{{{name}}}`, function(x) paste0('"', x, '"'))), collapse = ",") - {{/isPrimitiveType}} - {{^isPrimitiveType}} - paste(sapply(self$`{{{name}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") - {{/isPrimitiveType}} - {{/isArray}} - {{#isMap}} - {{#isPrimitiveType}} - jsonlite::toJSON(lapply(self$`{{{name}}}`, function(x){ x }), auto_unbox = TRUE, digits = NA) - {{/isPrimitiveType}} - {{^isPrimitiveType}} - jsonlite::toJSON(lapply(self$`{{{name}}}`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits = NA) - {{/isPrimitiveType}} - {{/isMap}} - {{/isContainer}} - {{^isContainer}} - {{#isPrimitiveType}} - {{#isBoolean}}tolower({{/isBoolean}}self$`{{name}}`{{#isBoolean}}){{/isBoolean}} - {{/isPrimitiveType}} - {{^isPrimitiveType}} - jsonlite::toJSON(self$`{{name}}`$toJSON(), auto_unbox = TRUE, digits = NA) - {{/isPrimitiveType}} - {{/isContainer}} - ) - }{{^-last}},{{/-last}} - {{/vars}} - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() {{#isAdditionalPropertiesTrue}} - json_obj <- jsonlite::fromJSON(json_string) for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) {{/isAdditionalPropertiesTrue}} + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache index 4fe94c4ad043..998687b5efb5 100644 --- a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache @@ -139,25 +139,35 @@ #' @description #' Serialize {{{classname}}} to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the {{{classname}}}. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize {{{classname}}} to JSON. - #' - #' @return JSON representation of the {{{classname}}}. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert {{{classname}}} to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/echo_api/r/R/bird.R b/samples/client/echo_api/r/R/bird.R index 5132beb3788c..97921b1c4c89 100644 --- a/samples/client/echo_api/r/R/bird.R +++ b/samples/client/echo_api/r/R/bird.R @@ -40,10 +40,35 @@ Bird <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Bird in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Bird as a base R list. + #' @examples + #' # convert array of Bird (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Bird to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { BirdObject <- list() if (!is.null(self$`size`)) { BirdObject[["size"]] <- @@ -53,7 +78,7 @@ Bird <- R6::R6Class( BirdObject[["color"]] <- self$`color` } - BirdObject + return(BirdObject) }, #' @description @@ -74,29 +99,13 @@ Bird <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Bird in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`size`)) { - sprintf( - '"size": - "%s" - ', - self$`size` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/body_api.R b/samples/client/echo_api/r/R/body_api.R index 1be1cafba8b4..9f16d197edc0 100644 --- a/samples/client/echo_api/r/R/body_api.R +++ b/samples/client/echo_api/r/R/body_api.R @@ -304,7 +304,7 @@ BodyApi <- R6::R6Class( if (!is.null(`body`)) { local_var_body <- `body`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/body/application/octetstream/binary" @@ -586,7 +586,7 @@ BodyApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/echo/body/allOf/Pet" @@ -682,7 +682,7 @@ BodyApi <- R6::R6Class( if (!is.null(`body`)) { local_var_body <- `body`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/echo/body/FreeFormObject/response_string" @@ -778,7 +778,7 @@ BodyApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/echo/body/Pet" @@ -874,7 +874,7 @@ BodyApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/echo/body/Pet/response_string" @@ -970,7 +970,7 @@ BodyApi <- R6::R6Class( if (!is.null(`body`)) { local_var_body <- `body`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/echo/body/string_enum" @@ -1066,7 +1066,7 @@ BodyApi <- R6::R6Class( if (!is.null(`tag`)) { local_var_body <- `tag`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/echo/body/Tag/response_string" diff --git a/samples/client/echo_api/r/R/category.R b/samples/client/echo_api/r/R/category.R index cbf3a88b9ddc..56aa69671774 100644 --- a/samples/client/echo_api/r/R/category.R +++ b/samples/client/echo_api/r/R/category.R @@ -40,10 +40,35 @@ Category <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Category in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Category as a base R list. + #' @examples + #' # convert array of Category (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Category to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CategoryObject <- list() if (!is.null(self$`id`)) { CategoryObject[["id"]] <- @@ -53,7 +78,7 @@ Category <- R6::R6Class( CategoryObject[["name"]] <- self$`name` } - CategoryObject + return(CategoryObject) }, #' @description @@ -74,29 +99,13 @@ Category <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Category in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/data_query.R b/samples/client/echo_api/r/R/data_query.R index edc0bcda0a72..1340544416d0 100644 --- a/samples/client/echo_api/r/R/data_query.R +++ b/samples/client/echo_api/r/R/data_query.R @@ -67,10 +67,35 @@ DataQuery <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DataQuery in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DataQuery as a base R list. + #' @examples + #' # convert array of DataQuery (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DataQuery to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DataQueryObject <- list() if (!is.null(self$`id`)) { DataQueryObject[["id"]] <- @@ -92,7 +117,7 @@ DataQuery <- R6::R6Class( DataQueryObject[["date"]] <- self$`date` } - DataQueryObject + return(DataQueryObject) }, #' @description @@ -122,53 +147,13 @@ DataQuery <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DataQuery in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`outcomes`)) { - sprintf( - '"outcomes": - [%s] - ', - paste(unlist(lapply(self$`outcomes`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`suffix`)) { - sprintf( - '"suffix": - "%s" - ', - self$`suffix` - ) - }, - if (!is.null(self$`text`)) { - sprintf( - '"text": - "%s" - ', - self$`text` - ) - }, - if (!is.null(self$`date`)) { - sprintf( - '"date": - "%s" - ', - self$`date` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/default_value.R b/samples/client/echo_api/r/R/default_value.R index 4456d7fcea03..2a3a83f32655 100644 --- a/samples/client/echo_api/r/R/default_value.R +++ b/samples/client/echo_api/r/R/default_value.R @@ -87,14 +87,39 @@ DefaultValue <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DefaultValue in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DefaultValue as a base R list. + #' @examples + #' # convert array of DefaultValue (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DefaultValue to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DefaultValueObject <- list() if (!is.null(self$`array_string_enum_ref_default`)) { DefaultValueObject[["array_string_enum_ref_default"]] <- - lapply(self$`array_string_enum_ref_default`, function(x) x$toJSON()) + lapply(self$`array_string_enum_ref_default`, function(x) x$toSimpleType()) } if (!is.null(self$`array_string_enum_default`)) { DefaultValueObject[["array_string_enum_default"]] <- @@ -124,7 +149,7 @@ DefaultValue <- R6::R6Class( DefaultValueObject[["string_nullable"]] <- self$`string_nullable` } - DefaultValueObject + return(DefaultValueObject) }, #' @description @@ -163,77 +188,13 @@ DefaultValue <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DefaultValue in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`array_string_enum_ref_default`)) { - sprintf( - '"array_string_enum_ref_default": - [%s] -', - paste(sapply(self$`array_string_enum_ref_default`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") - ) - }, - if (!is.null(self$`array_string_enum_default`)) { - sprintf( - '"array_string_enum_default": - [%s] - ', - paste(unlist(lapply(self$`array_string_enum_default`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`array_string_default`)) { - sprintf( - '"array_string_default": - [%s] - ', - paste(unlist(lapply(self$`array_string_default`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`array_integer_default`)) { - sprintf( - '"array_integer_default": - [%s] - ', - paste(unlist(lapply(self$`array_integer_default`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`array_string`)) { - sprintf( - '"array_string": - [%s] - ', - paste(unlist(lapply(self$`array_string`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`array_string_nullable`)) { - sprintf( - '"array_string_nullable": - [%s] - ', - paste(unlist(lapply(self$`array_string_nullable`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`array_string_extension_nullable`)) { - sprintf( - '"array_string_extension_nullable": - [%s] - ', - paste(unlist(lapply(self$`array_string_extension_nullable`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`string_nullable`)) { - sprintf( - '"string_nullable": - "%s" - ', - self$`string_nullable` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/number_properties_only.R b/samples/client/echo_api/r/R/number_properties_only.R index 7b0b698630fd..7b146800ad34 100644 --- a/samples/client/echo_api/r/R/number_properties_only.R +++ b/samples/client/echo_api/r/R/number_properties_only.R @@ -46,10 +46,35 @@ NumberPropertiesOnly <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return NumberPropertiesOnly in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return NumberPropertiesOnly as a base R list. + #' @examples + #' # convert array of NumberPropertiesOnly (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert NumberPropertiesOnly to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { NumberPropertiesOnlyObject <- list() if (!is.null(self$`number`)) { NumberPropertiesOnlyObject[["number"]] <- @@ -63,7 +88,7 @@ NumberPropertiesOnly <- R6::R6Class( NumberPropertiesOnlyObject[["double"]] <- self$`double` } - NumberPropertiesOnlyObject + return(NumberPropertiesOnlyObject) }, #' @description @@ -87,37 +112,13 @@ NumberPropertiesOnly <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return NumberPropertiesOnly in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`number`)) { - sprintf( - '"number": - %d - ', - self$`number` - ) - }, - if (!is.null(self$`float`)) { - sprintf( - '"float": - %d - ', - self$`float` - ) - }, - if (!is.null(self$`double`)) { - sprintf( - '"double": - %d - ', - self$`double` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/pet.R b/samples/client/echo_api/r/R/pet.R index b03d04e66cd6..6f59d7ea1f6c 100644 --- a/samples/client/echo_api/r/R/pet.R +++ b/samples/client/echo_api/r/R/pet.R @@ -75,10 +75,35 @@ Pet <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Pet in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Pet as a base R list. + #' @examples + #' # convert array of Pet (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pet to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetObject <- list() if (!is.null(self$`id`)) { PetObject[["id"]] <- @@ -90,7 +115,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`category`)) { PetObject[["category"]] <- - self$`category`$toJSON() + self$`category`$toSimpleType() } if (!is.null(self$`photoUrls`)) { PetObject[["photoUrls"]] <- @@ -98,13 +123,13 @@ Pet <- R6::R6Class( } if (!is.null(self$`tags`)) { PetObject[["tags"]] <- - lapply(self$`tags`, function(x) x$toJSON()) + lapply(self$`tags`, function(x) x$toSimpleType()) } if (!is.null(self$`status`)) { PetObject[["status"]] <- self$`status` } - PetObject + return(PetObject) }, #' @description @@ -142,61 +167,13 @@ Pet <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Pet in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`category`)) { - sprintf( - '"category": - %s - ', - jsonlite::toJSON(self$`category`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`photoUrls`)) { - sprintf( - '"photoUrls": - [%s] - ', - paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`tags`)) { - sprintf( - '"tags": - [%s] -', - paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/query.R b/samples/client/echo_api/r/R/query.R index 527a97226b1d..fd286ab3016d 100644 --- a/samples/client/echo_api/r/R/query.R +++ b/samples/client/echo_api/r/R/query.R @@ -39,10 +39,35 @@ Query <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Query in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Query as a base R list. + #' @examples + #' # convert array of Query (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Query to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { QueryObject <- list() if (!is.null(self$`id`)) { QueryObject[["id"]] <- @@ -52,7 +77,7 @@ Query <- R6::R6Class( QueryObject[["outcomes"]] <- self$`outcomes` } - QueryObject + return(QueryObject) }, #' @description @@ -73,29 +98,13 @@ Query <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Query in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`outcomes`)) { - sprintf( - '"outcomes": - [%s] - ', - paste(unlist(lapply(self$`outcomes`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/string_enum_ref.R b/samples/client/echo_api/r/R/string_enum_ref.R index 1be463a16552..ee9afe6cf4a1 100644 --- a/samples/client/echo_api/r/R/string_enum_ref.R +++ b/samples/client/echo_api/r/R/string_enum_ref.R @@ -37,11 +37,18 @@ StringEnumRef <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return StringEnumRef in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { - jsonlite::toJSON(private$value, auto_unbox = TRUE) + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert StringEnumRef to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { + return(private$value) }, #' @description @@ -59,10 +66,11 @@ StringEnumRef <- R6::R6Class( #' @description #' To JSON String #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return StringEnumRef in JSON format - toJSONString = function() { - as.character(jsonlite::toJSON(private$value, - auto_unbox = TRUE)) + toJSONString = function(...) { + json <- jsonlite::toJSON(self$toSimpleType(), auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/tag.R b/samples/client/echo_api/r/R/tag.R index b23305a43afc..3a0d3c1d2390 100644 --- a/samples/client/echo_api/r/R/tag.R +++ b/samples/client/echo_api/r/R/tag.R @@ -40,10 +40,35 @@ Tag <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Tag in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Tag as a base R list. + #' @examples + #' # convert array of Tag (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Tag to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TagObject <- list() if (!is.null(self$`id`)) { TagObject[["id"]] <- @@ -53,7 +78,7 @@ Tag <- R6::R6Class( TagObject[["name"]] <- self$`name` } - TagObject + return(TagObject) }, #' @description @@ -74,29 +99,13 @@ Tag <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Tag in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R b/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R index 6c523622cde0..5c9776f78ebe 100644 --- a/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R +++ b/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R @@ -31,16 +31,41 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return TestFormObjectMultipartRequestMarker in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return TestFormObjectMultipartRequestMarker as a base R list. + #' @examples + #' # convert array of TestFormObjectMultipartRequestMarker (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert TestFormObjectMultipartRequestMarker to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TestFormObjectMultipartRequestMarkerObject <- list() if (!is.null(self$`name`)) { TestFormObjectMultipartRequestMarkerObject[["name"]] <- self$`name` } - TestFormObjectMultipartRequestMarkerObject + return(TestFormObjectMultipartRequestMarkerObject) }, #' @description @@ -58,21 +83,13 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return TestFormObjectMultipartRequestMarker in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R b/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R index 8616e605bf93..a441c20a8be3 100644 --- a/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R +++ b/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R @@ -58,10 +58,35 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas }, #' @description - #' To JSON String - #' - #' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter as a base R list. + #' @examples + #' # convert array of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject <- list() if (!is.null(self$`size`)) { TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject[["size"]] <- @@ -79,7 +104,7 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject[["name"]] <- self$`name` } - TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject + return(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject) }, #' @description @@ -106,45 +131,13 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`size`)) { - sprintf( - '"size": - "%s" - ', - self$`size` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R b/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R index a6e69b27f3be..9a874c05c0d1 100644 --- a/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R +++ b/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R @@ -30,16 +30,41 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter as a base R list. + #' @examples + #' # convert array of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject <- list() if (!is.null(self$`values`)) { TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject[["values"]] <- self$`values` } - TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject + return(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject) }, #' @description @@ -57,21 +82,13 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`values`)) { - sprintf( - '"values": - [%s] - ', - paste(unlist(lapply(self$`values`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R b/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R index 454e378a5c16..018600362d38 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R @@ -77,10 +77,35 @@ AllofTagApiResponse <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return AllofTagApiResponse in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return AllofTagApiResponse as a base R list. + #' @examples + #' # convert array of AllofTagApiResponse (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert AllofTagApiResponse to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { AllofTagApiResponseObject <- list() if (!is.null(self$`id`)) { AllofTagApiResponseObject[["id"]] <- @@ -106,7 +131,7 @@ AllofTagApiResponse <- R6::R6Class( AllofTagApiResponseObject[[key]] <- self$additional_properties[[key]] } - AllofTagApiResponseObject + return(AllofTagApiResponseObject) }, #' @description @@ -143,58 +168,16 @@ AllofTagApiResponse <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return AllofTagApiResponse in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`code`)) { - sprintf( - '"code": - %d - ', - self$`code` - ) - }, - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`message`)) { - sprintf( - '"message": - "%s" - ', - self$`message` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/animal.R b/samples/client/petstore/R-httr2-wrapper/R/animal.R index 471a01afef3b..cf2e97f9af30 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/animal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/animal.R @@ -52,10 +52,35 @@ Animal <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Animal in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Animal as a base R list. + #' @examples + #' # convert array of Animal (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Animal to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { AnimalObject <- list() if (!is.null(self$`className`)) { AnimalObject[["className"]] <- @@ -69,7 +94,7 @@ Animal <- R6::R6Class( AnimalObject[[key]] <- self$additional_properties[[key]] } - AnimalObject + return(AnimalObject) }, #' @description @@ -97,34 +122,16 @@ Animal <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Animal in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R b/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R index ba3c8ea856d9..7480eec76961 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R @@ -91,27 +91,32 @@ AnyOfPig <- R6::R6Class( }, #' @description - #' Serialize AnyOfPig to JSON string. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. + toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert AnyOfPig to a base R type #' - #' @return JSON string representation of the AnyOfPig. - toJSONString = function() { + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify((self$actual_instance$toJSONString()))) + return(self$actual_instance$toSimpleType()) } else { NULL } }, #' @description - #' Serialize AnyOfPig to JSON. + #' Serialize AnyOfPig to JSON string. #' - #' @return JSON representation of the AnyOfPig. - toJSON = function() { - if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() - } else { - NULL - } + #' @param ... Parameters passed to `jsonlite::toJSON` + #' @return JSON string representation of the AnyOfPig. + toJSONString = function(...) { + json <- jsonlite::toJSON(self$toSimpleType(), auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R b/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R index 99aa52c73427..f76defe9f4aa 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R @@ -111,25 +111,35 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the AnyOfPrimitiveTypeTest. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize AnyOfPrimitiveTypeTest to JSON. - #' - #' @return JSON representation of the AnyOfPrimitiveTypeTest. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert AnyOfPrimitiveTypeTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R index cce82cd7d932..ca8601f4c3b1 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R @@ -50,10 +50,35 @@ BasquePig <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return BasquePig in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return BasquePig as a base R list. + #' @examples + #' # convert array of BasquePig (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert BasquePig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { BasquePigObject <- list() if (!is.null(self$`className`)) { BasquePigObject[["className"]] <- @@ -67,7 +92,7 @@ BasquePig <- R6::R6Class( BasquePigObject[[key]] <- self$additional_properties[[key]] } - BasquePigObject + return(BasquePigObject) }, #' @description @@ -95,34 +120,16 @@ BasquePig <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return BasquePig in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/cat.R b/samples/client/petstore/R-httr2-wrapper/R/cat.R index b4014681ba49..270b87c21643 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/cat.R +++ b/samples/client/petstore/R-httr2-wrapper/R/cat.R @@ -60,10 +60,35 @@ Cat <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Cat in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Cat as a base R list. + #' @examples + #' # convert array of Cat (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Cat to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CatObject <- list() if (!is.null(self$`className`)) { CatObject[["className"]] <- @@ -81,7 +106,7 @@ Cat <- R6::R6Class( CatObject[[key]] <- self$additional_properties[[key]] } - CatObject + return(CatObject) }, #' @description @@ -112,42 +137,16 @@ Cat <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Cat in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`declawed`)) { - sprintf( - '"declawed": - %s - ', - tolower(self$`declawed`) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/category.R b/samples/client/petstore/R-httr2-wrapper/R/category.R index 31106a3bc9e2..0dcbd1b81610 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/category.R +++ b/samples/client/petstore/R-httr2-wrapper/R/category.R @@ -50,10 +50,35 @@ Category <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Category in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Category as a base R list. + #' @examples + #' # convert array of Category (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Category to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CategoryObject <- list() if (!is.null(self$`id`)) { CategoryObject[["id"]] <- @@ -67,7 +92,7 @@ Category <- R6::R6Class( CategoryObject[[key]] <- self$additional_properties[[key]] } - CategoryObject + return(CategoryObject) }, #' @description @@ -95,34 +120,16 @@ Category <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Category in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R index 08ca2b9e3eea..02d2208639b0 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R @@ -50,10 +50,35 @@ DanishPig <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DanishPig in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DanishPig as a base R list. + #' @examples + #' # convert array of DanishPig (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DanishPig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DanishPigObject <- list() if (!is.null(self$`className`)) { DanishPigObject[["className"]] <- @@ -67,7 +92,7 @@ DanishPig <- R6::R6Class( DanishPigObject[[key]] <- self$additional_properties[[key]] } - DanishPigObject + return(DanishPigObject) }, #' @description @@ -95,34 +120,16 @@ DanishPig <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DanishPig in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`size`)) { - sprintf( - '"size": - %d - ', - self$`size` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/date.R b/samples/client/petstore/R-httr2-wrapper/R/date.R index d9b6ec0beb1b..411249d3fba1 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/date.R +++ b/samples/client/petstore/R-httr2-wrapper/R/date.R @@ -63,10 +63,35 @@ Date <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Date in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Date as a base R list. + #' @examples + #' # convert array of Date (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Date to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DateObject <- list() if (!is.null(self$`className`)) { DateObject[["className"]] <- @@ -84,7 +109,7 @@ Date <- R6::R6Class( DateObject[[key]] <- self$additional_properties[[key]] } - DateObject + return(DateObject) }, #' @description @@ -119,42 +144,16 @@ Date <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Date in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`percent_description`)) { - sprintf( - '"percent_description": - "%s" - ', - self$`percent_description` - ) - }, - if (!is.null(self$`url_property`)) { - sprintf( - '"url_property": - "%s" - ', - self$`url_property` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/dog.R b/samples/client/petstore/R-httr2-wrapper/R/dog.R index 34ae29121163..4d6dab71c61b 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dog.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dog.R @@ -60,10 +60,35 @@ Dog <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Dog in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Dog as a base R list. + #' @examples + #' # convert array of Dog (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Dog to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DogObject <- list() if (!is.null(self$`className`)) { DogObject[["className"]] <- @@ -81,7 +106,7 @@ Dog <- R6::R6Class( DogObject[[key]] <- self$additional_properties[[key]] } - DogObject + return(DogObject) }, #' @description @@ -112,42 +137,16 @@ Dog <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Dog in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`breed`)) { - sprintf( - '"breed": - "%s" - ', - self$`breed` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R b/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R index 12d3ab52a155..cbea7830b824 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R @@ -41,10 +41,35 @@ DummyModel <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DummyModel in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DummyModel as a base R list. + #' @examples + #' # convert array of DummyModel (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DummyModel to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DummyModelObject <- list() if (!is.null(self$`property`)) { DummyModelObject[["property"]] <- @@ -54,7 +79,7 @@ DummyModel <- R6::R6Class( DummyModelObject[[key]] <- self$additional_properties[[key]] } - DummyModelObject + return(DummyModelObject) }, #' @description @@ -79,26 +104,16 @@ DummyModel <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DummyModel in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`property`)) { - sprintf( - '"property": - "%s" - ', - self$`property` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R index 5dae105c228b..b314363f4b68 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R @@ -225,7 +225,7 @@ FakeApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/fake/test_optional_body_parameter" diff --git a/samples/client/petstore/R-httr2-wrapper/R/format_test.R b/samples/client/petstore/R-httr2-wrapper/R/format_test.R index f93bf1435c9a..7d1bded3c5a8 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/format_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/format_test.R @@ -158,10 +158,35 @@ FormatTest <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return FormatTest in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return FormatTest as a base R list. + #' @examples + #' # convert array of FormatTest (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert FormatTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { FormatTestObject <- list() if (!is.null(self$`integer`)) { FormatTestObject[["integer"]] <- @@ -227,7 +252,7 @@ FormatTest <- R6::R6Class( FormatTestObject[[key]] <- self$additional_properties[[key]] } - FormatTestObject + return(FormatTestObject) }, #' @description @@ -294,138 +319,16 @@ FormatTest <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return FormatTest in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`integer`)) { - sprintf( - '"integer": - %d - ', - self$`integer` - ) - }, - if (!is.null(self$`int32`)) { - sprintf( - '"int32": - %d - ', - self$`int32` - ) - }, - if (!is.null(self$`int64`)) { - sprintf( - '"int64": - %d - ', - self$`int64` - ) - }, - if (!is.null(self$`number`)) { - sprintf( - '"number": - %d - ', - self$`number` - ) - }, - if (!is.null(self$`float`)) { - sprintf( - '"float": - %d - ', - self$`float` - ) - }, - if (!is.null(self$`double`)) { - sprintf( - '"double": - %d - ', - self$`double` - ) - }, - if (!is.null(self$`string`)) { - sprintf( - '"string": - "%s" - ', - self$`string` - ) - }, - if (!is.null(self$`byte`)) { - sprintf( - '"byte": - "%s" - ', - self$`byte` - ) - }, - if (!is.null(self$`binary`)) { - sprintf( - '"binary": - "%s" - ', - self$`binary` - ) - }, - if (!is.null(self$`date`)) { - sprintf( - '"date": - "%s" - ', - self$`date` - ) - }, - if (!is.null(self$`dateTime`)) { - sprintf( - '"dateTime": - "%s" - ', - self$`dateTime` - ) - }, - if (!is.null(self$`uuid`)) { - sprintf( - '"uuid": - "%s" - ', - self$`uuid` - ) - }, - if (!is.null(self$`password`)) { - sprintf( - '"password": - "%s" - ', - self$`password` - ) - }, - if (!is.null(self$`pattern_with_digits`)) { - sprintf( - '"pattern_with_digits": - "%s" - ', - self$`pattern_with_digits` - ) - }, - if (!is.null(self$`pattern_with_digits_and_delimiter`)) { - sprintf( - '"pattern_with_digits_and_delimiter": - "%s" - ', - self$`pattern_with_digits_and_delimiter` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/mammal.R b/samples/client/petstore/R-httr2-wrapper/R/mammal.R index fe4f3577d0ce..29b32a31bcb8 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/mammal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/mammal.R @@ -135,25 +135,35 @@ Mammal <- R6::R6Class( #' @description #' Serialize Mammal to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the Mammal. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize Mammal to JSON. - #' - #' @return JSON representation of the Mammal. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert Mammal to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R b/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R index 9116e438fedc..a3a46dfb7907 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R @@ -59,10 +59,35 @@ ModelApiResponse <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return ModelApiResponse in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return ModelApiResponse as a base R list. + #' @examples + #' # convert array of ModelApiResponse (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert ModelApiResponse to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { ModelApiResponseObject <- list() if (!is.null(self$`code`)) { ModelApiResponseObject[["code"]] <- @@ -80,7 +105,7 @@ ModelApiResponse <- R6::R6Class( ModelApiResponseObject[[key]] <- self$additional_properties[[key]] } - ModelApiResponseObject + return(ModelApiResponseObject) }, #' @description @@ -111,42 +136,16 @@ ModelApiResponse <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return ModelApiResponse in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`code`)) { - sprintf( - '"code": - %d - ', - self$`code` - ) - }, - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`message`)) { - sprintf( - '"message": - "%s" - ', - self$`message` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R index e04a31a69acd..31dcc2f10d01 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R @@ -48,10 +48,35 @@ NestedOneOf <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return NestedOneOf in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return NestedOneOf as a base R list. + #' @examples + #' # convert array of NestedOneOf (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert NestedOneOf to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { NestedOneOfObject <- list() if (!is.null(self$`size`)) { NestedOneOfObject[["size"]] <- @@ -59,13 +84,13 @@ NestedOneOf <- R6::R6Class( } if (!is.null(self$`nested_pig`)) { NestedOneOfObject[["nested_pig"]] <- - self$`nested_pig`$toJSON() + self$`nested_pig`$toSimpleType() } for (key in names(self$additional_properties)) { NestedOneOfObject[[key]] <- self$additional_properties[[key]] } - NestedOneOfObject + return(NestedOneOfObject) }, #' @description @@ -95,34 +120,16 @@ NestedOneOf <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return NestedOneOf in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`size`)) { - sprintf( - '"size": - %d - ', - self$`size` - ) - }, - if (!is.null(self$`nested_pig`)) { - sprintf( - '"nested_pig": - %s - ', - jsonlite::toJSON(self$`nested_pig`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R b/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R index 8a9280a9b213..e5b566985620 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R @@ -111,25 +111,35 @@ OneOfPrimitiveTypeTest <- R6::R6Class( #' @description #' Serialize OneOfPrimitiveTypeTest to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the OneOfPrimitiveTypeTest. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize OneOfPrimitiveTypeTest to JSON. - #' - #' @return JSON representation of the OneOfPrimitiveTypeTest. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert OneOfPrimitiveTypeTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2-wrapper/R/order.R b/samples/client/petstore/R-httr2-wrapper/R/order.R index cd84eed74eef..07378f03666c 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/order.R +++ b/samples/client/petstore/R-httr2-wrapper/R/order.R @@ -89,10 +89,35 @@ Order <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Order in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Order as a base R list. + #' @examples + #' # convert array of Order (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Order to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { OrderObject <- list() if (!is.null(self$`id`)) { OrderObject[["id"]] <- @@ -122,7 +147,7 @@ Order <- R6::R6Class( OrderObject[[key]] <- self$additional_properties[[key]] } - OrderObject + return(OrderObject) }, #' @description @@ -165,66 +190,16 @@ Order <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Order in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`petId`)) { - sprintf( - '"petId": - %d - ', - self$`petId` - ) - }, - if (!is.null(self$`quantity`)) { - sprintf( - '"quantity": - %d - ', - self$`quantity` - ) - }, - if (!is.null(self$`shipDate`)) { - sprintf( - '"shipDate": - "%s" - ', - self$`shipDate` - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - }, - if (!is.null(self$`complete`)) { - sprintf( - '"complete": - %s - ', - tolower(self$`complete`) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet.R b/samples/client/petstore/R-httr2-wrapper/R/pet.R index 28e1693c419f..27db68d8fdbd 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet.R @@ -85,10 +85,35 @@ Pet <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Pet in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Pet as a base R list. + #' @examples + #' # convert array of Pet (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pet to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetObject <- list() if (!is.null(self$`id`)) { PetObject[["id"]] <- @@ -96,7 +121,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`category`)) { PetObject[["category"]] <- - self$`category`$toJSON() + self$`category`$toSimpleType() } if (!is.null(self$`name`)) { PetObject[["name"]] <- @@ -108,7 +133,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`tags`)) { PetObject[["tags"]] <- - lapply(self$`tags`, function(x) x$toJSON()) + lapply(self$`tags`, function(x) x$toSimpleType()) } if (!is.null(self$`status`)) { PetObject[["status"]] <- @@ -118,7 +143,7 @@ Pet <- R6::R6Class( PetObject[[key]] <- self$additional_properties[[key]] } - PetObject + return(PetObject) }, #' @description @@ -163,66 +188,16 @@ Pet <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Pet in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`category`)) { - sprintf( - '"category": - %s - ', - jsonlite::toJSON(self$`category`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`photoUrls`)) { - sprintf( - '"photoUrls": - [%s] - ', - paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`tags`)) { - sprintf( - '"tags": - [%s] -', - paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R index b19e01d9d8ab..e32bd6cea711 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R @@ -435,7 +435,7 @@ PetApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/pet" @@ -1288,7 +1288,7 @@ PetApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/pet" diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet_map.R b/samples/client/petstore/R-httr2-wrapper/R/pet_map.R index 1fc910ac1da2..aa59c50a09c0 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_map.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_map.R @@ -40,10 +40,35 @@ PetMap <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return PetMap in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return PetMap as a base R list. + #' @examples + #' # convert array of PetMap (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert PetMap to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetMapObject <- list() if (!is.null(self$`pet`)) { PetMapObject[["pet"]] <- @@ -53,7 +78,7 @@ PetMap <- R6::R6Class( PetMapObject[[key]] <- self$additional_properties[[key]] } - PetMapObject + return(PetMapObject) }, #' @description @@ -78,26 +103,16 @@ PetMap <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return PetMap in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`pet`)) { - sprintf( - '"pet": - %s - ', - jsonlite::toJSON(lapply(self$`pet`, function(x){ x }), auto_unbox = TRUE, digits = NA) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/pig.R b/samples/client/petstore/R-httr2-wrapper/R/pig.R index 6e0242ca3e9e..11c4f531b94f 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pig.R @@ -135,25 +135,35 @@ Pig <- R6::R6Class( #' @description #' Serialize Pig to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the Pig. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize Pig to JSON. - #' - #' @return JSON representation of the Pig. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2-wrapper/R/special.R b/samples/client/petstore/R-httr2-wrapper/R/special.R index 5841fc79dd39..4c27190313fb 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/special.R +++ b/samples/client/petstore/R-httr2-wrapper/R/special.R @@ -97,10 +97,35 @@ Special <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Special in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Special as a base R list. + #' @examples + #' # convert array of Special (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Special to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { SpecialObject <- list() if (!is.null(self$`set_test`)) { SpecialObject[["set_test"]] <- @@ -134,7 +159,7 @@ Special <- R6::R6Class( SpecialObject[[key]] <- self$additional_properties[[key]] } - SpecialObject + return(SpecialObject) }, #' @description @@ -180,74 +205,16 @@ Special <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Special in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`set_test`)) { - sprintf( - '"set_test": - [%s] - ', - paste(unlist(lapply(self$`set_test`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`item_self`)) { - sprintf( - '"self": - %d - ', - self$`item_self` - ) - }, - if (!is.null(self$`item_private`)) { - sprintf( - '"private": - "%s" - ', - self$`item_private` - ) - }, - if (!is.null(self$`item_super`)) { - sprintf( - '"super": - "%s" - ', - self$`item_super` - ) - }, - if (!is.null(self$`123_number`)) { - sprintf( - '"123_number": - "%s" - ', - self$`123_number` - ) - }, - if (!is.null(self$`array[test]`)) { - sprintf( - '"array[test]": - "%s" - ', - self$`array[test]` - ) - }, - if (!is.null(self$`empty_string`)) { - sprintf( - '"empty_string": - "%s" - ', - self$`empty_string` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/store_api.R b/samples/client/petstore/R-httr2-wrapper/R/store_api.R index e49457700c0b..bbf86c4f21c0 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/store_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/store_api.R @@ -546,7 +546,7 @@ StoreApi <- R6::R6Class( if (!is.null(`order`)) { local_var_body <- `order`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/store/order" diff --git a/samples/client/petstore/R-httr2-wrapper/R/tag.R b/samples/client/petstore/R-httr2-wrapper/R/tag.R index c9ec58ae6b82..b4c893dfe77e 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/tag.R +++ b/samples/client/petstore/R-httr2-wrapper/R/tag.R @@ -50,10 +50,35 @@ Tag <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Tag in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Tag as a base R list. + #' @examples + #' # convert array of Tag (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Tag to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TagObject <- list() if (!is.null(self$`id`)) { TagObject[["id"]] <- @@ -67,7 +92,7 @@ Tag <- R6::R6Class( TagObject[[key]] <- self$additional_properties[[key]] } - TagObject + return(TagObject) }, #' @description @@ -95,34 +120,16 @@ Tag <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Tag in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R b/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R index 47369030cfac..3559d3c4d838 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R @@ -45,14 +45,39 @@ UpdatePetRequest <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return UpdatePetRequest in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return UpdatePetRequest as a base R list. + #' @examples + #' # convert array of UpdatePetRequest (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert UpdatePetRequest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { UpdatePetRequestObject <- list() if (!is.null(self$`jsonData`)) { UpdatePetRequestObject[["jsonData"]] <- - self$`jsonData`$toJSON() + self$`jsonData`$toSimpleType() } if (!is.null(self$`binaryDataN2Information`)) { UpdatePetRequestObject[["binaryDataN2Information"]] <- @@ -62,7 +87,7 @@ UpdatePetRequest <- R6::R6Class( UpdatePetRequestObject[[key]] <- self$additional_properties[[key]] } - UpdatePetRequestObject + return(UpdatePetRequestObject) }, #' @description @@ -92,34 +117,16 @@ UpdatePetRequest <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return UpdatePetRequest in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`jsonData`)) { - sprintf( - '"jsonData": - %s - ', - jsonlite::toJSON(self$`jsonData`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`binaryDataN2Information`)) { - sprintf( - '"binaryDataN2Information": - "%s" - ', - self$`binaryDataN2Information` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/user.R b/samples/client/petstore/R-httr2-wrapper/R/user.R index df4396abb2ca..361d0d454f21 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user.R @@ -104,10 +104,35 @@ User <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return User in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return User as a base R list. + #' @examples + #' # convert array of User (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert User to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { UserObject <- list() if (!is.null(self$`id`)) { UserObject[["id"]] <- @@ -145,7 +170,7 @@ User <- R6::R6Class( UserObject[[key]] <- self$additional_properties[[key]] } - UserObject + return(UserObject) }, #' @description @@ -191,82 +216,16 @@ User <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return User in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`username`)) { - sprintf( - '"username": - "%s" - ', - self$`username` - ) - }, - if (!is.null(self$`firstName`)) { - sprintf( - '"firstName": - "%s" - ', - self$`firstName` - ) - }, - if (!is.null(self$`lastName`)) { - sprintf( - '"lastName": - "%s" - ', - self$`lastName` - ) - }, - if (!is.null(self$`email`)) { - sprintf( - '"email": - "%s" - ', - self$`email` - ) - }, - if (!is.null(self$`password`)) { - sprintf( - '"password": - "%s" - ', - self$`password` - ) - }, - if (!is.null(self$`phone`)) { - sprintf( - '"phone": - "%s" - ', - self$`phone` - ) - }, - if (!is.null(self$`userStatus`)) { - sprintf( - '"userStatus": - %d - ', - self$`userStatus` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/user_api.R b/samples/client/petstore/R-httr2-wrapper/R/user_api.R index 4c938c7ee3ad..a99c036736f8 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user_api.R @@ -318,7 +318,7 @@ UserApi <- R6::R6Class( if (!is.null(`user`)) { local_var_body <- `user`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user" @@ -428,7 +428,7 @@ UserApi <- R6::R6Class( })), collapse = ",") local_var_body <- paste0("[", body.items, "]") } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/createWithArray" @@ -538,7 +538,7 @@ UserApi <- R6::R6Class( })), collapse = ",") local_var_body <- paste0("[", body.items, "]") } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/createWithList" @@ -1099,7 +1099,7 @@ UserApi <- R6::R6Class( if (!is.null(`user`)) { local_var_body <- `user`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/{username}" diff --git a/samples/client/petstore/R-httr2-wrapper/R/whale.R b/samples/client/petstore/R-httr2-wrapper/R/whale.R index e39211045a76..ea54d3bdf71c 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/whale.R +++ b/samples/client/petstore/R-httr2-wrapper/R/whale.R @@ -59,10 +59,35 @@ Whale <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Whale in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Whale as a base R list. + #' @examples + #' # convert array of Whale (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Whale to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { WhaleObject <- list() if (!is.null(self$`hasBaleen`)) { WhaleObject[["hasBaleen"]] <- @@ -80,7 +105,7 @@ Whale <- R6::R6Class( WhaleObject[[key]] <- self$additional_properties[[key]] } - WhaleObject + return(WhaleObject) }, #' @description @@ -111,42 +136,16 @@ Whale <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Whale in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`hasBaleen`)) { - sprintf( - '"hasBaleen": - %s - ', - tolower(self$`hasBaleen`) - ) - }, - if (!is.null(self$`hasTeeth`)) { - sprintf( - '"hasTeeth": - %s - ', - tolower(self$`hasTeeth`) - ) - }, - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/R/zebra.R b/samples/client/petstore/R-httr2-wrapper/R/zebra.R index fb6d90d4d983..6b85dbff4093 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/zebra.R +++ b/samples/client/petstore/R-httr2-wrapper/R/zebra.R @@ -53,10 +53,35 @@ Zebra <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Zebra in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Zebra as a base R list. + #' @examples + #' # convert array of Zebra (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Zebra to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { ZebraObject <- list() if (!is.null(self$`type`)) { ZebraObject[["type"]] <- @@ -70,7 +95,7 @@ Zebra <- R6::R6Class( ZebraObject[[key]] <- self$additional_properties[[key]] } - ZebraObject + return(ZebraObject) }, #' @description @@ -101,34 +126,16 @@ Zebra <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Zebra in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R b/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R index 917d3fb00ec4..f5c8c4edabf4 100644 --- a/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R +++ b/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R @@ -70,7 +70,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString print", { # tests for other pet objects pet0 <- Pet$new() - jsonpet <- pet0$toJSON() + jsonpet <- pet0$toSimpleType() pet2 <- pet0$fromJSON( jsonlite::toJSON(jsonpet, auto_unbox = TRUE) ) @@ -96,7 +96,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString print", { ), status = "available" ) - jsonpet <- pet1$toJSON() + jsonpet <- pet1$toSimpleType() pet2 <- pet1$fromJSON( jsonlite::toJSON(jsonpet, auto_unbox = TRUE) ) @@ -118,7 +118,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString print", { test_that("Test Category", { c1 <- Category$new(id = 450, name = "test_cat") c2 <- Category$new() - c2$fromJSON(jsonlite::toJSON(c1$toJSON(), auto_unbox = TRUE)) + c2$fromJSON(jsonlite::toJSON(c1$toSimpleType(), auto_unbox = TRUE)) expect_equal(c1, c2) c2$fromJSONString(c1$toJSONString()) expect_equal(c1, c2) diff --git a/samples/client/petstore/R-httr2/R/allof_tag_api_response.R b/samples/client/petstore/R-httr2/R/allof_tag_api_response.R index ff239b9cda9e..37fa07aaa475 100644 --- a/samples/client/petstore/R-httr2/R/allof_tag_api_response.R +++ b/samples/client/petstore/R-httr2/R/allof_tag_api_response.R @@ -67,10 +67,35 @@ AllofTagApiResponse <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return AllofTagApiResponse in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return AllofTagApiResponse as a base R list. + #' @examples + #' # convert array of AllofTagApiResponse (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert AllofTagApiResponse to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { AllofTagApiResponseObject <- list() if (!is.null(self$`id`)) { AllofTagApiResponseObject[["id"]] <- @@ -92,7 +117,7 @@ AllofTagApiResponse <- R6::R6Class( AllofTagApiResponseObject[["message"]] <- self$`message` } - AllofTagApiResponseObject + return(AllofTagApiResponseObject) }, #' @description @@ -122,53 +147,13 @@ AllofTagApiResponse <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return AllofTagApiResponse in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`code`)) { - sprintf( - '"code": - %d - ', - self$`code` - ) - }, - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`message`)) { - sprintf( - '"message": - "%s" - ', - self$`message` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/animal.R b/samples/client/petstore/R-httr2/R/animal.R index 4f1f8ab507c6..8b7e9dba4ffe 100644 --- a/samples/client/petstore/R-httr2/R/animal.R +++ b/samples/client/petstore/R-httr2/R/animal.R @@ -42,10 +42,35 @@ Animal <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Animal in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Animal as a base R list. + #' @examples + #' # convert array of Animal (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Animal to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { AnimalObject <- list() if (!is.null(self$`className`)) { AnimalObject[["className"]] <- @@ -55,7 +80,7 @@ Animal <- R6::R6Class( AnimalObject[["color"]] <- self$`color` } - AnimalObject + return(AnimalObject) }, #' @description @@ -76,29 +101,13 @@ Animal <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Animal in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/any_of_pig.R b/samples/client/petstore/R-httr2/R/any_of_pig.R index ba3c8ea856d9..7480eec76961 100644 --- a/samples/client/petstore/R-httr2/R/any_of_pig.R +++ b/samples/client/petstore/R-httr2/R/any_of_pig.R @@ -91,27 +91,32 @@ AnyOfPig <- R6::R6Class( }, #' @description - #' Serialize AnyOfPig to JSON string. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. + toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert AnyOfPig to a base R type #' - #' @return JSON string representation of the AnyOfPig. - toJSONString = function() { + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify((self$actual_instance$toJSONString()))) + return(self$actual_instance$toSimpleType()) } else { NULL } }, #' @description - #' Serialize AnyOfPig to JSON. + #' Serialize AnyOfPig to JSON string. #' - #' @return JSON representation of the AnyOfPig. - toJSON = function() { - if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() - } else { - NULL - } + #' @param ... Parameters passed to `jsonlite::toJSON` + #' @return JSON string representation of the AnyOfPig. + toJSONString = function(...) { + json <- jsonlite::toJSON(self$toSimpleType(), auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R b/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R index 99aa52c73427..f76defe9f4aa 100644 --- a/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R @@ -111,25 +111,35 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the AnyOfPrimitiveTypeTest. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize AnyOfPrimitiveTypeTest to JSON. - #' - #' @return JSON representation of the AnyOfPrimitiveTypeTest. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert AnyOfPrimitiveTypeTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2/R/basque_pig.R b/samples/client/petstore/R-httr2/R/basque_pig.R index 6833f264bc7a..77af09db6a04 100644 --- a/samples/client/petstore/R-httr2/R/basque_pig.R +++ b/samples/client/petstore/R-httr2/R/basque_pig.R @@ -40,10 +40,35 @@ BasquePig <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return BasquePig in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return BasquePig as a base R list. + #' @examples + #' # convert array of BasquePig (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert BasquePig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { BasquePigObject <- list() if (!is.null(self$`className`)) { BasquePigObject[["className"]] <- @@ -53,7 +78,7 @@ BasquePig <- R6::R6Class( BasquePigObject[["color"]] <- self$`color` } - BasquePigObject + return(BasquePigObject) }, #' @description @@ -74,29 +99,13 @@ BasquePig <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return BasquePig in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/cat.R b/samples/client/petstore/R-httr2/R/cat.R index d50bf428d8eb..54784f94e2b5 100644 --- a/samples/client/petstore/R-httr2/R/cat.R +++ b/samples/client/petstore/R-httr2/R/cat.R @@ -50,10 +50,35 @@ Cat <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Cat in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Cat as a base R list. + #' @examples + #' # convert array of Cat (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Cat to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CatObject <- list() if (!is.null(self$`className`)) { CatObject[["className"]] <- @@ -67,7 +92,7 @@ Cat <- R6::R6Class( CatObject[["declawed"]] <- self$`declawed` } - CatObject + return(CatObject) }, #' @description @@ -91,37 +116,13 @@ Cat <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Cat in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`declawed`)) { - sprintf( - '"declawed": - %s - ', - tolower(self$`declawed`) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/category.R b/samples/client/petstore/R-httr2/R/category.R index 752d9b8024b1..9448df38190e 100644 --- a/samples/client/petstore/R-httr2/R/category.R +++ b/samples/client/petstore/R-httr2/R/category.R @@ -40,10 +40,35 @@ Category <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Category in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Category as a base R list. + #' @examples + #' # convert array of Category (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Category to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CategoryObject <- list() if (!is.null(self$`id`)) { CategoryObject[["id"]] <- @@ -53,7 +78,7 @@ Category <- R6::R6Class( CategoryObject[["name"]] <- self$`name` } - CategoryObject + return(CategoryObject) }, #' @description @@ -74,29 +99,13 @@ Category <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Category in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/danish_pig.R b/samples/client/petstore/R-httr2/R/danish_pig.R index d7e35b52e5e6..e5eeb4446146 100644 --- a/samples/client/petstore/R-httr2/R/danish_pig.R +++ b/samples/client/petstore/R-httr2/R/danish_pig.R @@ -40,10 +40,35 @@ DanishPig <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DanishPig in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DanishPig as a base R list. + #' @examples + #' # convert array of DanishPig (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DanishPig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DanishPigObject <- list() if (!is.null(self$`className`)) { DanishPigObject[["className"]] <- @@ -53,7 +78,7 @@ DanishPig <- R6::R6Class( DanishPigObject[["size"]] <- self$`size` } - DanishPigObject + return(DanishPigObject) }, #' @description @@ -74,29 +99,13 @@ DanishPig <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DanishPig in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`size`)) { - sprintf( - '"size": - %d - ', - self$`size` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/date.R b/samples/client/petstore/R-httr2/R/date.R index a822606b6b7b..81dc68d4feec 100644 --- a/samples/client/petstore/R-httr2/R/date.R +++ b/samples/client/petstore/R-httr2/R/date.R @@ -53,10 +53,35 @@ Date <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Date in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Date as a base R list. + #' @examples + #' # convert array of Date (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Date to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DateObject <- list() if (!is.null(self$`className`)) { DateObject[["className"]] <- @@ -70,7 +95,7 @@ Date <- R6::R6Class( DateObject[["url_property"]] <- self$`url_property` } - DateObject + return(DateObject) }, #' @description @@ -98,37 +123,13 @@ Date <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Date in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`percent`)) { - sprintf( - '"percent_description": - "%s" - ', - self$`percent` - ) - }, - if (!is.null(self$`url_property`)) { - sprintf( - '"url_property": - "%s" - ', - self$`url_property` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/dog.R b/samples/client/petstore/R-httr2/R/dog.R index 0851d7461d99..1928ffc3985c 100644 --- a/samples/client/petstore/R-httr2/R/dog.R +++ b/samples/client/petstore/R-httr2/R/dog.R @@ -50,10 +50,35 @@ Dog <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Dog in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Dog as a base R list. + #' @examples + #' # convert array of Dog (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Dog to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DogObject <- list() if (!is.null(self$`className`)) { DogObject[["className"]] <- @@ -67,7 +92,7 @@ Dog <- R6::R6Class( DogObject[["breed"]] <- self$`breed` } - DogObject + return(DogObject) }, #' @description @@ -91,37 +116,13 @@ Dog <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Dog in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`breed`)) { - sprintf( - '"breed": - "%s" - ', - self$`breed` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/fake_api.R b/samples/client/petstore/R-httr2/R/fake_api.R index 175540cf5ee6..2038aabaf7ee 100644 --- a/samples/client/petstore/R-httr2/R/fake_api.R +++ b/samples/client/petstore/R-httr2/R/fake_api.R @@ -225,7 +225,7 @@ FakeApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/fake/test_optional_body_parameter" diff --git a/samples/client/petstore/R-httr2/R/format_test.R b/samples/client/petstore/R-httr2/R/format_test.R index 117497304980..1e8a62b2fd9c 100644 --- a/samples/client/petstore/R-httr2/R/format_test.R +++ b/samples/client/petstore/R-httr2/R/format_test.R @@ -148,10 +148,35 @@ FormatTest <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return FormatTest in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return FormatTest as a base R list. + #' @examples + #' # convert array of FormatTest (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert FormatTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { FormatTestObject <- list() if (!is.null(self$`integer`)) { FormatTestObject[["integer"]] <- @@ -213,7 +238,7 @@ FormatTest <- R6::R6Class( FormatTestObject[["pattern_with_digits_and_delimiter"]] <- self$`pattern_with_digits_and_delimiter` } - FormatTestObject + return(FormatTestObject) }, #' @description @@ -273,133 +298,13 @@ FormatTest <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return FormatTest in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`integer`)) { - sprintf( - '"integer": - %d - ', - self$`integer` - ) - }, - if (!is.null(self$`int32`)) { - sprintf( - '"int32": - %d - ', - self$`int32` - ) - }, - if (!is.null(self$`int64`)) { - sprintf( - '"int64": - %d - ', - self$`int64` - ) - }, - if (!is.null(self$`number`)) { - sprintf( - '"number": - %d - ', - self$`number` - ) - }, - if (!is.null(self$`float`)) { - sprintf( - '"float": - %d - ', - self$`float` - ) - }, - if (!is.null(self$`double`)) { - sprintf( - '"double": - %d - ', - self$`double` - ) - }, - if (!is.null(self$`string`)) { - sprintf( - '"string": - "%s" - ', - self$`string` - ) - }, - if (!is.null(self$`byte`)) { - sprintf( - '"byte": - "%s" - ', - self$`byte` - ) - }, - if (!is.null(self$`binary`)) { - sprintf( - '"binary": - "%s" - ', - self$`binary` - ) - }, - if (!is.null(self$`date`)) { - sprintf( - '"date": - "%s" - ', - self$`date` - ) - }, - if (!is.null(self$`dateTime`)) { - sprintf( - '"dateTime": - "%s" - ', - self$`dateTime` - ) - }, - if (!is.null(self$`uuid`)) { - sprintf( - '"uuid": - "%s" - ', - self$`uuid` - ) - }, - if (!is.null(self$`password`)) { - sprintf( - '"password": - "%s" - ', - self$`password` - ) - }, - if (!is.null(self$`pattern_with_digits`)) { - sprintf( - '"pattern_with_digits": - "%s" - ', - self$`pattern_with_digits` - ) - }, - if (!is.null(self$`pattern_with_digits_and_delimiter`)) { - sprintf( - '"pattern_with_digits_and_delimiter": - "%s" - ', - self$`pattern_with_digits_and_delimiter` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/just_model.R b/samples/client/petstore/R-httr2/R/just_model.R index 780533eb3db0..89d14ef99c3a 100644 --- a/samples/client/petstore/R-httr2/R/just_model.R +++ b/samples/client/petstore/R-httr2/R/just_model.R @@ -31,16 +31,41 @@ JustModel <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return JustModel in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return JustModel as a base R list. + #' @examples + #' # convert array of JustModel (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert JustModel to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { JustModelObject <- list() if (!is.null(self$`property`)) { JustModelObject[["property"]] <- self$`property` } - JustModelObject + return(JustModelObject) }, #' @description @@ -58,21 +83,13 @@ JustModel <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JustModel in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`property`)) { - sprintf( - '"property": - "%s" - ', - self$`property` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/mammal.R b/samples/client/petstore/R-httr2/R/mammal.R index bbd57ed00acb..3d93ab765e39 100644 --- a/samples/client/petstore/R-httr2/R/mammal.R +++ b/samples/client/petstore/R-httr2/R/mammal.R @@ -109,25 +109,35 @@ Mammal <- R6::R6Class( #' @description #' Serialize Mammal to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the Mammal. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize Mammal to JSON. - #' - #' @return JSON representation of the Mammal. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert Mammal to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2/R/model_api_response.R b/samples/client/petstore/R-httr2/R/model_api_response.R index 98814bedafbb..d65c1860ce2c 100644 --- a/samples/client/petstore/R-httr2/R/model_api_response.R +++ b/samples/client/petstore/R-httr2/R/model_api_response.R @@ -49,10 +49,35 @@ ModelApiResponse <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return ModelApiResponse in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return ModelApiResponse as a base R list. + #' @examples + #' # convert array of ModelApiResponse (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert ModelApiResponse to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { ModelApiResponseObject <- list() if (!is.null(self$`code`)) { ModelApiResponseObject[["code"]] <- @@ -66,7 +91,7 @@ ModelApiResponse <- R6::R6Class( ModelApiResponseObject[["message"]] <- self$`message` } - ModelApiResponseObject + return(ModelApiResponseObject) }, #' @description @@ -90,37 +115,13 @@ ModelApiResponse <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return ModelApiResponse in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`code`)) { - sprintf( - '"code": - %d - ', - self$`code` - ) - }, - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`message`)) { - sprintf( - '"message": - "%s" - ', - self$`message` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/nested_one_of.R b/samples/client/petstore/R-httr2/R/nested_one_of.R index c1abefcacd8b..d0ef1f9b67a5 100644 --- a/samples/client/petstore/R-httr2/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2/R/nested_one_of.R @@ -38,10 +38,35 @@ NestedOneOf <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return NestedOneOf in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return NestedOneOf as a base R list. + #' @examples + #' # convert array of NestedOneOf (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert NestedOneOf to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { NestedOneOfObject <- list() if (!is.null(self$`size`)) { NestedOneOfObject[["size"]] <- @@ -49,9 +74,9 @@ NestedOneOf <- R6::R6Class( } if (!is.null(self$`nested_pig`)) { NestedOneOfObject[["nested_pig"]] <- - self$`nested_pig`$toJSON() + self$`nested_pig`$toSimpleType() } - NestedOneOfObject + return(NestedOneOfObject) }, #' @description @@ -74,29 +99,13 @@ NestedOneOf <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return NestedOneOf in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`size`)) { - sprintf( - '"size": - %d - ', - self$`size` - ) - }, - if (!is.null(self$`nested_pig`)) { - sprintf( - '"nested_pig": - %s - ', - jsonlite::toJSON(self$`nested_pig`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R b/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R index 8a9280a9b213..e5b566985620 100644 --- a/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R @@ -111,25 +111,35 @@ OneOfPrimitiveTypeTest <- R6::R6Class( #' @description #' Serialize OneOfPrimitiveTypeTest to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the OneOfPrimitiveTypeTest. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize OneOfPrimitiveTypeTest to JSON. - #' - #' @return JSON representation of the OneOfPrimitiveTypeTest. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert OneOfPrimitiveTypeTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2/R/order.R b/samples/client/petstore/R-httr2/R/order.R index 4155b311f316..cf6bcb48bc85 100644 --- a/samples/client/petstore/R-httr2/R/order.R +++ b/samples/client/petstore/R-httr2/R/order.R @@ -79,10 +79,35 @@ Order <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Order in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Order as a base R list. + #' @examples + #' # convert array of Order (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Order to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { OrderObject <- list() if (!is.null(self$`id`)) { OrderObject[["id"]] <- @@ -108,7 +133,7 @@ Order <- R6::R6Class( OrderObject[["complete"]] <- self$`complete` } - OrderObject + return(OrderObject) }, #' @description @@ -144,61 +169,13 @@ Order <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Order in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`petId`)) { - sprintf( - '"petId": - %d - ', - self$`petId` - ) - }, - if (!is.null(self$`quantity`)) { - sprintf( - '"quantity": - %d - ', - self$`quantity` - ) - }, - if (!is.null(self$`shipDate`)) { - sprintf( - '"shipDate": - "%s" - ', - self$`shipDate` - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - }, - if (!is.null(self$`complete`)) { - sprintf( - '"complete": - %s - ', - tolower(self$`complete`) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/pet.R b/samples/client/petstore/R-httr2/R/pet.R index e3f3274dbc83..c3d0bc32fd61 100644 --- a/samples/client/petstore/R-httr2/R/pet.R +++ b/samples/client/petstore/R-httr2/R/pet.R @@ -75,10 +75,35 @@ Pet <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Pet in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Pet as a base R list. + #' @examples + #' # convert array of Pet (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pet to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetObject <- list() if (!is.null(self$`id`)) { PetObject[["id"]] <- @@ -86,7 +111,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`category`)) { PetObject[["category"]] <- - self$`category`$toJSON() + self$`category`$toSimpleType() } if (!is.null(self$`name`)) { PetObject[["name"]] <- @@ -98,13 +123,13 @@ Pet <- R6::R6Class( } if (!is.null(self$`tags`)) { PetObject[["tags"]] <- - lapply(self$`tags`, function(x) x$toJSON()) + lapply(self$`tags`, function(x) x$toSimpleType()) } if (!is.null(self$`status`)) { PetObject[["status"]] <- self$`status` } - PetObject + return(PetObject) }, #' @description @@ -142,61 +167,13 @@ Pet <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Pet in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`category`)) { - sprintf( - '"category": - %s - ', - jsonlite::toJSON(self$`category`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`photoUrls`)) { - sprintf( - '"photoUrls": - [%s] - ', - paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`tags`)) { - sprintf( - '"tags": - [%s] -', - paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index f832c2ea5cbc..12e65404d914 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -435,7 +435,7 @@ PetApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/pet" @@ -1288,7 +1288,7 @@ PetApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/pet" diff --git a/samples/client/petstore/R-httr2/R/pet_map.R b/samples/client/petstore/R-httr2/R/pet_map.R index 6a8b62a0a695..e0e63305d0fd 100644 --- a/samples/client/petstore/R-httr2/R/pet_map.R +++ b/samples/client/petstore/R-httr2/R/pet_map.R @@ -30,16 +30,41 @@ PetMap <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return PetMap in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return PetMap as a base R list. + #' @examples + #' # convert array of PetMap (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert PetMap to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetMapObject <- list() if (!is.null(self$`pet`)) { PetMapObject[["pet"]] <- self$`pet` } - PetMapObject + return(PetMapObject) }, #' @description @@ -57,21 +82,13 @@ PetMap <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return PetMap in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`pet`)) { - sprintf( - '"pet": - %s - ', - jsonlite::toJSON(lapply(self$`pet`, function(x){ x }), auto_unbox = TRUE, digits = NA) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/pig.R b/samples/client/petstore/R-httr2/R/pig.R index 596a9307d4dc..94067ec4d720 100644 --- a/samples/client/petstore/R-httr2/R/pig.R +++ b/samples/client/petstore/R-httr2/R/pig.R @@ -109,25 +109,35 @@ Pig <- R6::R6Class( #' @description #' Serialize Pig to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the Pig. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize Pig to JSON. - #' - #' @return JSON representation of the Pig. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R-httr2/R/special.R b/samples/client/petstore/R-httr2/R/special.R index 4e4250f78d3c..2e4c8ccdc0cf 100644 --- a/samples/client/petstore/R-httr2/R/special.R +++ b/samples/client/petstore/R-httr2/R/special.R @@ -87,10 +87,35 @@ Special <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Special in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Special as a base R list. + #' @examples + #' # convert array of Special (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Special to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { SpecialObject <- list() if (!is.null(self$`set_test`)) { SpecialObject[["set_test"]] <- @@ -120,7 +145,7 @@ Special <- R6::R6Class( SpecialObject[["empty_string"]] <- self$`empty_string` } - SpecialObject + return(SpecialObject) }, #' @description @@ -159,69 +184,13 @@ Special <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Special in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`set_test`)) { - sprintf( - '"set_test": - [%s] - ', - paste(unlist(lapply(self$`set_test`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`item_self`)) { - sprintf( - '"self": - %d - ', - self$`item_self` - ) - }, - if (!is.null(self$`item_private`)) { - sprintf( - '"private": - "%s" - ', - self$`item_private` - ) - }, - if (!is.null(self$`item_super`)) { - sprintf( - '"super": - "%s" - ', - self$`item_super` - ) - }, - if (!is.null(self$`123_number`)) { - sprintf( - '"123_number": - "%s" - ', - self$`123_number` - ) - }, - if (!is.null(self$`array[test]`)) { - sprintf( - '"array[test]": - "%s" - ', - self$`array[test]` - ) - }, - if (!is.null(self$`empty_string`)) { - sprintf( - '"empty_string": - "%s" - ', - self$`empty_string` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/store_api.R b/samples/client/petstore/R-httr2/R/store_api.R index f445fabf3c2b..fc4ff66dcab1 100644 --- a/samples/client/petstore/R-httr2/R/store_api.R +++ b/samples/client/petstore/R-httr2/R/store_api.R @@ -546,7 +546,7 @@ StoreApi <- R6::R6Class( if (!is.null(`order`)) { local_var_body <- `order`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/store/order" diff --git a/samples/client/petstore/R-httr2/R/tag.R b/samples/client/petstore/R-httr2/R/tag.R index 574b5c0395af..96383b87f07f 100644 --- a/samples/client/petstore/R-httr2/R/tag.R +++ b/samples/client/petstore/R-httr2/R/tag.R @@ -40,10 +40,35 @@ Tag <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Tag in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Tag as a base R list. + #' @examples + #' # convert array of Tag (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Tag to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TagObject <- list() if (!is.null(self$`id`)) { TagObject[["id"]] <- @@ -53,7 +78,7 @@ Tag <- R6::R6Class( TagObject[["name"]] <- self$`name` } - TagObject + return(TagObject) }, #' @description @@ -74,29 +99,13 @@ Tag <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Tag in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/update_pet_request.R b/samples/client/petstore/R-httr2/R/update_pet_request.R index a5070554b03b..e42c9a114546 100644 --- a/samples/client/petstore/R-httr2/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2/R/update_pet_request.R @@ -35,20 +35,45 @@ UpdatePetRequest <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return UpdatePetRequest in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return UpdatePetRequest as a base R list. + #' @examples + #' # convert array of UpdatePetRequest (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert UpdatePetRequest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { UpdatePetRequestObject <- list() if (!is.null(self$`jsonData`)) { UpdatePetRequestObject[["jsonData"]] <- - self$`jsonData`$toJSON() + self$`jsonData`$toSimpleType() } if (!is.null(self$`binaryDataN2Information`)) { UpdatePetRequestObject[["binaryDataN2Information"]] <- self$`binaryDataN2Information` } - UpdatePetRequestObject + return(UpdatePetRequestObject) }, #' @description @@ -71,29 +96,13 @@ UpdatePetRequest <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return UpdatePetRequest in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`jsonData`)) { - sprintf( - '"jsonData": - %s - ', - jsonlite::toJSON(self$`jsonData`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`binaryDataN2Information`)) { - sprintf( - '"binaryDataN2Information": - "%s" - ', - self$`binaryDataN2Information` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/user.R b/samples/client/petstore/R-httr2/R/user.R index e7b911abc312..76c4970a45d6 100644 --- a/samples/client/petstore/R-httr2/R/user.R +++ b/samples/client/petstore/R-httr2/R/user.R @@ -94,10 +94,35 @@ User <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return User in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return User as a base R list. + #' @examples + #' # convert array of User (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert User to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { UserObject <- list() if (!is.null(self$`id`)) { UserObject[["id"]] <- @@ -131,7 +156,7 @@ User <- R6::R6Class( UserObject[["userStatus"]] <- self$`userStatus` } - UserObject + return(UserObject) }, #' @description @@ -170,77 +195,13 @@ User <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return User in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`username`)) { - sprintf( - '"username": - "%s" - ', - self$`username` - ) - }, - if (!is.null(self$`firstName`)) { - sprintf( - '"firstName": - "%s" - ', - self$`firstName` - ) - }, - if (!is.null(self$`lastName`)) { - sprintf( - '"lastName": - "%s" - ', - self$`lastName` - ) - }, - if (!is.null(self$`email`)) { - sprintf( - '"email": - "%s" - ', - self$`email` - ) - }, - if (!is.null(self$`password`)) { - sprintf( - '"password": - "%s" - ', - self$`password` - ) - }, - if (!is.null(self$`phone`)) { - sprintf( - '"phone": - "%s" - ', - self$`phone` - ) - }, - if (!is.null(self$`userStatus`)) { - sprintf( - '"userStatus": - %d - ', - self$`userStatus` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/user_api.R b/samples/client/petstore/R-httr2/R/user_api.R index 9487ca7835b0..a1496d504727 100644 --- a/samples/client/petstore/R-httr2/R/user_api.R +++ b/samples/client/petstore/R-httr2/R/user_api.R @@ -318,7 +318,7 @@ UserApi <- R6::R6Class( if (!is.null(`user`)) { local_var_body <- `user`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user" @@ -428,7 +428,7 @@ UserApi <- R6::R6Class( })), collapse = ",") local_var_body <- paste0("[", body.items, "]") } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/createWithArray" @@ -538,7 +538,7 @@ UserApi <- R6::R6Class( })), collapse = ",") local_var_body <- paste0("[", body.items, "]") } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/createWithList" @@ -1099,7 +1099,7 @@ UserApi <- R6::R6Class( if (!is.null(`user`)) { local_var_body <- `user`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/{username}" diff --git a/samples/client/petstore/R-httr2/R/whale.R b/samples/client/petstore/R-httr2/R/whale.R index 4656c11680d5..fef88a7c6375 100644 --- a/samples/client/petstore/R-httr2/R/whale.R +++ b/samples/client/petstore/R-httr2/R/whale.R @@ -49,10 +49,35 @@ Whale <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Whale in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Whale as a base R list. + #' @examples + #' # convert array of Whale (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Whale to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { WhaleObject <- list() if (!is.null(self$`hasBaleen`)) { WhaleObject[["hasBaleen"]] <- @@ -66,7 +91,7 @@ Whale <- R6::R6Class( WhaleObject[["className"]] <- self$`className` } - WhaleObject + return(WhaleObject) }, #' @description @@ -90,37 +115,13 @@ Whale <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Whale in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`hasBaleen`)) { - sprintf( - '"hasBaleen": - %s - ', - tolower(self$`hasBaleen`) - ) - }, - if (!is.null(self$`hasTeeth`)) { - sprintf( - '"hasTeeth": - %s - ', - tolower(self$`hasTeeth`) - ) - }, - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/R/zebra.R b/samples/client/petstore/R-httr2/R/zebra.R index 95f216c3ce52..c5165a867082 100644 --- a/samples/client/petstore/R-httr2/R/zebra.R +++ b/samples/client/petstore/R-httr2/R/zebra.R @@ -43,10 +43,35 @@ Zebra <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Zebra in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Zebra as a base R list. + #' @examples + #' # convert array of Zebra (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Zebra to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { ZebraObject <- list() if (!is.null(self$`type`)) { ZebraObject[["type"]] <- @@ -56,7 +81,7 @@ Zebra <- R6::R6Class( ZebraObject[["className"]] <- self$`className` } - ZebraObject + return(ZebraObject) }, #' @description @@ -80,29 +105,13 @@ Zebra <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Zebra in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + toJSONString = function(...) { + simple <- self$toSimpleType() + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R-httr2/tests/testthat/test_petstore.R b/samples/client/petstore/R-httr2/tests/testthat/test_petstore.R index b612714b8122..ec1816d3c39d 100644 --- a/samples/client/petstore/R-httr2/tests/testthat/test_petstore.R +++ b/samples/client/petstore/R-httr2/tests/testthat/test_petstore.R @@ -23,7 +23,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString", { # tests for other pet objects pet0 <- Pet$new() - jsonpet <- pet0$toJSON() + jsonpet <- pet0$toSimpleType() pet2 <- pet0$fromJSON( jsonlite::toJSON(jsonpet, auto_unbox = TRUE) ) @@ -49,7 +49,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString", { ), status = "available" ) - jsonpet <- pet1$toJSON() + jsonpet <- pet1$toSimpleType() pet2 <- pet1$fromJSON( jsonlite::toJSON(jsonpet, auto_unbox = TRUE) ) @@ -71,7 +71,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString", { test_that("Test Category", { c1 <- Category$new(id = 450, name = "test_cat") c2 <- Category$new() - c2$fromJSON(jsonlite::toJSON(c1$toJSON(), auto_unbox = TRUE)) + c2$fromJSON(jsonlite::toJSON(c1$toSimpleType(), auto_unbox = TRUE)) expect_equal(c1, c2) c2$fromJSONString(c1$toJSONString()) expect_equal(c1, c2) diff --git a/samples/client/petstore/R/R/allof_tag_api_response.R b/samples/client/petstore/R/R/allof_tag_api_response.R index 454e378a5c16..018600362d38 100644 --- a/samples/client/petstore/R/R/allof_tag_api_response.R +++ b/samples/client/petstore/R/R/allof_tag_api_response.R @@ -77,10 +77,35 @@ AllofTagApiResponse <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return AllofTagApiResponse in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return AllofTagApiResponse as a base R list. + #' @examples + #' # convert array of AllofTagApiResponse (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert AllofTagApiResponse to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { AllofTagApiResponseObject <- list() if (!is.null(self$`id`)) { AllofTagApiResponseObject[["id"]] <- @@ -106,7 +131,7 @@ AllofTagApiResponse <- R6::R6Class( AllofTagApiResponseObject[[key]] <- self$additional_properties[[key]] } - AllofTagApiResponseObject + return(AllofTagApiResponseObject) }, #' @description @@ -143,58 +168,16 @@ AllofTagApiResponse <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return AllofTagApiResponse in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`code`)) { - sprintf( - '"code": - %d - ', - self$`code` - ) - }, - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`message`)) { - sprintf( - '"message": - "%s" - ', - self$`message` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/animal.R b/samples/client/petstore/R/R/animal.R index 471a01afef3b..cf2e97f9af30 100644 --- a/samples/client/petstore/R/R/animal.R +++ b/samples/client/petstore/R/R/animal.R @@ -52,10 +52,35 @@ Animal <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Animal in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Animal as a base R list. + #' @examples + #' # convert array of Animal (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Animal to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { AnimalObject <- list() if (!is.null(self$`className`)) { AnimalObject[["className"]] <- @@ -69,7 +94,7 @@ Animal <- R6::R6Class( AnimalObject[[key]] <- self$additional_properties[[key]] } - AnimalObject + return(AnimalObject) }, #' @description @@ -97,34 +122,16 @@ Animal <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Animal in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/any_of_pig.R b/samples/client/petstore/R/R/any_of_pig.R index ba3c8ea856d9..7480eec76961 100644 --- a/samples/client/petstore/R/R/any_of_pig.R +++ b/samples/client/petstore/R/R/any_of_pig.R @@ -91,27 +91,32 @@ AnyOfPig <- R6::R6Class( }, #' @description - #' Serialize AnyOfPig to JSON string. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. + toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert AnyOfPig to a base R type #' - #' @return JSON string representation of the AnyOfPig. - toJSONString = function() { + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify((self$actual_instance$toJSONString()))) + return(self$actual_instance$toSimpleType()) } else { NULL } }, #' @description - #' Serialize AnyOfPig to JSON. + #' Serialize AnyOfPig to JSON string. #' - #' @return JSON representation of the AnyOfPig. - toJSON = function() { - if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() - } else { - NULL - } + #' @param ... Parameters passed to `jsonlite::toJSON` + #' @return JSON string representation of the AnyOfPig. + toJSONString = function(...) { + json <- jsonlite::toJSON(self$toSimpleType(), auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/any_of_primitive_type_test.R b/samples/client/petstore/R/R/any_of_primitive_type_test.R index 99aa52c73427..f76defe9f4aa 100644 --- a/samples/client/petstore/R/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R/R/any_of_primitive_type_test.R @@ -111,25 +111,35 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the AnyOfPrimitiveTypeTest. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize AnyOfPrimitiveTypeTest to JSON. - #' - #' @return JSON representation of the AnyOfPrimitiveTypeTest. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert AnyOfPrimitiveTypeTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R/R/basque_pig.R b/samples/client/petstore/R/R/basque_pig.R index cce82cd7d932..ca8601f4c3b1 100644 --- a/samples/client/petstore/R/R/basque_pig.R +++ b/samples/client/petstore/R/R/basque_pig.R @@ -50,10 +50,35 @@ BasquePig <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return BasquePig in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return BasquePig as a base R list. + #' @examples + #' # convert array of BasquePig (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert BasquePig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { BasquePigObject <- list() if (!is.null(self$`className`)) { BasquePigObject[["className"]] <- @@ -67,7 +92,7 @@ BasquePig <- R6::R6Class( BasquePigObject[[key]] <- self$additional_properties[[key]] } - BasquePigObject + return(BasquePigObject) }, #' @description @@ -95,34 +120,16 @@ BasquePig <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return BasquePig in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/cat.R b/samples/client/petstore/R/R/cat.R index b4014681ba49..270b87c21643 100644 --- a/samples/client/petstore/R/R/cat.R +++ b/samples/client/petstore/R/R/cat.R @@ -60,10 +60,35 @@ Cat <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Cat in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Cat as a base R list. + #' @examples + #' # convert array of Cat (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Cat to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CatObject <- list() if (!is.null(self$`className`)) { CatObject[["className"]] <- @@ -81,7 +106,7 @@ Cat <- R6::R6Class( CatObject[[key]] <- self$additional_properties[[key]] } - CatObject + return(CatObject) }, #' @description @@ -112,42 +137,16 @@ Cat <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Cat in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`declawed`)) { - sprintf( - '"declawed": - %s - ', - tolower(self$`declawed`) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/category.R b/samples/client/petstore/R/R/category.R index 31106a3bc9e2..0dcbd1b81610 100644 --- a/samples/client/petstore/R/R/category.R +++ b/samples/client/petstore/R/R/category.R @@ -50,10 +50,35 @@ Category <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Category in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Category as a base R list. + #' @examples + #' # convert array of Category (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Category to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { CategoryObject <- list() if (!is.null(self$`id`)) { CategoryObject[["id"]] <- @@ -67,7 +92,7 @@ Category <- R6::R6Class( CategoryObject[[key]] <- self$additional_properties[[key]] } - CategoryObject + return(CategoryObject) }, #' @description @@ -95,34 +120,16 @@ Category <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Category in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/danish_pig.R b/samples/client/petstore/R/R/danish_pig.R index 08ca2b9e3eea..02d2208639b0 100644 --- a/samples/client/petstore/R/R/danish_pig.R +++ b/samples/client/petstore/R/R/danish_pig.R @@ -50,10 +50,35 @@ DanishPig <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DanishPig in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DanishPig as a base R list. + #' @examples + #' # convert array of DanishPig (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DanishPig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DanishPigObject <- list() if (!is.null(self$`className`)) { DanishPigObject[["className"]] <- @@ -67,7 +92,7 @@ DanishPig <- R6::R6Class( DanishPigObject[[key]] <- self$additional_properties[[key]] } - DanishPigObject + return(DanishPigObject) }, #' @description @@ -95,34 +120,16 @@ DanishPig <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DanishPig in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`size`)) { - sprintf( - '"size": - %d - ', - self$`size` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/date.R b/samples/client/petstore/R/R/date.R index d9b6ec0beb1b..411249d3fba1 100644 --- a/samples/client/petstore/R/R/date.R +++ b/samples/client/petstore/R/R/date.R @@ -63,10 +63,35 @@ Date <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Date in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Date as a base R list. + #' @examples + #' # convert array of Date (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Date to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DateObject <- list() if (!is.null(self$`className`)) { DateObject[["className"]] <- @@ -84,7 +109,7 @@ Date <- R6::R6Class( DateObject[[key]] <- self$additional_properties[[key]] } - DateObject + return(DateObject) }, #' @description @@ -119,42 +144,16 @@ Date <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Date in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`percent_description`)) { - sprintf( - '"percent_description": - "%s" - ', - self$`percent_description` - ) - }, - if (!is.null(self$`url_property`)) { - sprintf( - '"url_property": - "%s" - ', - self$`url_property` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/dog.R b/samples/client/petstore/R/R/dog.R index 34ae29121163..4d6dab71c61b 100644 --- a/samples/client/petstore/R/R/dog.R +++ b/samples/client/petstore/R/R/dog.R @@ -60,10 +60,35 @@ Dog <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Dog in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Dog as a base R list. + #' @examples + #' # convert array of Dog (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Dog to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DogObject <- list() if (!is.null(self$`className`)) { DogObject[["className"]] <- @@ -81,7 +106,7 @@ Dog <- R6::R6Class( DogObject[[key]] <- self$additional_properties[[key]] } - DogObject + return(DogObject) }, #' @description @@ -112,42 +137,16 @@ Dog <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Dog in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - }, - if (!is.null(self$`color`)) { - sprintf( - '"color": - "%s" - ', - self$`color` - ) - }, - if (!is.null(self$`breed`)) { - sprintf( - '"breed": - "%s" - ', - self$`breed` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/dummy_model.R b/samples/client/petstore/R/R/dummy_model.R index 12d3ab52a155..cbea7830b824 100644 --- a/samples/client/petstore/R/R/dummy_model.R +++ b/samples/client/petstore/R/R/dummy_model.R @@ -41,10 +41,35 @@ DummyModel <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return DummyModel in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return DummyModel as a base R list. + #' @examples + #' # convert array of DummyModel (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert DummyModel to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { DummyModelObject <- list() if (!is.null(self$`property`)) { DummyModelObject[["property"]] <- @@ -54,7 +79,7 @@ DummyModel <- R6::R6Class( DummyModelObject[[key]] <- self$additional_properties[[key]] } - DummyModelObject + return(DummyModelObject) }, #' @description @@ -79,26 +104,16 @@ DummyModel <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return DummyModel in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`property`)) { - sprintf( - '"property": - "%s" - ', - self$`property` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index ee88e7eba789..452eab587ded 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -225,7 +225,7 @@ FakeApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/fake/test_optional_body_parameter" diff --git a/samples/client/petstore/R/R/format_test.R b/samples/client/petstore/R/R/format_test.R index f93bf1435c9a..7d1bded3c5a8 100644 --- a/samples/client/petstore/R/R/format_test.R +++ b/samples/client/petstore/R/R/format_test.R @@ -158,10 +158,35 @@ FormatTest <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return FormatTest in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return FormatTest as a base R list. + #' @examples + #' # convert array of FormatTest (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert FormatTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { FormatTestObject <- list() if (!is.null(self$`integer`)) { FormatTestObject[["integer"]] <- @@ -227,7 +252,7 @@ FormatTest <- R6::R6Class( FormatTestObject[[key]] <- self$additional_properties[[key]] } - FormatTestObject + return(FormatTestObject) }, #' @description @@ -294,138 +319,16 @@ FormatTest <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return FormatTest in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`integer`)) { - sprintf( - '"integer": - %d - ', - self$`integer` - ) - }, - if (!is.null(self$`int32`)) { - sprintf( - '"int32": - %d - ', - self$`int32` - ) - }, - if (!is.null(self$`int64`)) { - sprintf( - '"int64": - %d - ', - self$`int64` - ) - }, - if (!is.null(self$`number`)) { - sprintf( - '"number": - %d - ', - self$`number` - ) - }, - if (!is.null(self$`float`)) { - sprintf( - '"float": - %d - ', - self$`float` - ) - }, - if (!is.null(self$`double`)) { - sprintf( - '"double": - %d - ', - self$`double` - ) - }, - if (!is.null(self$`string`)) { - sprintf( - '"string": - "%s" - ', - self$`string` - ) - }, - if (!is.null(self$`byte`)) { - sprintf( - '"byte": - "%s" - ', - self$`byte` - ) - }, - if (!is.null(self$`binary`)) { - sprintf( - '"binary": - "%s" - ', - self$`binary` - ) - }, - if (!is.null(self$`date`)) { - sprintf( - '"date": - "%s" - ', - self$`date` - ) - }, - if (!is.null(self$`dateTime`)) { - sprintf( - '"dateTime": - "%s" - ', - self$`dateTime` - ) - }, - if (!is.null(self$`uuid`)) { - sprintf( - '"uuid": - "%s" - ', - self$`uuid` - ) - }, - if (!is.null(self$`password`)) { - sprintf( - '"password": - "%s" - ', - self$`password` - ) - }, - if (!is.null(self$`pattern_with_digits`)) { - sprintf( - '"pattern_with_digits": - "%s" - ', - self$`pattern_with_digits` - ) - }, - if (!is.null(self$`pattern_with_digits_and_delimiter`)) { - sprintf( - '"pattern_with_digits_and_delimiter": - "%s" - ', - self$`pattern_with_digits_and_delimiter` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/mammal.R b/samples/client/petstore/R/R/mammal.R index bbd57ed00acb..3d93ab765e39 100644 --- a/samples/client/petstore/R/R/mammal.R +++ b/samples/client/petstore/R/R/mammal.R @@ -109,25 +109,35 @@ Mammal <- R6::R6Class( #' @description #' Serialize Mammal to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the Mammal. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize Mammal to JSON. - #' - #' @return JSON representation of the Mammal. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert Mammal to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R/R/model_api_response.R b/samples/client/petstore/R/R/model_api_response.R index 9116e438fedc..a3a46dfb7907 100644 --- a/samples/client/petstore/R/R/model_api_response.R +++ b/samples/client/petstore/R/R/model_api_response.R @@ -59,10 +59,35 @@ ModelApiResponse <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return ModelApiResponse in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return ModelApiResponse as a base R list. + #' @examples + #' # convert array of ModelApiResponse (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert ModelApiResponse to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { ModelApiResponseObject <- list() if (!is.null(self$`code`)) { ModelApiResponseObject[["code"]] <- @@ -80,7 +105,7 @@ ModelApiResponse <- R6::R6Class( ModelApiResponseObject[[key]] <- self$additional_properties[[key]] } - ModelApiResponseObject + return(ModelApiResponseObject) }, #' @description @@ -111,42 +136,16 @@ ModelApiResponse <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return ModelApiResponse in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`code`)) { - sprintf( - '"code": - %d - ', - self$`code` - ) - }, - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`message`)) { - sprintf( - '"message": - "%s" - ', - self$`message` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/nested_one_of.R b/samples/client/petstore/R/R/nested_one_of.R index e04a31a69acd..31dcc2f10d01 100644 --- a/samples/client/petstore/R/R/nested_one_of.R +++ b/samples/client/petstore/R/R/nested_one_of.R @@ -48,10 +48,35 @@ NestedOneOf <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return NestedOneOf in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return NestedOneOf as a base R list. + #' @examples + #' # convert array of NestedOneOf (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert NestedOneOf to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { NestedOneOfObject <- list() if (!is.null(self$`size`)) { NestedOneOfObject[["size"]] <- @@ -59,13 +84,13 @@ NestedOneOf <- R6::R6Class( } if (!is.null(self$`nested_pig`)) { NestedOneOfObject[["nested_pig"]] <- - self$`nested_pig`$toJSON() + self$`nested_pig`$toSimpleType() } for (key in names(self$additional_properties)) { NestedOneOfObject[[key]] <- self$additional_properties[[key]] } - NestedOneOfObject + return(NestedOneOfObject) }, #' @description @@ -95,34 +120,16 @@ NestedOneOf <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return NestedOneOf in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`size`)) { - sprintf( - '"size": - %d - ', - self$`size` - ) - }, - if (!is.null(self$`nested_pig`)) { - sprintf( - '"nested_pig": - %s - ', - jsonlite::toJSON(self$`nested_pig`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/one_of_primitive_type_test.R b/samples/client/petstore/R/R/one_of_primitive_type_test.R index 8a9280a9b213..e5b566985620 100644 --- a/samples/client/petstore/R/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R/R/one_of_primitive_type_test.R @@ -111,25 +111,35 @@ OneOfPrimitiveTypeTest <- R6::R6Class( #' @description #' Serialize OneOfPrimitiveTypeTest to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the OneOfPrimitiveTypeTest. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize OneOfPrimitiveTypeTest to JSON. - #' - #' @return JSON representation of the OneOfPrimitiveTypeTest. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert OneOfPrimitiveTypeTest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R/R/order.R b/samples/client/petstore/R/R/order.R index cd84eed74eef..07378f03666c 100644 --- a/samples/client/petstore/R/R/order.R +++ b/samples/client/petstore/R/R/order.R @@ -89,10 +89,35 @@ Order <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Order in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Order as a base R list. + #' @examples + #' # convert array of Order (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Order to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { OrderObject <- list() if (!is.null(self$`id`)) { OrderObject[["id"]] <- @@ -122,7 +147,7 @@ Order <- R6::R6Class( OrderObject[[key]] <- self$additional_properties[[key]] } - OrderObject + return(OrderObject) }, #' @description @@ -165,66 +190,16 @@ Order <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Order in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`petId`)) { - sprintf( - '"petId": - %d - ', - self$`petId` - ) - }, - if (!is.null(self$`quantity`)) { - sprintf( - '"quantity": - %d - ', - self$`quantity` - ) - }, - if (!is.null(self$`shipDate`)) { - sprintf( - '"shipDate": - "%s" - ', - self$`shipDate` - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - }, - if (!is.null(self$`complete`)) { - sprintf( - '"complete": - %s - ', - tolower(self$`complete`) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index 28e1693c419f..27db68d8fdbd 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -85,10 +85,35 @@ Pet <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Pet in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Pet as a base R list. + #' @examples + #' # convert array of Pet (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pet to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetObject <- list() if (!is.null(self$`id`)) { PetObject[["id"]] <- @@ -96,7 +121,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`category`)) { PetObject[["category"]] <- - self$`category`$toJSON() + self$`category`$toSimpleType() } if (!is.null(self$`name`)) { PetObject[["name"]] <- @@ -108,7 +133,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`tags`)) { PetObject[["tags"]] <- - lapply(self$`tags`, function(x) x$toJSON()) + lapply(self$`tags`, function(x) x$toSimpleType()) } if (!is.null(self$`status`)) { PetObject[["status"]] <- @@ -118,7 +143,7 @@ Pet <- R6::R6Class( PetObject[[key]] <- self$additional_properties[[key]] } - PetObject + return(PetObject) }, #' @description @@ -163,66 +188,16 @@ Pet <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Pet in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`category`)) { - sprintf( - '"category": - %s - ', - jsonlite::toJSON(self$`category`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - }, - if (!is.null(self$`photoUrls`)) { - sprintf( - '"photoUrls": - [%s] - ', - paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`tags`)) { - sprintf( - '"tags": - [%s] -', - paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") - ) - }, - if (!is.null(self$`status`)) { - sprintf( - '"status": - "%s" - ', - self$`status` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index a19e01486290..6c74624fad21 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -435,7 +435,7 @@ PetApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/pet" @@ -1288,7 +1288,7 @@ PetApi <- R6::R6Class( if (!is.null(`pet`)) { local_var_body <- `pet`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/pet" diff --git a/samples/client/petstore/R/R/pet_map.R b/samples/client/petstore/R/R/pet_map.R index 1fc910ac1da2..aa59c50a09c0 100644 --- a/samples/client/petstore/R/R/pet_map.R +++ b/samples/client/petstore/R/R/pet_map.R @@ -40,10 +40,35 @@ PetMap <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return PetMap in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return PetMap as a base R list. + #' @examples + #' # convert array of PetMap (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert PetMap to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { PetMapObject <- list() if (!is.null(self$`pet`)) { PetMapObject[["pet"]] <- @@ -53,7 +78,7 @@ PetMap <- R6::R6Class( PetMapObject[[key]] <- self$additional_properties[[key]] } - PetMapObject + return(PetMapObject) }, #' @description @@ -78,26 +103,16 @@ PetMap <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return PetMap in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`pet`)) { - sprintf( - '"pet": - %s - ', - jsonlite::toJSON(lapply(self$`pet`, function(x){ x }), auto_unbox = TRUE, digits = NA) - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/pig.R b/samples/client/petstore/R/R/pig.R index 596a9307d4dc..94067ec4d720 100644 --- a/samples/client/petstore/R/R/pig.R +++ b/samples/client/petstore/R/R/pig.R @@ -109,25 +109,35 @@ Pig <- R6::R6Class( #' @description #' Serialize Pig to JSON string. - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return JSON string representation of the Pig. - toJSONString = function() { + toJSONString = function(...) { + simple <- self$toSimpleType() if (!is.null(self$actual_instance)) { - as.character(jsonlite::minify(self$actual_instance$toJSONString())) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, ...) + return(as.character(jsonlite::minify(json))) } else { - NULL + return(NULL) } }, #' @description - #' Serialize Pig to JSON. - #' - #' @return JSON representation of the Pig. + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert Pig to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { if (!is.null(self$actual_instance)) { - self$actual_instance$toJSON() + return(self$actual_instance$toSimpleType()) } else { - NULL + return(NULL) } }, diff --git a/samples/client/petstore/R/R/special.R b/samples/client/petstore/R/R/special.R index 5841fc79dd39..4c27190313fb 100644 --- a/samples/client/petstore/R/R/special.R +++ b/samples/client/petstore/R/R/special.R @@ -97,10 +97,35 @@ Special <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Special in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Special as a base R list. + #' @examples + #' # convert array of Special (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Special to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { SpecialObject <- list() if (!is.null(self$`set_test`)) { SpecialObject[["set_test"]] <- @@ -134,7 +159,7 @@ Special <- R6::R6Class( SpecialObject[[key]] <- self$additional_properties[[key]] } - SpecialObject + return(SpecialObject) }, #' @description @@ -180,74 +205,16 @@ Special <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Special in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`set_test`)) { - sprintf( - '"set_test": - [%s] - ', - paste(unlist(lapply(self$`set_test`, function(x) paste0('"', x, '"'))), collapse = ",") - ) - }, - if (!is.null(self$`item_self`)) { - sprintf( - '"self": - %d - ', - self$`item_self` - ) - }, - if (!is.null(self$`item_private`)) { - sprintf( - '"private": - "%s" - ', - self$`item_private` - ) - }, - if (!is.null(self$`item_super`)) { - sprintf( - '"super": - "%s" - ', - self$`item_super` - ) - }, - if (!is.null(self$`123_number`)) { - sprintf( - '"123_number": - "%s" - ', - self$`123_number` - ) - }, - if (!is.null(self$`array[test]`)) { - sprintf( - '"array[test]": - "%s" - ', - self$`array[test]` - ) - }, - if (!is.null(self$`empty_string`)) { - sprintf( - '"empty_string": - "%s" - ', - self$`empty_string` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 6889cdf7aa70..81acb942675c 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -546,7 +546,7 @@ StoreApi <- R6::R6Class( if (!is.null(`order`)) { local_var_body <- `order`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/store/order" diff --git a/samples/client/petstore/R/R/tag.R b/samples/client/petstore/R/R/tag.R index c9ec58ae6b82..b4c893dfe77e 100644 --- a/samples/client/petstore/R/R/tag.R +++ b/samples/client/petstore/R/R/tag.R @@ -50,10 +50,35 @@ Tag <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Tag in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Tag as a base R list. + #' @examples + #' # convert array of Tag (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Tag to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { TagObject <- list() if (!is.null(self$`id`)) { TagObject[["id"]] <- @@ -67,7 +92,7 @@ Tag <- R6::R6Class( TagObject[[key]] <- self$additional_properties[[key]] } - TagObject + return(TagObject) }, #' @description @@ -95,34 +120,16 @@ Tag <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Tag in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`name`)) { - sprintf( - '"name": - "%s" - ', - self$`name` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/update_pet_request.R b/samples/client/petstore/R/R/update_pet_request.R index 47369030cfac..3559d3c4d838 100644 --- a/samples/client/petstore/R/R/update_pet_request.R +++ b/samples/client/petstore/R/R/update_pet_request.R @@ -45,14 +45,39 @@ UpdatePetRequest <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return UpdatePetRequest in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return UpdatePetRequest as a base R list. + #' @examples + #' # convert array of UpdatePetRequest (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert UpdatePetRequest to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { UpdatePetRequestObject <- list() if (!is.null(self$`jsonData`)) { UpdatePetRequestObject[["jsonData"]] <- - self$`jsonData`$toJSON() + self$`jsonData`$toSimpleType() } if (!is.null(self$`binaryDataN2Information`)) { UpdatePetRequestObject[["binaryDataN2Information"]] <- @@ -62,7 +87,7 @@ UpdatePetRequest <- R6::R6Class( UpdatePetRequestObject[[key]] <- self$additional_properties[[key]] } - UpdatePetRequestObject + return(UpdatePetRequestObject) }, #' @description @@ -92,34 +117,16 @@ UpdatePetRequest <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return UpdatePetRequest in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`jsonData`)) { - sprintf( - '"jsonData": - %s - ', - jsonlite::toJSON(self$`jsonData`$toJSON(), auto_unbox = TRUE, digits = NA) - ) - }, - if (!is.null(self$`binaryDataN2Information`)) { - sprintf( - '"binaryDataN2Information": - "%s" - ', - self$`binaryDataN2Information` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/user.R b/samples/client/petstore/R/R/user.R index df4396abb2ca..361d0d454f21 100644 --- a/samples/client/petstore/R/R/user.R +++ b/samples/client/petstore/R/R/user.R @@ -104,10 +104,35 @@ User <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return User in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return User as a base R list. + #' @examples + #' # convert array of User (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert User to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { UserObject <- list() if (!is.null(self$`id`)) { UserObject[["id"]] <- @@ -145,7 +170,7 @@ User <- R6::R6Class( UserObject[[key]] <- self$additional_properties[[key]] } - UserObject + return(UserObject) }, #' @description @@ -191,82 +216,16 @@ User <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return User in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`id`)) { - sprintf( - '"id": - %d - ', - self$`id` - ) - }, - if (!is.null(self$`username`)) { - sprintf( - '"username": - "%s" - ', - self$`username` - ) - }, - if (!is.null(self$`firstName`)) { - sprintf( - '"firstName": - "%s" - ', - self$`firstName` - ) - }, - if (!is.null(self$`lastName`)) { - sprintf( - '"lastName": - "%s" - ', - self$`lastName` - ) - }, - if (!is.null(self$`email`)) { - sprintf( - '"email": - "%s" - ', - self$`email` - ) - }, - if (!is.null(self$`password`)) { - sprintf( - '"password": - "%s" - ', - self$`password` - ) - }, - if (!is.null(self$`phone`)) { - sprintf( - '"phone": - "%s" - ', - self$`phone` - ) - }, - if (!is.null(self$`userStatus`)) { - sprintf( - '"userStatus": - %d - ', - self$`userStatus` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 389cc69b57e4..39b793e40f75 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -318,7 +318,7 @@ UserApi <- R6::R6Class( if (!is.null(`user`)) { local_var_body <- `user`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user" @@ -428,7 +428,7 @@ UserApi <- R6::R6Class( })), collapse = ",") local_var_body <- paste0("[", body.items, "]") } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/createWithArray" @@ -538,7 +538,7 @@ UserApi <- R6::R6Class( })), collapse = ",") local_var_body <- paste0("[", body.items, "]") } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/createWithList" @@ -1099,7 +1099,7 @@ UserApi <- R6::R6Class( if (!is.null(`user`)) { local_var_body <- `user`$toJSONString() } else { - body <- NULL + local_var_body <- NULL } local_var_url_path <- "/user/{username}" diff --git a/samples/client/petstore/R/R/whale.R b/samples/client/petstore/R/R/whale.R index e39211045a76..ea54d3bdf71c 100644 --- a/samples/client/petstore/R/R/whale.R +++ b/samples/client/petstore/R/R/whale.R @@ -59,10 +59,35 @@ Whale <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Whale in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Whale as a base R list. + #' @examples + #' # convert array of Whale (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Whale to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { WhaleObject <- list() if (!is.null(self$`hasBaleen`)) { WhaleObject[["hasBaleen"]] <- @@ -80,7 +105,7 @@ Whale <- R6::R6Class( WhaleObject[[key]] <- self$additional_properties[[key]] } - WhaleObject + return(WhaleObject) }, #' @description @@ -111,42 +136,16 @@ Whale <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Whale in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`hasBaleen`)) { - sprintf( - '"hasBaleen": - %s - ', - tolower(self$`hasBaleen`) - ) - }, - if (!is.null(self$`hasTeeth`)) { - sprintf( - '"hasTeeth": - %s - ', - tolower(self$`hasTeeth`) - ) - }, - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/R/zebra.R b/samples/client/petstore/R/R/zebra.R index fb6d90d4d983..6b85dbff4093 100644 --- a/samples/client/petstore/R/R/zebra.R +++ b/samples/client/petstore/R/R/zebra.R @@ -53,10 +53,35 @@ Zebra <- R6::R6Class( }, #' @description - #' To JSON String - #' - #' @return Zebra in JSON format + #' Convert to an R object. This method is deprecated. Use `toSimpleType()` instead. toJSON = function() { + .Deprecated(new = "toSimpleType", msg = "Use the '$toSimpleType()' method instead since that is more clearly named. Use '$toJSONString()' to get a JSON string") + return(self$toSimpleType()) + }, + + #' @description + #' Convert to a List + #' + #' Convert the R6 object to a list to work more easily with other tooling. + #' + #' @return Zebra as a base R list. + #' @examples + #' # convert array of Zebra (x) to a data frame + #' \dontrun{ + #' library(purrr) + #' library(tibble) + #' df <- x |> map(\(y)y$toList()) |> map(as_tibble) |> list_rbind() + #' df + #' } + toList = function() { + return(self$toSimpleType()) + }, + + #' @description + #' Convert Zebra to a base R type + #' + #' @return A base R type, e.g. a list or numeric/character array. + toSimpleType = function() { ZebraObject <- list() if (!is.null(self$`type`)) { ZebraObject[["type"]] <- @@ -70,7 +95,7 @@ Zebra <- R6::R6Class( ZebraObject[[key]] <- self$additional_properties[[key]] } - ZebraObject + return(ZebraObject) }, #' @description @@ -101,34 +126,16 @@ Zebra <- R6::R6Class( #' @description #' To JSON String - #' + #' + #' @param ... Parameters passed to `jsonlite::toJSON` #' @return Zebra in JSON format - toJSONString = function() { - jsoncontent <- c( - if (!is.null(self$`type`)) { - sprintf( - '"type": - "%s" - ', - self$`type` - ) - }, - if (!is.null(self$`className`)) { - sprintf( - '"className": - "%s" - ', - self$`className` - ) - } - ) - jsoncontent <- paste(jsoncontent, collapse = ",") - json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) - json_obj <- jsonlite::fromJSON(json_string) + toJSONString = function(...) { + simple <- self$toSimpleType() for (key in names(self$additional_properties)) { - json_obj[[key]] <- self$additional_properties[[key]] + simple[[key]] <- self$additional_properties[[key]] } - json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + json <- jsonlite::toJSON(simple, auto_unbox = TRUE, digits = NA, ...) + return(as.character(jsonlite::minify(json))) }, #' @description diff --git a/samples/client/petstore/R/tests/testthat/test_petstore.R b/samples/client/petstore/R/tests/testthat/test_petstore.R index f7a70df4f9d5..641e2cbb2751 100644 --- a/samples/client/petstore/R/tests/testthat/test_petstore.R +++ b/samples/client/petstore/R/tests/testthat/test_petstore.R @@ -42,7 +42,7 @@ test_that("Test FindPetByStatus", { test_that("Test toJSON toJSONString fromJSON fromJSONString", { pet0 <- Pet$new() - jsonpet <- pet0$toJSON() + jsonpet <- pet0$toSimpleType() pet2 <- pet0$fromJSON( jsonlite::toJSON(jsonpet, auto_unbox = TRUE) ) @@ -68,7 +68,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString", { ), status = "available" ) - jsonpet <- pet1$toJSON() + jsonpet <- pet1$toSimpleType() pet2 <- pet1$fromJSON( jsonlite::toJSON(jsonpet, auto_unbox = TRUE) ) @@ -90,7 +90,7 @@ test_that("Test toJSON toJSONString fromJSON fromJSONString", { test_that("Test Category", { c1 <- Category$new(id = 450, name = "test_cat") c2 <- Category$new() - c2$fromJSON(jsonlite::toJSON(c1$toJSON(), auto_unbox = TRUE)) + c2$fromJSON(jsonlite::toJSON(c1$toSimpleType(), auto_unbox = TRUE)) expect_equal(c1, c2) c2$fromJSONString(c1$toJSONString()) expect_equal(c1, c2) From 25cfac0523fc661d2915930a29acfb712cbf3024 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 28 Nov 2024 17:20:37 +0800 Subject: [PATCH 07/40] Update r petstore client test script (#20196) * update R build and test script in petstore samples * update --- samples/client/echo_api/r/build_and_test.bash | 2 +- samples/client/petstore/R-httr2-wrapper/build_and_test.bash | 2 +- samples/client/petstore/R-httr2/build_and_test.bash | 2 +- samples/client/petstore/R/build_and_test.bash | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/echo_api/r/build_and_test.bash b/samples/client/echo_api/r/build_and_test.bash index 730dd53024a6..40888c9286e5 100644 --- a/samples/client/echo_api/r/build_and_test.bash +++ b/samples/client/echo_api/r/build_and_test.bash @@ -23,4 +23,4 @@ mkdir $R_LIBS_USER || true # R CMD build . R CMD check *tar.gz --no-manual -R CMD install --preclean *tar.gz +R CMD INSTALL --preclean *tar.gz diff --git a/samples/client/petstore/R-httr2-wrapper/build_and_test.bash b/samples/client/petstore/R-httr2-wrapper/build_and_test.bash index 2079f75da032..90e8fc71c9c8 100644 --- a/samples/client/petstore/R-httr2-wrapper/build_and_test.bash +++ b/samples/client/petstore/R-httr2-wrapper/build_and_test.bash @@ -23,4 +23,4 @@ rm petstore_1.0.0.tar.gz || true R CMD build . R CMD check *tar.gz --no-manual -R CMD install --preclean *tar.gz +R CMD INSTALL --preclean *tar.gz diff --git a/samples/client/petstore/R-httr2/build_and_test.bash b/samples/client/petstore/R-httr2/build_and_test.bash index 2079f75da032..90e8fc71c9c8 100644 --- a/samples/client/petstore/R-httr2/build_and_test.bash +++ b/samples/client/petstore/R-httr2/build_and_test.bash @@ -23,4 +23,4 @@ rm petstore_1.0.0.tar.gz || true R CMD build . R CMD check *tar.gz --no-manual -R CMD install --preclean *tar.gz +R CMD INSTALL --preclean *tar.gz diff --git a/samples/client/petstore/R/build_and_test.bash b/samples/client/petstore/R/build_and_test.bash index 21baf21970d6..52cd6d1b8386 100644 --- a/samples/client/petstore/R/build_and_test.bash +++ b/samples/client/petstore/R/build_and_test.bash @@ -25,4 +25,4 @@ rm petstore_1.0.0.tar.gz || true R CMD build . R CMD check *tar.gz --no-manual -R CMD install --preclean *tar.gz +R CMD INSTALL --preclean *tar.gz From 326f100f0e4e50f569f43fbceaa5448b407fa8f9 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Thu, 28 Nov 2024 11:01:37 +0100 Subject: [PATCH 08/40] fix(#20201): static access to normalizeMediaType in typescript object serializer (#20202) accessing `normalizeMediaType` should be done static in `ObjectSerializer`, as described in https://github.com/OpenAPITools/openapi-generator/issues/20201. fix applies only to the `typescript` generator. --- .../main/resources/typescript/model/ObjectSerializer.mustache | 2 +- .../typescript/builds/array-of-lists/models/ObjectSerializer.ts | 2 +- .../builds/enum-single-value/models/ObjectSerializer.ts | 2 +- .../builds/null-types-simple/models/ObjectSerializer.ts | 2 +- .../builds/with-unique-items/models/ObjectSerializer.ts | 2 +- .../typescript/encode-decode/build/models/ObjectSerializer.ts | 2 +- .../typescript/builds/browser/models/ObjectSerializer.ts | 2 +- .../builds/composed-schemas/models/ObjectSerializer.ts | 2 +- .../typescript/builds/default/models/ObjectSerializer.ts | 2 +- .../petstore/typescript/builds/deno/models/ObjectSerializer.ts | 2 +- .../builds/deno_object_params/models/ObjectSerializer.ts | 2 +- .../typescript/builds/explode-query/models/ObjectSerializer.ts | 2 +- .../typescript/builds/inversify/models/ObjectSerializer.ts | 2 +- .../typescript/builds/jquery/models/ObjectSerializer.ts | 2 +- .../typescript/builds/nullable-enum/models/ObjectSerializer.ts | 2 +- .../typescript/builds/object_params/models/ObjectSerializer.ts | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache index 53bf799186d1..9cfa5b3475f0 100644 --- a/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache @@ -287,7 +287,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/client/others/typescript/builds/array-of-lists/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/array-of-lists/models/ObjectSerializer.ts index 6e6185206e0e..3d607eb960ef 100644 --- a/samples/client/others/typescript/builds/array-of-lists/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/array-of-lists/models/ObjectSerializer.ts @@ -262,7 +262,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts index 52f66a587fdf..15b6c13639d3 100644 --- a/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts @@ -264,7 +264,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/client/others/typescript/builds/null-types-simple/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/null-types-simple/models/ObjectSerializer.ts index 5419a192b738..d44f397943e3 100644 --- a/samples/client/others/typescript/builds/null-types-simple/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/null-types-simple/models/ObjectSerializer.ts @@ -262,7 +262,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts index 5720a08e7f62..6040ede547f6 100644 --- a/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts @@ -259,7 +259,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/client/others/typescript/encode-decode/build/models/ObjectSerializer.ts b/samples/client/others/typescript/encode-decode/build/models/ObjectSerializer.ts index 44d6f6ab6680..59eea6798cc5 100644 --- a/samples/client/others/typescript/encode-decode/build/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/encode-decode/build/models/ObjectSerializer.ts @@ -262,7 +262,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts index d91174d51316..2f297efed757 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts index 241ae2d78de7..1f3c61a072ca 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts @@ -281,7 +281,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts index d91174d51316..2f297efed757 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts index b73337a35202..60e339c8ae08 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/models/ObjectSerializer.ts index b73337a35202..60e339c8ae08 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/models/ObjectSerializer.ts index 4b95a65872ba..97cbc6966a85 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/models/ObjectSerializer.ts @@ -406,7 +406,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts index d91174d51316..2f297efed757 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts index d91174d51316..2f297efed757 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/models/ObjectSerializer.ts index 134a7cf94394..b7087b6774a8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/models/ObjectSerializer.ts @@ -260,7 +260,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts index d91174d51316..2f297efed757 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts @@ -276,7 +276,7 @@ export class ObjectSerializer { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); for (const predicate of supportedMimeTypePredicatesWithPriority) { for (const mediaType of normalMediaTypes) { From 34bd02109e9df553546020d25e8f134fed0f3196 Mon Sep 17 00:00:00 2001 From: Thomas Ville Date: Fri, 29 Nov 2024 10:07:30 +0100 Subject: [PATCH 09/40] [rust][reqwest] support binary type for download (#20031) * [rust][reqwest] support binary type for upload and download * [rust][reqwest] support binary download in supportMultipleResponses contexts * [rust][reqwest] support binary responses that don't have any return type --- .../main/resources/rust/reqwest/api.mustache | 23 +++++++++++++++--- .../src/apis/default_api.rs | 3 ++- .../src/apis/default_api.rs | 2 +- .../composed-oneof/src/apis/default_api.rs | 5 ++-- .../emptyObject/src/apis/default_api.rs | 3 ++- .../oneOf-array-map/src/apis/default_api.rs | 5 ++-- .../oneOf-reuseRef/src/apis/default_api.rs | 3 ++- .../rust/reqwest/oneOf/src/apis/bar_api.rs | 3 ++- .../rust/reqwest/oneOf/src/apis/foo_api.rs | 6 +++-- .../reqwest/name-mapping/src/apis/fake_api.rs | 2 +- .../src/apis/fake_api.rs | 3 ++- .../src/apis/pet_api.rs | 24 ++++++++++++------- .../src/apis/store_api.rs | 12 ++++++---- .../src/apis/testing_api.rs | 11 ++++----- .../src/apis/user_api.rs | 24 ++++++++++++------- .../src/apis/fake_api.rs | 3 ++- .../src/apis/pet_api.rs | 24 ++++++++++++------- .../src/apis/store_api.rs | 12 ++++++---- .../src/apis/testing_api.rs | 11 ++++----- .../src/apis/user_api.rs | 24 ++++++++++++------- .../petstore-async/src/apis/fake_api.rs | 3 ++- .../petstore-async/src/apis/pet_api.rs | 24 ++++++++++++------- .../petstore-async/src/apis/store_api.rs | 12 ++++++---- .../petstore-async/src/apis/testing_api.rs | 11 ++++----- .../petstore-async/src/apis/user_api.rs | 24 ++++++++++++------- .../petstore-avoid-box/src/apis/fake_api.rs | 3 ++- .../petstore-avoid-box/src/apis/pet_api.rs | 24 ++++++++++++------- .../petstore-avoid-box/src/apis/store_api.rs | 12 ++++++---- .../src/apis/testing_api.rs | 11 ++++----- .../petstore-avoid-box/src/apis/user_api.rs | 24 ++++++++++++------- .../src/apis/fake_api.rs | 2 +- .../src/apis/pet_api.rs | 22 ++++++++++------- .../src/apis/store_api.rs | 11 +++++---- .../src/apis/testing_api.rs | 9 +++---- .../src/apis/user_api.rs | 18 +++++++------- .../src/apis/fake_api.rs | 2 +- .../src/apis/pet_api.rs | 22 ++++++++++------- .../src/apis/store_api.rs | 11 +++++---- .../src/apis/testing_api.rs | 9 +++---- .../src/apis/user_api.rs | 18 +++++++------- .../reqwest/petstore/src/apis/fake_api.rs | 2 +- .../rust/reqwest/petstore/src/apis/pet_api.rs | 22 ++++++++++------- .../reqwest/petstore/src/apis/store_api.rs | 11 +++++---- .../reqwest/petstore/src/apis/testing_api.rs | 9 +++---- .../reqwest/petstore/src/apis/user_api.rs | 18 +++++++------- 45 files changed, 339 insertions(+), 198 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index dc0cf75205c0..b96063531e61 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -80,7 +80,7 @@ pub enum {{{operationIdCamelCase}}}Error { /// {{{.}}} {{/notes}} {{#vendorExtensions.x-group-parameters}} -pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration{{#allParams}}{{#-first}}, params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>> { +pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration{{#allParams}}{{#-first}}, params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{#isResponseFile}}{{#supportAsync}}reqwest::Response{{/supportAsync}}{{^supportAsync}}reqwest::blocking::Response{{/supportAsync}}{{/isResponseFile}}{{^isResponseFile}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{/isResponseFile}}, Error<{{{operationIdCamelCase}}}Error>> { let local_var_configuration = configuration; // unbox the parameters @@ -90,7 +90,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{/vendorExtensions.x-group-parameters}} {{^vendorExtensions.x-group-parameters}} -pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>> { +pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#isResponseFile}}{{#supportAsync}}reqwest::Response{{/supportAsync}}{{^supportAsync}}reqwest::blocking::Response{{/supportAsync}}{{/isResponseFile}}{{^isResponseFile}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{/isResponseFile}}, Error<{{{operationIdCamelCase}}}Error>> { let local_var_configuration = configuration; {{/vendorExtensions.x-group-parameters}} @@ -346,7 +346,12 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{/isMultipart}} {{#hasBodyParam}} {{#bodyParams}} + {{#isFile}} + local_var_req_builder = local_var_req_builder.body({{{paramName}}}); + {{/isFile}} + {{^isFile}} local_var_req_builder = local_var_req_builder.json(&{{{paramName}}}); + {{/isFile}} {{/bodyParams}} {{/hasBodyParam}} @@ -354,23 +359,35 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: let local_var_resp = local_var_client.execute(local_var_req){{#supportAsync}}.await{{/supportAsync}}?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { {{^supportMultipleResponses}} + {{#isResponseFile}} + Ok(local_var_resp) + {{/isResponseFile}} + {{^isResponseFile}} {{^returnType}} Ok(()) {{/returnType}} {{#returnType}} + let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?; serde_json::from_str(&local_var_content).map_err(Error::from) {{/returnType}} + {{/isResponseFile}} {{/supportMultipleResponses}} {{#supportMultipleResponses}} + {{#isResponseFile}} + Ok(local_var_resp) + {{/isResponseFile}} + {{^isResponseFile}} + let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?; let local_var_entity: Option<{{{operationIdCamelCase}}}Success> = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) + {{/isResponseFile}} {{/supportMultipleResponses}} } else { + let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?; let local_var_entity: Option<{{{operationIdCamelCase}}}Error> = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs index 3886a83c9543..bea5f638a6e7 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs @@ -39,11 +39,12 @@ pub fn repro(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs b/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs index 27a37acccf49..179f9ea5c141 100644 --- a/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs @@ -39,11 +39,11 @@ pub async fn demo_color_get(configuration: &configuration::Configuration, color: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs index 59d4035053a9..c0def694ddee 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs @@ -47,11 +47,11 @@ pub fn create_state(configuration: &configuration::Configuration, create_state_r let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -74,11 +74,12 @@ pub fn get_state(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs index 5f5b46edc2c8..54b21d9c0766 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs @@ -39,11 +39,12 @@ pub fn endpoint_get(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs index c487220374ea..9fc93a60045b 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs @@ -46,11 +46,12 @@ pub fn root_get(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -74,11 +75,11 @@ pub fn test(configuration: &configuration::Configuration, body: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs index 035872574bf6..3287c9177b3e 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs @@ -39,11 +39,12 @@ pub fn get_fruit(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs index f8ce13d5cac6..fc6b75d5ebcd 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs @@ -40,11 +40,12 @@ pub fn create_bar(configuration: &configuration::Configuration, bar_create: mode let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs index 202e6bb66793..cdcd1feaf2a5 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs @@ -47,11 +47,12 @@ pub fn create_foo(configuration: &configuration::Configuration, foo: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -74,11 +75,12 @@ pub fn get_all_foos(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs index e7f8c27a8f05..1dd40a13d980 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs @@ -44,11 +44,11 @@ pub fn get_parameter_name_mapping(configuration: &configuration::Configuration, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs index 3f10b5b6c2af..f93b447840da 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs @@ -74,13 +74,14 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs index 0a44b19a32dd..471556f03bd7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs @@ -234,13 +234,14 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -275,13 +276,14 @@ pub async fn delete_pet(configuration: &configuration::Configuration, params: De let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -316,13 +318,14 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -357,13 +360,14 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -399,13 +403,14 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -437,13 +442,14 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -484,13 +490,14 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration, let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -529,13 +536,14 @@ pub async fn upload_file(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs index 67fd03a80f54..340e6f2dc97c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs @@ -122,13 +122,14 @@ pub async fn delete_order(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -163,13 +164,14 @@ pub async fn get_inventory(configuration: &configuration::Configuration) -> Resu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -197,13 +199,14 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -232,13 +235,14 @@ pub async fn place_order(configuration: &configuration::Configuration, params: P let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs index 83d1a00fb4ce..0dafccec4b72 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs @@ -46,7 +46,7 @@ pub enum TestsTypeTestingGetError { } -pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result, Error> { +pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let local_var_configuration = configuration; // unbox the parameters @@ -65,13 +65,11 @@ pub async fn tests_file_response_get(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Ok(local_var_result) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -97,13 +95,14 @@ pub async fn tests_type_testing_get(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs index 4f28c21c1cf3..985f3b65e317 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs @@ -224,13 +224,14 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -267,13 +268,14 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -310,13 +312,14 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -352,13 +355,14 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -386,13 +390,14 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -423,13 +428,14 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -464,13 +470,14 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -508,13 +515,14 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs index 3f10b5b6c2af..f93b447840da 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs @@ -74,13 +74,14 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/pet_api.rs index 7901fb0c40d9..55fffa82b61a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/pet_api.rs @@ -236,13 +236,14 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -279,13 +280,14 @@ pub async fn delete_pet(configuration: &configuration::Configuration, params: De let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -322,13 +324,14 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -365,13 +368,14 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -404,13 +408,14 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -444,13 +449,14 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -493,13 +499,14 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration, let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -540,13 +547,14 @@ pub async fn upload_file(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/store_api.rs index 2531e6306757..ef3f71dbb9cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/store_api.rs @@ -122,13 +122,14 @@ pub async fn delete_order(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -160,13 +161,14 @@ pub async fn get_inventory(configuration: &configuration::Configuration) -> Resu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -194,13 +196,14 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -229,13 +232,14 @@ pub async fn place_order(configuration: &configuration::Configuration, params: P let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs index 83d1a00fb4ce..0dafccec4b72 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs @@ -46,7 +46,7 @@ pub enum TestsTypeTestingGetError { } -pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result, Error> { +pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let local_var_configuration = configuration; // unbox the parameters @@ -65,13 +65,11 @@ pub async fn tests_file_response_get(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Ok(local_var_result) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -97,13 +95,14 @@ pub async fn tests_type_testing_get(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/user_api.rs index 0c62352279db..b5b830ac64a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/user_api.rs @@ -221,13 +221,14 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -261,13 +262,14 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -301,13 +303,14 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -340,13 +343,14 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -374,13 +378,14 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -411,13 +416,14 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -449,13 +455,14 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -490,13 +497,14 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs index 3f10b5b6c2af..f93b447840da 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs @@ -74,13 +74,14 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index 0a44b19a32dd..471556f03bd7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -234,13 +234,14 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -275,13 +276,14 @@ pub async fn delete_pet(configuration: &configuration::Configuration, params: De let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -316,13 +318,14 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -357,13 +360,14 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -399,13 +403,14 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -437,13 +442,14 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -484,13 +490,14 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration, let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -529,13 +536,14 @@ pub async fn upload_file(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index 67fd03a80f54..340e6f2dc97c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -122,13 +122,14 @@ pub async fn delete_order(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -163,13 +164,14 @@ pub async fn get_inventory(configuration: &configuration::Configuration) -> Resu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -197,13 +199,14 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -232,13 +235,14 @@ pub async fn place_order(configuration: &configuration::Configuration, params: P let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs index 83d1a00fb4ce..0dafccec4b72 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs @@ -46,7 +46,7 @@ pub enum TestsTypeTestingGetError { } -pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result, Error> { +pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let local_var_configuration = configuration; // unbox the parameters @@ -65,13 +65,11 @@ pub async fn tests_file_response_get(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Ok(local_var_result) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -97,13 +95,14 @@ pub async fn tests_type_testing_get(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index 4f28c21c1cf3..985f3b65e317 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -224,13 +224,14 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -267,13 +268,14 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -310,13 +312,14 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -352,13 +355,14 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -386,13 +390,14 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -423,13 +428,14 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -464,13 +470,14 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -508,13 +515,14 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs index 3f10b5b6c2af..f93b447840da 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs @@ -74,13 +74,14 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs index 0a44b19a32dd..471556f03bd7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs @@ -234,13 +234,14 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -275,13 +276,14 @@ pub async fn delete_pet(configuration: &configuration::Configuration, params: De let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -316,13 +318,14 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -357,13 +360,14 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -399,13 +403,14 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -437,13 +442,14 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -484,13 +490,14 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration, let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -529,13 +536,14 @@ pub async fn upload_file(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs index 67fd03a80f54..340e6f2dc97c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs @@ -122,13 +122,14 @@ pub async fn delete_order(configuration: &configuration::Configuration, params: let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -163,13 +164,14 @@ pub async fn get_inventory(configuration: &configuration::Configuration) -> Resu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -197,13 +199,14 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -232,13 +235,14 @@ pub async fn place_order(configuration: &configuration::Configuration, params: P let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs index 83d1a00fb4ce..0dafccec4b72 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs @@ -46,7 +46,7 @@ pub enum TestsTypeTestingGetError { } -pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result, Error> { +pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let local_var_configuration = configuration; // unbox the parameters @@ -65,13 +65,11 @@ pub async fn tests_file_response_get(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Ok(local_var_result) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -97,13 +95,14 @@ pub async fn tests_type_testing_get(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs index 4f28c21c1cf3..985f3b65e317 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs @@ -224,13 +224,14 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -267,13 +268,14 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -310,13 +312,14 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -352,13 +355,14 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -386,13 +390,14 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -423,13 +428,14 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -464,13 +470,14 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -508,13 +515,14 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Ok(local_var_result) } else { + let local_var_content = local_var_resp.text().await?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs index d14a0f233be3..24339cb769aa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs @@ -49,11 +49,11 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs index c48cfb3b2f90..3bd8113f7bde 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs @@ -116,11 +116,12 @@ pub fn add_pet(configuration: &configuration::Configuration, pet: models::Pet) - let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -163,11 +164,11 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -211,11 +212,12 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -259,11 +261,12 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -308,11 +311,12 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -353,11 +357,12 @@ pub fn update_pet(configuration: &configuration::Configuration, pet: models::Pet let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -405,11 +410,11 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -457,11 +462,12 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs index fd42617f4c7d..d1ad7c4a4fc6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs @@ -66,11 +66,11 @@ pub fn delete_order(configuration: &configuration::Configuration, order_id: &str let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -115,11 +115,12 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -143,11 +144,12 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -172,11 +174,12 @@ pub fn place_order(configuration: &configuration::Configuration, order: models:: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs index c53219078f0e..634576260d6a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs @@ -30,7 +30,7 @@ pub enum TestsTypeTestingGetError { } -pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { +pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -46,11 +46,11 @@ pub fn tests_file_response_get(configuration: &configuration::Configuration, ) - let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -73,11 +73,12 @@ pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs index 0eedaddc2e48..3c186de94f98 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs @@ -122,11 +122,11 @@ pub fn create_user(configuration: &configuration::Configuration, user: models::U let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -172,11 +172,11 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -222,11 +222,11 @@ pub fn create_users_with_list_input(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -271,11 +271,11 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -299,11 +299,12 @@ pub fn get_user_by_name(configuration: &configuration::Configuration, username: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -329,11 +330,12 @@ pub fn login_user(configuration: &configuration::Configuration, username: &str, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -378,11 +380,11 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -428,11 +430,11 @@ pub fn update_user(configuration: &configuration::Configuration, username: &str, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs index d14a0f233be3..24339cb769aa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs @@ -49,11 +49,11 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/pet_api.rs index d7274d9986b6..b16d781edcf8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/pet_api.rs @@ -103,11 +103,12 @@ pub fn add_pet(configuration: &configuration::Configuration, foo_pet: models::Fo let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -137,11 +138,11 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -172,11 +173,12 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -207,11 +209,12 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -243,11 +246,12 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -275,11 +279,12 @@ pub fn update_pet(configuration: &configuration::Configuration, foo_pet: models: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -314,11 +319,11 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -353,11 +358,12 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/store_api.rs index 2dc92a8a41b6..6bce786967c4 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/store_api.rs @@ -66,11 +66,11 @@ pub fn delete_order(configuration: &configuration::Configuration, order_id: &str let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -102,11 +102,12 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -130,11 +131,12 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -159,11 +161,12 @@ pub fn place_order(configuration: &configuration::Configuration, foo_order: mode let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs index 8f42fae4014e..1b22593cdab6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs @@ -30,7 +30,7 @@ pub enum TestsTypeTestingGetError { } -pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { +pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -46,11 +46,11 @@ pub fn tests_file_response_get(configuration: &configuration::Configuration, ) - let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -73,11 +73,12 @@ pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/user_api.rs index 45f728426b7b..dbb0bf2ff5ff 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/user_api.rs @@ -109,11 +109,11 @@ pub fn create_user(configuration: &configuration::Configuration, foo_user: model let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -146,11 +146,11 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -183,11 +183,11 @@ pub fn create_users_with_list_input(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -219,11 +219,11 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -247,11 +247,12 @@ pub fn get_user_by_name(configuration: &configuration::Configuration, username: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -277,11 +278,12 @@ pub fn login_user(configuration: &configuration::Configuration, username: &str, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -313,11 +315,11 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -350,11 +352,11 @@ pub fn update_user(configuration: &configuration::Configuration, username: &str, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs index d14a0f233be3..24339cb769aa 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs @@ -49,11 +49,11 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index ebff8f8dde98..a08c09aaa3cc 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -103,11 +103,12 @@ pub fn add_pet(configuration: &configuration::Configuration, pet: models::Pet) - let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -137,11 +138,11 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -172,11 +173,12 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -207,11 +209,12 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -243,11 +246,12 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -275,11 +279,12 @@ pub fn update_pet(configuration: &configuration::Configuration, pet: models::Pet let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -314,11 +319,11 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -353,11 +358,12 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index 98c889e0e55f..e62feebbf8d9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -66,11 +66,11 @@ pub fn delete_order(configuration: &configuration::Configuration, order_id: &str let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -102,11 +102,12 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -130,11 +131,12 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -159,11 +161,12 @@ pub fn place_order(configuration: &configuration::Configuration, order: models:: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs index c53219078f0e..634576260d6a 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs @@ -30,7 +30,7 @@ pub enum TestsTypeTestingGetError { } -pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { +pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -46,11 +46,11 @@ pub fn tests_file_response_get(configuration: &configuration::Configuration, ) - let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) + Ok(local_var_resp) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -73,11 +73,12 @@ pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index 2f328ace6051..40505efb17f2 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -109,11 +109,11 @@ pub fn create_user(configuration: &configuration::Configuration, user: models::U let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -146,11 +146,11 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -183,11 +183,11 @@ pub fn create_users_with_list_input(configuration: &configuration::Configuration let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -219,11 +219,11 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -247,11 +247,12 @@ pub fn get_user_by_name(configuration: &configuration::Configuration, username: let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -277,11 +278,12 @@ pub fn login_user(configuration: &configuration::Configuration, username: &str, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + let local_var_content = local_var_resp.text()?; serde_json::from_str(&local_var_content).map_err(Error::from) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -313,11 +315,11 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) @@ -350,11 +352,11 @@ pub fn update_user(configuration: &configuration::Configuration, username: &str, let local_var_resp = local_var_client.execute(local_var_req)?; let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text()?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { + let local_var_content = local_var_resp.text()?; let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) From 711e53a90cd500a6068867e8294e91c394887143 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 29 Nov 2024 17:12:12 +0800 Subject: [PATCH 10/40] [Java] Add option to fallback to legacy enum naming (#20172) * add option to fallback legacy enum naming (java) * fix tests --- bin/configs/java-okhttp-gson-3.1.yaml | 1 + bin/configs/java-okhttp-gson-streaming.yaml | 1 + docs/generators/groovy.md | 1 + docs/generators/java-camel.md | 1 + docs/generators/java-helidon-client.md | 1 + docs/generators/java-helidon-server.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-micronaut-server.md | 1 + docs/generators/java-microprofile.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java-wiremock.md | 1 + docs/generators/java.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/spring.md | 1 + .../languages/AbstractJavaCodegen.java | 46 +++++++++++++++++-- .../java/spring/SpringCodegenTest.java | 4 -- .../okhttp-gson-streaming/docs/SomeObj.md | 2 +- .../openapitools/client/model/SomeObj.java | 4 +- 31 files changed, 71 insertions(+), 12 deletions(-) diff --git a/bin/configs/java-okhttp-gson-3.1.yaml b/bin/configs/java-okhttp-gson-3.1.yaml index b7d67ab0a5da..845d7510c677 100644 --- a/bin/configs/java-okhttp-gson-3.1.yaml +++ b/bin/configs/java-okhttp-gson-3.1.yaml @@ -15,5 +15,6 @@ additionalProperties: hideGenerationTimestamp: "true" useOneOfDiscriminatorLookup: "true" disallowAdditionalPropertiesIfNotPresent: false + enumPropertyNaming: legacy openapiNormalizer: FIX_DUPLICATED_OPERATIONID: true diff --git a/bin/configs/java-okhttp-gson-streaming.yaml b/bin/configs/java-okhttp-gson-streaming.yaml index 9e75c93bac4c..a5ab03be70dd 100644 --- a/bin/configs/java-okhttp-gson-streaming.yaml +++ b/bin/configs/java-okhttp-gson-streaming.yaml @@ -8,3 +8,4 @@ additionalProperties: hideGenerationTimestamp: "true" supportStreaming: true serializableModel: true + enumPropertyNaming: legacy diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 5407b0b894ef..d1eab74f3fa3 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index e77c38151eb3..2ffb19c88591 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -54,6 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springfox**
Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index c9c1e4064469..b5e7384f4ec6 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| || |generateBuilders|Whether to generate builders for models| |false| diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index 5ca963a6686e..13af83f52137 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -35,6 +35,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| || |generateBuilders|Whether to generate builders for models| |false| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 8b8b35ea29dc..6c8c79dfcc3b 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 6ca685331a19..72d32e61225b 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 2a181970fe11..71261b9aa644 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -44,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md index b9778bbfe802..335e71f9678a 100644 --- a/docs/generators/java-microprofile.md +++ b/docs/generators/java-microprofile.md @@ -47,6 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
|source| |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null| |failOnUnknownProperties|Fail Jackson de-serialization on unknown properties| |false| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index d321b030be83..e87372b5fa5a 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 4a96c9d89d9b..6fa61fa2c9d2 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |eurekaUri|Eureka URI| |null| |generateBuilders|Whether to generate builders for models| |false| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 1e4efaaeae5b..20d617d45ee3 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -43,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index ca484ad146ed..2e02829c2ed5 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 8c98816db81c..b39dfcaf03f8 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 9720c15d8bdb..9f9024732f28 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java-wiremock.md b/docs/generators/java-wiremock.md index 09fb082309e2..b8a0af01f014 100644 --- a/docs/generators/java-wiremock.md +++ b/docs/generators/java-wiremock.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index bb371ceeca74..96cb5b888bfe 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -47,6 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
|source| |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null| |failOnUnknownProperties|Fail Jackson de-serialization on unknown properties| |false| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index d911fd30b0f3..8029aa638bb0 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 04ae1cfee4e1..395719497aab 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 8c34c65d1460..4228d9a6bae0 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 12deda54824d..633cd7578058 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 0965570fdde4..34d402be27d7 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 6973aecf1dba..7e75d1b939a9 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index f48428ba1c92..4dfd3e6295a8 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 6f9fb5a40620..ccd66e36bb0a 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index b71cefb3c126..745517a34ae8 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -47,6 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springfox**
Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE' and 'legacy'| |MACRO_CASE| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index e34cbee7799e..7f10686ae7e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -140,6 +140,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected String sourceFolder = projectFolder + "/java"; @Getter @Setter protected String testFolder = projectTestFolder + "/java"; + + protected static enum ENUM_PROPERTY_NAMING_TYPE {MACRO_CASE, legacy}; + protected static final String ENUM_PROPERTY_NAMING_DESC = "Naming convention for enum properties: 'MACRO_CASE' and 'legacy'"; + @Getter protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.MACRO_CASE; + /** * -- SETTER -- * Set whether discriminator value lookup is case-sensitive or not. @@ -356,6 +361,9 @@ public AbstractJavaCodegen() { annotationLibraryCliOption.addEnum(al.toCliOptValue(), al.getDescription())); cliOptions.add(annotationLibraryCliOption); } + + CliOption enumPropertyNamingOpt = new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_DESC); + cliOptions.add(enumPropertyNamingOpt.defaultValue(enumPropertyNaming.name())); } @Override @@ -540,11 +548,11 @@ public void processOpts() { convertPropertyToStringAndWriteBack(CodegenConstants.LIBRARY, this::setLibrary); convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, this::setSerializeBigDecimalAsString ); // need to put back serializableModel (boolean) into additionalProperties as value in additionalProperties is string -// additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); + // additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); - // By default, the discriminator lookup should be case sensitive. There is nothing in the OpenAPI specification - // that indicates the lookup should be case insensitive. However, some implementations perform - // a case-insensitive lookup. + // By default, the discriminator lookup should be case sensitive. There is nothing in the OpenAPI specification + // that indicates the lookup should be case insensitive. However, some implementations perform + // a case-insensitive lookup. convertPropertyToBooleanAndWriteBack(DISCRIMINATOR_CASE_SENSITIVE, this::setDiscriminatorCaseSensitive); convertPropertyToBooleanAndWriteBack(WITH_XML, this::setWithXml); convertPropertyToBooleanAndWriteBack(OPENAPI_NULLABLE, this::setOpenApiNullable); @@ -555,6 +563,7 @@ public void processOpts() { convertPropertyToStringAndWriteBack(IMPLICIT_HEADERS_REGEX, this::setImplicitHeadersRegex); convertPropertyToBooleanAndWriteBack(CAMEL_CASE_DOLLAR_SIGN, this::setCamelCaseDollarSign); convertPropertyToBooleanAndWriteBack(USE_ONE_OF_INTERFACES, this::setUseOneOfInterfaces); + convertPropertyToStringAndWriteBack(CodegenConstants.ENUM_PROPERTY_NAMING, this::setEnumPropertyNaming); if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) { additionalProperties.put("parentOverridden", true); @@ -2009,7 +2018,17 @@ public String toEnumVarName(String value, String datatype) { } // string - String var = underscore(value.replaceAll("\\W+", "_")).toUpperCase(Locale.ROOT); + String var; + switch (getEnumPropertyNaming()) { + case legacy: + // legacy ,e.g. WITHNUMBER1 + var = value.replaceAll("\\W+", "_").toUpperCase(Locale.ROOT); + break; + default: + // default to MACRO_CASE, e.g. WITH_NUMBER1 + var = underscore(value.replaceAll("\\W+", "_")).toUpperCase(Locale.ROOT); + break; + } if (var.matches("\\d.*")) { var = "_" + var; } @@ -2367,4 +2386,21 @@ public static void addImports(List> imports, CodegenModel cm public boolean isTypeErasedGenerics() { return true; } + + /** + * Sets the naming convention for Java enum properties + * + * @param enumPropertyNamingType The string representation of the naming convention, as defined by {@link ENUM_PROPERTY_NAMING_TYPE} + */ + public void setEnumPropertyNaming(final String enumPropertyNamingType) { + try { + this.enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.valueOf(enumPropertyNamingType); + } catch (IllegalArgumentException ex) { + StringBuilder sb = new StringBuilder(enumPropertyNamingType + " is an invalid enum property naming option. Please choose from:"); + for (ENUM_PROPERTY_NAMING_TYPE t : ENUM_PROPERTY_NAMING_TYPE.values()) { + sb.append("\n ").append(t.name()); + } + throw new RuntimeException(sb.toString()); + } + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 37863f2659f5..f2d7bd627458 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -2398,7 +2398,6 @@ public void requiredFieldShouldIncludeNotNullAnnotation_issue13365() throws IOEx codegen.additionalProperties().put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); - codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, "PascalCase"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml"); @@ -2428,7 +2427,6 @@ public void requiredFieldShouldIncludeNotNullAnnotationJakarta_issue13365_issue1 codegen.additionalProperties().put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); - codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, "PascalCase"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml"); @@ -2457,7 +2455,6 @@ public void nonRequiredFieldShouldNotIncludeNotNullAnnotation_issue13365() throw codegen.additionalProperties().put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); - codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, "PascalCase"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml"); @@ -2499,7 +2496,6 @@ public void requiredFieldShouldIncludeNotNullAnnotationWithBeanValidationTrue_is codegen.additionalProperties().put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "false"); codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); - codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, "PascalCase"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml"); diff --git a/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md b/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md index d27439c839f1..70bf3335f7be 100644 --- a/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md +++ b/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md @@ -19,7 +19,7 @@ | Name | Value | |---- | -----| -| SOME_OBJ_IDENTIFIER | "SomeObjIdentifier" | +| SOMEOBJIDENTIFIER | "SomeObjIdentifier" | ## Implemented Interfaces diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java index 2fce672f6c46..b6f61f7872eb 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java @@ -58,7 +58,7 @@ public class SomeObj implements Serializable { */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - SOME_OBJ_IDENTIFIER("SomeObjIdentifier"); + SOMEOBJIDENTIFIER("SomeObjIdentifier"); private String value; @@ -106,7 +106,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_$_TYPE = "$_type"; @SerializedName(SERIALIZED_NAME_$_TYPE) @javax.annotation.Nullable - private TypeEnum $type = TypeEnum.SOME_OBJ_IDENTIFIER; + private TypeEnum $type = TypeEnum.SOMEOBJIDENTIFIER; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) From 706c0a177e0895090c129dbbe846f4127b7f7c16 Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Sat, 30 Nov 2024 03:12:15 +0100 Subject: [PATCH 11/40] fix: close quotes in cargo manifest (#20209) --- .../openapi-generator/src/main/resources/rust/Cargo.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache index 17fb2735a998..aa4ad5bdd89b 100644 --- a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache @@ -28,7 +28,7 @@ repository = "{{.}}" documentation = "{{.}}" {{/documentationUrl}} {{#homePageUrl}} -homepage = "{{.}} +homepage = "{{.}}" {{/homePageUrl}} [dependencies] From 2aa49227b0b99dc50e81e17f3397e16c68708392 Mon Sep 17 00:00:00 2001 From: jops-wtakase <92840130+jops-wtakase@users.noreply.github.com> Date: Sat, 30 Nov 2024 11:20:06 +0900 Subject: [PATCH 12/40] Bugfix: #1666: Change requestBody argument name to 'body' (#20207) Since Connexion defaults to using 'body' as the argument name for the requestBody, the controller's argument name is adjusted accordingly. --- .../python-flask/controller.mustache | 5 +- ...PythonFlaskConnexionServerCodegenTest.java | 68 +++++++++++++++ .../src/test/resources/bugs/issue_1666.yaml | 83 +++++++++++++++++++ .../controllers/pet_controller.py | 6 +- .../controllers/store_controller.py | 3 +- .../controllers/user_controller.py | 12 ++- 6 files changed, 169 insertions(+), 8 deletions(-) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java create mode 100644 modules/openapi-generator/src/test/resources/bugs/issue_1666.yaml diff --git a/modules/openapi-generator/src/main/resources/python-flask/controller.mustache b/modules/openapi-generator/src/main/resources/python-flask/controller.mustache index ad276a661ad3..74034f5e8695 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/controller.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/controller.mustache @@ -10,7 +10,7 @@ from {{packageName}} import util {{#operation}} -def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): # noqa: E501 +def {{operationId}}({{#allParams}}{{^isBodyParam}}{{paramName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}{{^required}}=None{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): # noqa: E501 """{{summary}}{{^summary}}{{operationId}}{{/summary}} {{notes}} # noqa: E501 @@ -60,6 +60,9 @@ def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{ :rtype: Union[{{returnType}}{{^returnType}}None{{/returnType}}, Tuple[{{returnType}}{{^returnType}}None{{/returnType}}, int], Tuple[{{returnType}}{{^returnType}}None{{/returnType}}, int, Dict[str, str]] """ {{#allParams}} + {{#isBodyParam}} + {{paramName}} = body + {{/isBodyParam}} {{^isContainer}} {{#isDate}} {{paramName}} = util.deserialize_date({{paramName}}) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java new file mode 100644 index 000000000000..764b6bf3b174 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java @@ -0,0 +1,68 @@ +package org.openapitools.codegen.python; + +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.parser.core.models.ParseOptions; +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen; +import org.openapitools.codegen.languages.features.CXFServerFeatures; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import static org.openapitools.codegen.TestUtils.assertFileContains; +import static org.openapitools.codegen.TestUtils.assertFileExists; + +public class PythonFlaskConnexionServerCodegenTest { + + // Helper function, intended to reduce boilerplate + static private String generateFiles(DefaultCodegen codegen, String filePath) throws IOException { + final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + final String outputPath = output.getAbsolutePath().replace('\\', '/'); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + final ClientOptInput input = new ClientOptInput(); + final OpenAPI openAPI = new OpenAPIParser().readLocation(filePath, null, new ParseOptions()).getOpenAPI(); + input.openAPI(openAPI); + input.config(codegen); + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); + + Assert.assertTrue(files.size() > 0); + return outputPath + "/"; + } + + + @Test(description = "test requestBody") + public void testRequestBody() throws IOException { + final DefaultCodegen codegen = new PythonFlaskConnexionServerCodegen(); + final String outputPath = generateFiles(codegen, "src/test/resources/bugs/issue_1666.yaml"); + + final Path p1 = Paths.get(outputPath + "openapi_server/controllers/test1_controller.py"); + assertFileExists(p1); + assertFileContains(p1, "def not_required(body=None):"); + assertFileContains(p1, "test_request = body"); + + final Path p2 = Paths.get(outputPath + "openapi_server/controllers/test2_controller.py"); + assertFileContains(p2, "def required(body):"); + assertFileContains(p2, "test_request = body"); + + final Path p3 = Paths.get(outputPath + "openapi_server/controllers/test3_controller.py"); + assertFileContains(p3, "def with_path_param(param1, body=None):"); + assertFileContains(p3, "test_request = body"); + + final Path p4 = Paths.get(outputPath + "openapi_server/controllers/test4_controller.py"); + assertFileContains(p4, "def with_path_param_required(param1, body):"); + assertFileContains(p4, "test_request = body"); + } +} diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_1666.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_1666.yaml new file mode 100644 index 000000000000..775e57f80d36 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_1666.yaml @@ -0,0 +1,83 @@ +openapi: "3.0.3" +info: + title: issue #1666 + version: 1.0.0 +tags: + - name: test1 + - name: test2 + - name: test3 + - name: test4 +paths: + "/not-required": + post: + operationId: notRequired + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestRequest' + responses: + '200': + description: success + tags: + - test1 + "/required": + post: + operationId: required + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TestRequest' + responses: + '200': + description: success + tags: + - test2 + "/with-path-param/{param1}": + post: + operationId: withPathParam + parameters: + - name: param1 + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestRequest' + responses: + '200': + description: success + tags: + - test3 + "/with-path-param-required/{param1}": + post: + operationId: withPathParamRequired + parameters: + - name: param1 + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TestRequest' + responses: + '200': + description: success + tags: + - test4 +components: + schemas: + TestRequest: + type: object + properties: + key1: + type: string diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py index 6b7d87f1b735..dfc5a0251881 100644 --- a/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py @@ -8,7 +8,7 @@ from openapi_server import util -def add_pet(pet): # noqa: E501 +def add_pet(body): # noqa: E501 """Add a new pet to the store # noqa: E501 @@ -18,6 +18,7 @@ def add_pet(pet): # noqa: E501 :rtype: Union[Pet, Tuple[Pet, int], Tuple[Pet, int, Dict[str, str]] """ + pet = body if connexion.request.is_json: pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' @@ -77,7 +78,7 @@ def get_pet_by_id(pet_id): # noqa: E501 return 'do some magic!' -def update_pet(pet): # noqa: E501 +def update_pet(body): # noqa: E501 """Update an existing pet # noqa: E501 @@ -87,6 +88,7 @@ def update_pet(pet): # noqa: E501 :rtype: Union[Pet, Tuple[Pet, int], Tuple[Pet, int, Dict[str, str]] """ + pet = body if connexion.request.is_json: pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py index 1782980a90a1..27af5fd2513f 100644 --- a/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py @@ -44,7 +44,7 @@ def get_order_by_id(order_id): # noqa: E501 return 'do some magic!' -def place_order(order): # noqa: E501 +def place_order(body): # noqa: E501 """Place an order for a pet # noqa: E501 @@ -54,6 +54,7 @@ def place_order(order): # noqa: E501 :rtype: Union[Order, Tuple[Order, int], Tuple[Order, int, Dict[str, str]] """ + order = body if connexion.request.is_json: order = Order.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py index 7510bacdca6c..6b318c2cd3e6 100644 --- a/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py @@ -7,7 +7,7 @@ from openapi_server import util -def create_user(user): # noqa: E501 +def create_user(body): # noqa: E501 """Create user This can only be done by the logged in user. # noqa: E501 @@ -17,12 +17,13 @@ def create_user(user): # noqa: E501 :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ + user = body if connexion.request.is_json: user = User.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' -def create_users_with_array_input(user): # noqa: E501 +def create_users_with_array_input(body): # noqa: E501 """Creates list of users with given input array # noqa: E501 @@ -32,12 +33,13 @@ def create_users_with_array_input(user): # noqa: E501 :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ + user = body if connexion.request.is_json: user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 return 'do some magic!' -def create_users_with_list_input(user): # noqa: E501 +def create_users_with_list_input(body): # noqa: E501 """Creates list of users with given input array # noqa: E501 @@ -47,6 +49,7 @@ def create_users_with_list_input(user): # noqa: E501 :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ + user = body if connexion.request.is_json: user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 return 'do some magic!' @@ -104,7 +107,7 @@ def logout_user(): # noqa: E501 return 'do some magic!' -def update_user(username, user): # noqa: E501 +def update_user(username, body): # noqa: E501 """Updated user This can only be done by the logged in user. # noqa: E501 @@ -116,6 +119,7 @@ def update_user(username, user): # noqa: E501 :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ + user = body if connexion.request.is_json: user = User.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' From 878148e66dd05f49581317a883b3ddefd0919723 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 30 Nov 2024 13:32:15 +0800 Subject: [PATCH 13/40] update kotlin option description to clarify the support (#20211) --- docs/generators/kotlin.md | 2 +- .../org/openapitools/codegen/languages/KotlinClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 1499bfe2cfcf..dfb58669f89b 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -27,7 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original| |explicitApi|Generates code with explicit access modifiers to comply with Kotlin Explicit API Mode.| |false| |failOnUnknownProperties|Fail Jackson de-serialization on unknown properties| |false| -|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers.| |false| +|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library), `gson`(serializationLibrary) support this option.| |false| |generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 77966c3e9b04..67f41edc715a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -279,7 +279,7 @@ public KotlinClientCodegen() { cliOptions.add(new CliOption(MAP_FILE_BINARY_TO_BYTE_ARRAY, "Map File and Binary to ByteArray (default: false)").defaultValue(Boolean.FALSE.toString())); - cliOptions.add(CliOption.newBoolean(GENERATE_ONEOF_ANYOF_WRAPPERS, "Generate oneOf, anyOf schemas as wrappers.")); + cliOptions.add(CliOption.newBoolean(GENERATE_ONEOF_ANYOF_WRAPPERS, "Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library), `gson`(serializationLibrary) support this option.")); CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC); cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name())); From 3f6c3de029a326a984b01e418f5b362dc06227e3 Mon Sep 17 00:00:00 2001 From: Ingars Ribners Date: Sat, 30 Nov 2024 12:31:56 +0300 Subject: [PATCH 14/40] Updated README.mustache template for the Erlang server generator (#20138) * Updated README.mustache file for the Erlang server generator. Fixed one error and updated the usage instructions Changes made to the Erlang server generator's user instructions ("README.mustache" file): 1. Corrected the argument in section 4.1 of the user instructions. In openapi_server:start/2, the second argument for the generated Erlang code must now be in a different format than proposed in the instructions (see lines 13-16 of the "server.mustache" file). Initially, the server failed to start, and after some debugging, I discovered that the argument format did not match the server's expectations, causing the port number not to be passed to cowboy:start_clear/3. This has now been fixed. 2. Reviewed and updated the text of the user instructions to remove any ambiguities. 3. Tested the user instructions for accuracy and completeness. * erlang-server sample recompiled * README fix * Fixed README.mustache template markdown for erlang-server. Re-generated erlang-server sample. * Update README.mustache * Sample 'erlang-server' re-generated * update samples --------- Co-authored-by: William Cheng --- .../resources/erlang-server/README.mustache | 130 +++++++++++++++--- .../server/echo_api/erlang-server/README.md | 130 +++++++++++++++--- .../server/petstore/erlang-server/README.md | 130 +++++++++++++++--- 3 files changed, 330 insertions(+), 60 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/erlang-server/README.mustache b/modules/openapi-generator/src/main/resources/erlang-server/README.mustache index 887f730062fe..51773e39f10e 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/README.mustache @@ -4,33 +4,123 @@ An Erlang server stub generated by [OpenAPI Generator](https://openapi-generator.tech) given an OpenAPI spec. -Dependencies: Erlang OTP/27 and rebar3. Also: -- [Cowboy](https://hex.pm/packages/cowboy) -- [Ranch](https://hex.pm/packages/ranch) -- [Jesse](https://hex.pm/packages/jesse) - ## Prerequisites +1. [Erlang/OTP (v27)](https://www.erlang.org/) + +2. [rebar3](https://rebar3.org/) + +3. Erlang libraries: + - [Cowboy](https://hex.pm/packages/cowboy) + - [Ranch](https://hex.pm/packages/ranch) + - [Jesse](https://hex.pm/packages/jesse) + +4. OpenAPI generator script `openapi-generator-cli` +(for more information see [OpenAPI Generator - Getting Started](https://github.com/OpenAPITools/openapi-generator#2---getting-started) ) + +5. OpenAPI specification file in the current folder (for example [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml)) + + ## Getting started -Use erlang-server with rebar3 +Use `erlang-server` with `rebar3` + +1. Create a folder with an Erlang application by using `rebar3` + + `$ rebar3 new app http_server` + +2. Generate OpenAPI `erlang-server` project using `openapi-generator` + + `$ openapi-generator-cli generate -g erlang-server -i petstore.yaml -o ./http_server --additional-properties packageName=openapi` + +3. Go into the `http_server` project folder + + `$ cd http_server` + + NOTE: The following generated files are now in the folder "http_server": + + - `src/http_server*.erl`, `http_server.app.src` -- Erlang application modules generated by `rebar3` + + - `src/openapi*.erl`, `openapi.app.src` -- REST API request handling modules generated by `openapi-generator-cli` + + - `priv/openapi.json` -- OpenAPI data in JSON format created by `openapi-generator-cli` - 1, Create an application by using rebar3 - $ rebar3 new app http_server + - `rebar.config` -- Erlang project configuration file generated by `openapi-generator-cli` - 2, Generate erlang-server project using openapi-generator - https://github.com/OpenAPITools/openapi-generator#2---getting-started +4. Add the following line to the `start/2` function in the `src/http_server_app.erl`: - 3, Copy erlang-server file to http_server project, and don't forget the 'priv' folder. +```erlang + openapi_server:start(http_server, + #{transport_opts => [{ip,{127,0,0,1}}, + {port,8080} + ]}) +``` - 4, Start in the http_server project: - 1, Introduce the following line in the http_server_app:start(_Type, _Args) function - openapi_server:start(http_server, #{ip => {127,0,0,1}, port => 8080}) - 2, Compile your http_server project - $ rebar3 compile - 3, Start erlang virtual machine - $ rebar3 shell - 4, Start project - application:ensure_all_started(http_server). +The updated `start/2` in `src/http_server_app.erl` should look like this: + +```erlang +start(_StartType, _StartArgs) -> + openapi_server:start(http_server, + #{transport_opts => [{ip,{127,0,0,1}}, + {port,8080} + ]}), + http_server_sup:start_link(). +``` + +5. Update application configuration file `http_server.app.src` (in the `src` subfolder): + + 1. Copy application name from `http_server.app.src` to `openapi.app.src` + + 2. Copy `{mod,...}` rule from the `http_server.app.src` to `openapi.app.src` + + 3. Copy `openapi.app.src` over `http_server.app.src` + + `$ cp src/openapi.app.src src/http_server.app.src` + + 4. Remove `openapi.app.src` + + `$ rm src/openapi.app.src` + +The updated `src/http_server.app.src` must be the only configuration file in the project and it should look like this: + +``` +{application, http_server, + [ {description, "This is a sample petstore server"}, + {vsn, "1.0.0"}, + {registered, []}, + {mod, {http_server_app, []}}, + {applications, [kernel, stdlib, public_key, ssl, inets, ranch, cowboy]}, + {env, []}, + {modules, []}, + {licenses, ["Apache-2.0"]}, + {links, []} + ]}. +``` + +6. Compile your `http_server` project + + `$ rebar3 compile` + +7. Start Erlang virtual machine + `$ rebar3 shell` + +8. Start the application by running a following command in the `rebar3` shell + + `1> application:ensure_all_started(http_server).` + + Alternatively, you could start your application with the `rebar3` shell by adding the following lines to the `rebar.config`: + ``` + {shell, [ + {apps, [http_server]} + ]}. + ``` + +Note: If you need to repeat code generation using `openapi-generator-cli`, but don't want to rewrite changes in files made manually, you could use file `.openapi-generator-ignore` in the project root folder. For example, such `.openapi-generator-ignore` will preserve manual changes done in the file `rebar.conf` (Point 8) + +``` +# OpenAPI Generator Ignore +rebar.config +``` To implement your own business logic, create a module called `http_server_logic` that implements the behaviour `openapi_logic_handler`. Refer to `openapi_logic_handler` documentation for details. + diff --git a/samples/server/echo_api/erlang-server/README.md b/samples/server/echo_api/erlang-server/README.md index 887f730062fe..51773e39f10e 100644 --- a/samples/server/echo_api/erlang-server/README.md +++ b/samples/server/echo_api/erlang-server/README.md @@ -4,33 +4,123 @@ An Erlang server stub generated by [OpenAPI Generator](https://openapi-generator.tech) given an OpenAPI spec. -Dependencies: Erlang OTP/27 and rebar3. Also: -- [Cowboy](https://hex.pm/packages/cowboy) -- [Ranch](https://hex.pm/packages/ranch) -- [Jesse](https://hex.pm/packages/jesse) - ## Prerequisites +1. [Erlang/OTP (v27)](https://www.erlang.org/) + +2. [rebar3](https://rebar3.org/) + +3. Erlang libraries: + - [Cowboy](https://hex.pm/packages/cowboy) + - [Ranch](https://hex.pm/packages/ranch) + - [Jesse](https://hex.pm/packages/jesse) + +4. OpenAPI generator script `openapi-generator-cli` +(for more information see [OpenAPI Generator - Getting Started](https://github.com/OpenAPITools/openapi-generator#2---getting-started) ) + +5. OpenAPI specification file in the current folder (for example [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml)) + + ## Getting started -Use erlang-server with rebar3 +Use `erlang-server` with `rebar3` + +1. Create a folder with an Erlang application by using `rebar3` + + `$ rebar3 new app http_server` + +2. Generate OpenAPI `erlang-server` project using `openapi-generator` + + `$ openapi-generator-cli generate -g erlang-server -i petstore.yaml -o ./http_server --additional-properties packageName=openapi` + +3. Go into the `http_server` project folder + + `$ cd http_server` + + NOTE: The following generated files are now in the folder "http_server": + + - `src/http_server*.erl`, `http_server.app.src` -- Erlang application modules generated by `rebar3` + + - `src/openapi*.erl`, `openapi.app.src` -- REST API request handling modules generated by `openapi-generator-cli` + + - `priv/openapi.json` -- OpenAPI data in JSON format created by `openapi-generator-cli` - 1, Create an application by using rebar3 - $ rebar3 new app http_server + - `rebar.config` -- Erlang project configuration file generated by `openapi-generator-cli` - 2, Generate erlang-server project using openapi-generator - https://github.com/OpenAPITools/openapi-generator#2---getting-started +4. Add the following line to the `start/2` function in the `src/http_server_app.erl`: - 3, Copy erlang-server file to http_server project, and don't forget the 'priv' folder. +```erlang + openapi_server:start(http_server, + #{transport_opts => [{ip,{127,0,0,1}}, + {port,8080} + ]}) +``` - 4, Start in the http_server project: - 1, Introduce the following line in the http_server_app:start(_Type, _Args) function - openapi_server:start(http_server, #{ip => {127,0,0,1}, port => 8080}) - 2, Compile your http_server project - $ rebar3 compile - 3, Start erlang virtual machine - $ rebar3 shell - 4, Start project - application:ensure_all_started(http_server). +The updated `start/2` in `src/http_server_app.erl` should look like this: + +```erlang +start(_StartType, _StartArgs) -> + openapi_server:start(http_server, + #{transport_opts => [{ip,{127,0,0,1}}, + {port,8080} + ]}), + http_server_sup:start_link(). +``` + +5. Update application configuration file `http_server.app.src` (in the `src` subfolder): + + 1. Copy application name from `http_server.app.src` to `openapi.app.src` + + 2. Copy `{mod,...}` rule from the `http_server.app.src` to `openapi.app.src` + + 3. Copy `openapi.app.src` over `http_server.app.src` + + `$ cp src/openapi.app.src src/http_server.app.src` + + 4. Remove `openapi.app.src` + + `$ rm src/openapi.app.src` + +The updated `src/http_server.app.src` must be the only configuration file in the project and it should look like this: + +``` +{application, http_server, + [ {description, "This is a sample petstore server"}, + {vsn, "1.0.0"}, + {registered, []}, + {mod, {http_server_app, []}}, + {applications, [kernel, stdlib, public_key, ssl, inets, ranch, cowboy]}, + {env, []}, + {modules, []}, + {licenses, ["Apache-2.0"]}, + {links, []} + ]}. +``` + +6. Compile your `http_server` project + + `$ rebar3 compile` + +7. Start Erlang virtual machine + `$ rebar3 shell` + +8. Start the application by running a following command in the `rebar3` shell + + `1> application:ensure_all_started(http_server).` + + Alternatively, you could start your application with the `rebar3` shell by adding the following lines to the `rebar.config`: + ``` + {shell, [ + {apps, [http_server]} + ]}. + ``` + +Note: If you need to repeat code generation using `openapi-generator-cli`, but don't want to rewrite changes in files made manually, you could use file `.openapi-generator-ignore` in the project root folder. For example, such `.openapi-generator-ignore` will preserve manual changes done in the file `rebar.conf` (Point 8) + +``` +# OpenAPI Generator Ignore +rebar.config +``` To implement your own business logic, create a module called `http_server_logic` that implements the behaviour `openapi_logic_handler`. Refer to `openapi_logic_handler` documentation for details. + diff --git a/samples/server/petstore/erlang-server/README.md b/samples/server/petstore/erlang-server/README.md index 887f730062fe..51773e39f10e 100644 --- a/samples/server/petstore/erlang-server/README.md +++ b/samples/server/petstore/erlang-server/README.md @@ -4,33 +4,123 @@ An Erlang server stub generated by [OpenAPI Generator](https://openapi-generator.tech) given an OpenAPI spec. -Dependencies: Erlang OTP/27 and rebar3. Also: -- [Cowboy](https://hex.pm/packages/cowboy) -- [Ranch](https://hex.pm/packages/ranch) -- [Jesse](https://hex.pm/packages/jesse) - ## Prerequisites +1. [Erlang/OTP (v27)](https://www.erlang.org/) + +2. [rebar3](https://rebar3.org/) + +3. Erlang libraries: + - [Cowboy](https://hex.pm/packages/cowboy) + - [Ranch](https://hex.pm/packages/ranch) + - [Jesse](https://hex.pm/packages/jesse) + +4. OpenAPI generator script `openapi-generator-cli` +(for more information see [OpenAPI Generator - Getting Started](https://github.com/OpenAPITools/openapi-generator#2---getting-started) ) + +5. OpenAPI specification file in the current folder (for example [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml)) + + ## Getting started -Use erlang-server with rebar3 +Use `erlang-server` with `rebar3` + +1. Create a folder with an Erlang application by using `rebar3` + + `$ rebar3 new app http_server` + +2. Generate OpenAPI `erlang-server` project using `openapi-generator` + + `$ openapi-generator-cli generate -g erlang-server -i petstore.yaml -o ./http_server --additional-properties packageName=openapi` + +3. Go into the `http_server` project folder + + `$ cd http_server` + + NOTE: The following generated files are now in the folder "http_server": + + - `src/http_server*.erl`, `http_server.app.src` -- Erlang application modules generated by `rebar3` + + - `src/openapi*.erl`, `openapi.app.src` -- REST API request handling modules generated by `openapi-generator-cli` + + - `priv/openapi.json` -- OpenAPI data in JSON format created by `openapi-generator-cli` - 1, Create an application by using rebar3 - $ rebar3 new app http_server + - `rebar.config` -- Erlang project configuration file generated by `openapi-generator-cli` - 2, Generate erlang-server project using openapi-generator - https://github.com/OpenAPITools/openapi-generator#2---getting-started +4. Add the following line to the `start/2` function in the `src/http_server_app.erl`: - 3, Copy erlang-server file to http_server project, and don't forget the 'priv' folder. +```erlang + openapi_server:start(http_server, + #{transport_opts => [{ip,{127,0,0,1}}, + {port,8080} + ]}) +``` - 4, Start in the http_server project: - 1, Introduce the following line in the http_server_app:start(_Type, _Args) function - openapi_server:start(http_server, #{ip => {127,0,0,1}, port => 8080}) - 2, Compile your http_server project - $ rebar3 compile - 3, Start erlang virtual machine - $ rebar3 shell - 4, Start project - application:ensure_all_started(http_server). +The updated `start/2` in `src/http_server_app.erl` should look like this: + +```erlang +start(_StartType, _StartArgs) -> + openapi_server:start(http_server, + #{transport_opts => [{ip,{127,0,0,1}}, + {port,8080} + ]}), + http_server_sup:start_link(). +``` + +5. Update application configuration file `http_server.app.src` (in the `src` subfolder): + + 1. Copy application name from `http_server.app.src` to `openapi.app.src` + + 2. Copy `{mod,...}` rule from the `http_server.app.src` to `openapi.app.src` + + 3. Copy `openapi.app.src` over `http_server.app.src` + + `$ cp src/openapi.app.src src/http_server.app.src` + + 4. Remove `openapi.app.src` + + `$ rm src/openapi.app.src` + +The updated `src/http_server.app.src` must be the only configuration file in the project and it should look like this: + +``` +{application, http_server, + [ {description, "This is a sample petstore server"}, + {vsn, "1.0.0"}, + {registered, []}, + {mod, {http_server_app, []}}, + {applications, [kernel, stdlib, public_key, ssl, inets, ranch, cowboy]}, + {env, []}, + {modules, []}, + {licenses, ["Apache-2.0"]}, + {links, []} + ]}. +``` + +6. Compile your `http_server` project + + `$ rebar3 compile` + +7. Start Erlang virtual machine + `$ rebar3 shell` + +8. Start the application by running a following command in the `rebar3` shell + + `1> application:ensure_all_started(http_server).` + + Alternatively, you could start your application with the `rebar3` shell by adding the following lines to the `rebar.config`: + ``` + {shell, [ + {apps, [http_server]} + ]}. + ``` + +Note: If you need to repeat code generation using `openapi-generator-cli`, but don't want to rewrite changes in files made manually, you could use file `.openapi-generator-ignore` in the project root folder. For example, such `.openapi-generator-ignore` will preserve manual changes done in the file `rebar.conf` (Point 8) + +``` +# OpenAPI Generator Ignore +rebar.config +``` To implement your own business logic, create a module called `http_server_logic` that implements the behaviour `openapi_logic_handler`. Refer to `openapi_logic_handler` documentation for details. + From 88be078c6867033a079218531a39942dcd1fd9de Mon Sep 17 00:00:00 2001 From: daniel <6771667+danielalmqvist@users.noreply.github.com> Date: Sat, 30 Nov 2024 16:15:10 +0100 Subject: [PATCH 15/40] Trim the input of operationId filter in OpenAPINormalizer (#20186) (#20189) --- .../codegen/OpenAPINormalizer.java | 5 ++++- .../codegen/OpenAPINormalizerTest.java | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index 788e74c42ec1..44fa54695702 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -232,7 +232,10 @@ public void processRules(Map inputRules) { LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3`: {}", inputRules.get(FILTER)); } else { if ("operationId".equals(filterStrs[0])) { - operationIdFilters = new HashSet<>(Arrays.asList(filterStrs[1].split("[|]"))); + operationIdFilters = Arrays.stream(filterStrs[1].split("[|]")) + .filter(Objects::nonNull) + .map(String::trim) + .collect(Collectors.toCollection(HashSet::new)); } else { LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3`: {}", inputRules.get(FILTER)); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java index c7713234d74a..21f36c1ee6a9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java @@ -486,6 +486,24 @@ public void testFilter() { assertEquals(openAPI.getPaths().get("/person/display/{personId}").getPut().getExtensions().get("x-internal"), true); } + @Test + public void testFilterWithTrim() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml"); + + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getExtensions(), null); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getExtensions().get("x-internal"), true); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getPut().getExtensions(), null); + + Map options = new HashMap<>(); + options.put("FILTER", "operationId:\n\t\t\t\tdelete|\n\t\tlist"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getExtensions().get("x-internal"), false); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getExtensions().get("x-internal"), false); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getPut().getExtensions().get("x-internal"), true); + } + @Test public void testComposedSchemaDoesNotThrow() { OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_1/composed-schema.yaml"); From 1eaa75bd360e578aa29888e01c3d400be96319f3 Mon Sep 17 00:00:00 2001 From: Joris Dobbelsteen Date: Mon, 2 Dec 2024 09:25:23 +0100 Subject: [PATCH 16/40] Fix python code when receiving JSON data without a property that is a dict to ref/enum causing AttributeError (#20022) --- .../src/main/resources/python/model_generic.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index b18464dad9a8..efd8e3041684 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -356,7 +356,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{/items.isContainer}} {{/items.isEnumOrRef}} {{#items.isEnumOrRef}} - "{{{baseName}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}} + "{{{baseName}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} {{/items.isEnumOrRef}} {{/items.isPrimitiveType}} {{#items.isPrimitiveType}} From 06f0b68eeecf61f0a78e1a1db6f7db67c2872e4b Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Mon, 2 Dec 2024 09:51:49 -0500 Subject: [PATCH 17/40] fix(typescript): remove incorrect file extensions (#20194) * fix(typescript): remove incorrect file extensions url, http, and https are Node.js core modules, and form-data should be loaded using a bare specifier. This commit removes the file extensions from these imports. * update samples --- .../src/main/resources/typescript/http/http.mustache | 10 +++++----- .../others/typescript/encode-decode/build/http/http.ts | 2 +- .../petstore/typescript/builds/default/http/http.ts | 2 +- .../typescript/builds/explode-query/http/http.ts | 2 +- .../petstore/typescript/builds/inversify/http/http.ts | 2 +- .../typescript/builds/object_params/http/http.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache index 631a98ffba45..5b2ac5edec6b 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache @@ -1,10 +1,10 @@ {{#platforms}} {{#node}} // TODO: evaluate if we can easily get rid of this library -import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data{{importFileExtension}}"; -import { URL, URLSearchParams } from 'url{{importFileExtension}}'; -import * as http from 'http{{importFileExtension}}'; -import * as https from 'https{{importFileExtension}}'; +import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data"; +import { URL, URLSearchParams } from 'url'; +import * as http from 'http'; +import * as https from 'https'; {{/node}} {{/platforms}} import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; @@ -169,7 +169,7 @@ export class RequestContext { } {{#platforms}} {{#node}} - + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } diff --git a/samples/client/others/typescript/encode-decode/build/http/http.ts b/samples/client/others/typescript/encode-decode/build/http/http.ts index a86684691d45..115d854c58b5 100644 --- a/samples/client/others/typescript/encode-decode/build/http/http.ts +++ b/samples/client/others/typescript/encode-decode/build/http/http.ts @@ -134,7 +134,7 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } - + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts index a86684691d45..115d854c58b5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts @@ -134,7 +134,7 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } - + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts index a86684691d45..115d854c58b5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts @@ -134,7 +134,7 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } - + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index 11e424d29ac2..15b563c38ea6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -134,7 +134,7 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } - + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index a86684691d45..115d854c58b5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -134,7 +134,7 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } - + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } From b9f6fe6b1f431418b82ce3b9d672d6d2c997b6a6 Mon Sep 17 00:00:00 2001 From: DielN <92168571+DielN@users.noreply.github.com> Date: Tue, 3 Dec 2024 05:02:54 +0100 Subject: [PATCH 18/40] [Java] [Microprofile] Add Json-B polymorphism type info annotations (#20164) * [Microprofile] Add Json-B polymorphism annotations * [Microprofile] Set openApiNullable in configs to false * [Microprofile] Bump JSON Bind version to 3.0 * [Microprofile] Only apply JSON-B polymorphism for MP 3.0 * Update samples * [Microprofile] Update documentation/configs for openApiNullable * Update docs --- ...-microprofile-rest-client-3.0-jackson.yaml | 2 +- .../java-microprofile-rest-client-3.0.yaml | 2 +- .../java-microprofile-rest-client.yaml | 2 +- docs/generators/groovy.md | 2 +- docs/generators/java-camel.md | 2 +- docs/generators/java-helidon-client.md | 2 +- docs/generators/java-helidon-server.md | 2 +- docs/generators/java-inflector.md | 2 +- docs/generators/java-micronaut-client.md | 2 +- docs/generators/java-micronaut-server.md | 2 +- docs/generators/java-microprofile.md | 2 +- docs/generators/java-msf4j.md | 2 +- docs/generators/java-pkmst.md | 2 +- docs/generators/java-play-framework.md | 2 +- docs/generators/java-undertow-server.md | 2 +- docs/generators/java-vertx-web.md | 2 +- docs/generators/java-vertx.md | 2 +- docs/generators/java-wiremock.md | 2 +- docs/generators/java.md | 2 +- docs/generators/jaxrs-cxf-cdi.md | 2 +- docs/generators/jaxrs-cxf-client.md | 2 +- docs/generators/jaxrs-cxf-extended.md | 2 +- docs/generators/jaxrs-cxf.md | 2 +- docs/generators/jaxrs-jersey.md | 2 +- docs/generators/jaxrs-resteasy-eap.md | 2 +- docs/generators/jaxrs-resteasy.md | 2 +- docs/generators/jaxrs-spec.md | 2 +- docs/generators/spring.md | 2 +- .../languages/AbstractJavaCodegen.java | 2 +- .../codegen/languages/JavaClientCodegen.java | 7 + .../libraries/microprofile/model.mustache | 7 +- .../Java/libraries/microprofile/pojo.mustache | 4 +- .../libraries/microprofile/pom_3.0.mustache | 2 +- .../Java/typeInfoAnnotation.mustache | 6 + .../pom.xml | 2 +- .../.openapi-generator/FILES | 96 + .../README.md | 2 +- .../docs/AdditionalPropertiesClass.md | 14 + .../docs/AllOfWithSingleRef.md | 14 + .../docs/Animal.md | 14 + .../docs/AnotherFakeApi.md | 75 + .../docs/ArrayOfArrayOfNumberOnly.md | 13 + .../docs/ArrayOfNumberOnly.md | 13 + .../docs/ArrayTest.md | 15 + .../docs/Capitalization.md | 18 + .../docs/Cat.md | 13 + .../docs/Category.md | 3 +- .../docs/ChildWithNullable.md | 13 + .../docs/ClassModel.md | 14 + .../docs/Client.md | 13 + .../docs/DefaultApi.md | 69 + .../docs/DeprecatedObject.md | 13 + .../docs/Dog.md | 13 + .../docs/EnumArrays.md | 32 + .../docs/EnumClass.md | 15 + .../docs/EnumTest.md | 58 + .../docs/FakeApi.md | 1555 +++++++++++++++++ .../docs/FakeBigDecimalMap200Response.md | 14 + .../docs/FakeClassnameTags123Api.md | 82 + .../docs/FileSchemaTestClass.md | 14 + .../docs/Foo.md | 13 + .../docs/FooGetDefaultResponse.md | 13 + .../docs/FormatTest.md | 28 + .../docs/HasOnlyReadOnly.md | 14 + .../docs/HealthCheckResult.md | 14 + .../docs/MapTest.md | 25 + ...dPropertiesAndAdditionalPropertiesClass.md | 15 + .../docs/Model200Response.md | 15 + .../docs/ModelApiResponse.md | 1 - .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../docs/ModelReturn.md | 14 + .../docs/Name.md | 17 + .../docs/NullableClass.md | 24 + .../docs/NumberOnly.md | 13 + .../docs/ObjectWithDeprecatedFields.md | 16 + .../docs/Order.md | 1 - .../docs/OuterComposite.md | 15 + .../docs/OuterEnum.md | 15 + .../docs/OuterEnumDefaultValue.md | 15 + .../docs/OuterEnumInteger.md | 15 + .../docs/OuterEnumIntegerDefaultValue.md | 15 + .../docs/OuterObjectWithEnumProperty.md | 13 + .../docs/ParentWithNullable.md | 22 + .../docs/Pet.md | 3 +- .../docs/PetApi.md | 126 +- .../docs/ReadOnlyFirst.md | 14 + .../docs/SingleRefType.md | 13 + .../docs/SpecialModelName.md | 13 + .../docs/StoreApi.md | 14 +- .../docs/Tag.md | 1 - ...lineFreeformAdditionalPropertiesRequest.md | 13 + .../docs/User.md | 1 - .../docs/UserApi.md | 74 +- .../pom.xml | 4 +- .../client/RFC3339DateFormat.java | 2 +- .../client/api/AnotherFakeApi.java | 54 + .../openapitools/client/api/ApiException.java | 2 +- .../client/api/ApiExceptionMapper.java | 2 +- .../openapitools/client/api/DefaultApi.java | 47 + .../org/openapitools/client/api/FakeApi.java | 237 +++ .../client/api/FakeClassnameTags123Api.java | 54 + .../org/openapitools/client/api/PetApi.java | 43 +- .../org/openapitools/client/api/StoreApi.java | 12 +- .../org/openapitools/client/api/UserApi.java | 4 +- .../model/AdditionalPropertiesClass.java | 143 ++ .../client/model/AllOfWithSingleRef.java | 126 ++ .../org/openapitools/client/model/Animal.java | 138 ++ .../model/ArrayOfArrayOfNumberOnly.java | 107 ++ .../client/model/ArrayOfNumberOnly.java | 107 ++ .../openapitools/client/model/ArrayTest.java | 183 ++ .../client/model/Capitalization.java | 248 +++ .../org/openapitools/client/model/Cat.java | 105 ++ .../openapitools/client/model/Category.java | 11 +- .../client/model/ChildWithNullable.java | 105 ++ .../openapitools/client/model/ClassModel.java | 98 ++ .../org/openapitools/client/model/Client.java | 95 + .../client/model/DeprecatedObject.java | 95 + .../org/openapitools/client/model/Dog.java | 105 ++ .../openapitools/client/model/EnumArrays.java | 200 +++ .../openapitools/client/model/EnumClass.java | 58 + .../openapitools/client/model/EnumTest.java | 438 +++++ .../model/FakeBigDecimalMap200Response.java | 137 ++ .../client/model/FileSchemaTestClass.java | 137 ++ .../org/openapitools/client/model/Foo.java | 95 + .../client/model/FooGetDefaultResponse.java | 97 + .../openapitools/client/model/FormatTest.java | 566 ++++++ .../client/model/HasOnlyReadOnly.java | 112 ++ .../client/model/HealthCheckResult.java | 98 ++ .../openapitools/client/model/MapTest.java | 251 +++ ...ropertiesAndAdditionalPropertiesClass.java | 168 ++ .../client/model/Model200Response.java | 129 ++ .../client/model/ModelApiResponse.java | 5 +- .../openapitools/client/model/ModelFile.java | 102 ++ .../openapitools/client/model/ModelList.java | 96 + .../client/model/ModelReturn.java | 99 ++ .../org/openapitools/client/model/Name.java | 174 ++ .../client/model/NullableClass.java | 480 +++++ .../openapitools/client/model/NumberOnly.java | 96 + .../model/ObjectWithDeprecatedFields.java | 204 +++ .../org/openapitools/client/model/Order.java | 5 +- .../client/model/OuterComposite.java | 156 ++ .../openapitools/client/model/OuterEnum.java | 58 + .../client/model/OuterEnumDefaultValue.java | 58 + .../client/model/OuterEnumInteger.java | 58 + .../model/OuterEnumIntegerDefaultValue.java | 58 + .../model/OuterObjectWithEnumProperty.java | 96 + .../client/model/ParentWithNullable.java | 169 ++ .../org/openapitools/client/model/Pet.java | 21 +- .../client/model/ReadOnlyFirst.java | 122 ++ .../client/model/SingleRefType.java | 56 + .../client/model/SpecialModelName.java | 96 + .../org/openapitools/client/model/Tag.java | 5 +- ...neFreeformAdditionalPropertiesRequest.java | 98 ++ .../org/openapitools/client/model/User.java | 5 +- .../client/api/AnotherFakeApiTest.java | 65 + .../client/api/DefaultApiTest.java | 60 + .../openapitools/client/api/FakeApiTest.java | 446 +++++ .../api/FakeClassnameTags123ApiTest.java | 65 + .../model/AdditionalPropertiesClassTest.java | 57 + .../client/model/AllOfWithSingleRefTest.java | 56 + .../openapitools/client/model/AnimalTest.java | 58 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 51 + .../client/model/ArrayOfNumberOnlyTest.java | 51 + .../client/model/ArrayTestTest.java | 67 + .../client/model/CapitalizationTest.java | 87 + .../openapitools/client/model/CatTest.java | 67 + .../client/model/CategoryTest.java | 2 +- .../client/model/ChildWithNullableTest.java | 67 + .../client/model/ClassModelTest.java | 47 + .../openapitools/client/model/ClientTest.java | 47 + .../client/model/DeprecatedObjectTest.java | 47 + .../openapitools/client/model/DogTest.java | 67 + .../client/model/EnumArraysTest.java | 58 + .../client/model/EnumClassTest.java | 32 + .../client/model/EnumTestTest.java | 107 ++ .../FakeBigDecimalMap200ResponseTest.java | 58 + .../client/model/FileSchemaTestClassTest.java | 59 + .../model/FooGetDefaultResponseTest.java | 48 + .../openapitools/client/model/FooTest.java | 47 + .../client/model/FormatTestTest.java | 171 ++ .../client/model/HasOnlyReadOnlyTest.java | 55 + .../client/model/HealthCheckResultTest.java | 47 + .../client/model/MapTestTest.java | 73 + ...rtiesAndAdditionalPropertiesClassTest.java | 68 + .../client/model/Model200ResponseTest.java | 55 + .../client/model/ModelApiResponseTest.java | 2 +- .../client/model/ModelFileTest.java | 47 + .../client/model/ModelListTest.java | 47 + .../client/model/ModelReturnTest.java | 47 + .../openapitools/client/model/NameTest.java | 71 + .../client/model/NullableClassTest.java | 142 ++ .../client/model/NumberOnlyTest.java | 48 + .../model/ObjectWithDeprecatedFieldsTest.java | 76 + .../openapitools/client/model/OrderTest.java | 2 +- .../client/model/OuterCompositeTest.java | 64 + .../model/OuterEnumDefaultValueTest.java | 32 + .../OuterEnumIntegerDefaultValueTest.java | 32 + .../client/model/OuterEnumIntegerTest.java | 32 + .../client/model/OuterEnumTest.java | 32 + .../OuterObjectWithEnumPropertyTest.java | 48 + .../client/model/ParentWithNullableTest.java | 58 + .../openapitools/client/model/PetTest.java | 5 +- .../client/model/ReadOnlyFirstTest.java | 55 + .../client/model/SingleRefTypeTest.java | 32 + .../client/model/SpecialModelNameTest.java | 47 + .../openapitools/client/model/TagTest.java | 2 +- ...eeformAdditionalPropertiesRequestTest.java | 49 + .../openapitools/client/model/UserTest.java | 2 +- .../pom.xml | 2 +- .../openapitools/client/model/Category.java | 4 + .../client/model/ModelApiResponse.java | 4 + .../org/openapitools/client/model/Order.java | 4 + .../org/openapitools/client/model/Pet.java | 4 + .../org/openapitools/client/model/Tag.java | 4 + .../org/openapitools/client/model/User.java | 4 + .../.openapi-generator/FILES | 96 + .../microprofile-rest-client-3.0/README.md | 2 +- .../docs/AdditionalPropertiesClass.md | 14 + .../docs/AllOfWithSingleRef.md | 14 + .../docs/Animal.md | 14 + .../docs/AnotherFakeApi.md | 75 + .../docs/ArrayOfArrayOfNumberOnly.md | 13 + .../docs/ArrayOfNumberOnly.md | 13 + .../docs/ArrayTest.md | 15 + .../docs/Capitalization.md | 18 + .../microprofile-rest-client-3.0/docs/Cat.md | 13 + .../docs/Category.md | 3 +- .../docs/ChildWithNullable.md | 13 + .../docs/ClassModel.md | 14 + .../docs/Client.md | 13 + .../docs/DefaultApi.md | 69 + .../docs/DeprecatedObject.md | 13 + .../microprofile-rest-client-3.0/docs/Dog.md | 13 + .../docs/EnumArrays.md | 32 + .../docs/EnumClass.md | 15 + .../docs/EnumTest.md | 58 + .../docs/FakeApi.md | 1555 +++++++++++++++++ .../docs/FakeBigDecimalMap200Response.md | 14 + .../docs/FakeClassnameTags123Api.md | 82 + .../docs/FileSchemaTestClass.md | 14 + .../microprofile-rest-client-3.0/docs/Foo.md | 13 + .../docs/FooGetDefaultResponse.md | 13 + .../docs/FormatTest.md | 28 + .../docs/HasOnlyReadOnly.md | 14 + .../docs/HealthCheckResult.md | 14 + .../docs/MapTest.md | 25 + ...dPropertiesAndAdditionalPropertiesClass.md | 15 + .../docs/Model200Response.md | 15 + .../docs/ModelApiResponse.md | 1 - .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../docs/ModelReturn.md | 14 + .../microprofile-rest-client-3.0/docs/Name.md | 17 + .../docs/NullableClass.md | 24 + .../docs/NumberOnly.md | 13 + .../docs/ObjectWithDeprecatedFields.md | 16 + .../docs/Order.md | 1 - .../docs/OuterComposite.md | 15 + .../docs/OuterEnum.md | 15 + .../docs/OuterEnumDefaultValue.md | 15 + .../docs/OuterEnumInteger.md | 15 + .../docs/OuterEnumIntegerDefaultValue.md | 15 + .../docs/OuterObjectWithEnumProperty.md | 13 + .../docs/ParentWithNullable.md | 22 + .../microprofile-rest-client-3.0/docs/Pet.md | 3 +- .../docs/PetApi.md | 126 +- .../docs/ReadOnlyFirst.md | 14 + .../docs/SingleRefType.md | 13 + .../docs/SpecialModelName.md | 13 + .../docs/StoreApi.md | 14 +- .../microprofile-rest-client-3.0/docs/Tag.md | 1 - ...lineFreeformAdditionalPropertiesRequest.md | 13 + .../microprofile-rest-client-3.0/docs/User.md | 1 - .../docs/UserApi.md | 74 +- .../java/microprofile-rest-client-3.0/pom.xml | 4 +- .../client/api/AnotherFakeApi.java | 54 + .../openapitools/client/api/ApiException.java | 2 +- .../client/api/ApiExceptionMapper.java | 2 +- .../openapitools/client/api/DefaultApi.java | 47 + .../org/openapitools/client/api/FakeApi.java | 237 +++ .../client/api/FakeClassnameTags123Api.java | 54 + .../org/openapitools/client/api/PetApi.java | 43 +- .../org/openapitools/client/api/StoreApi.java | 12 +- .../org/openapitools/client/api/UserApi.java | 4 +- .../model/AdditionalPropertiesClass.java | 142 ++ .../client/model/AllOfWithSingleRef.java | 125 ++ .../org/openapitools/client/model/Animal.java | 127 ++ .../model/ArrayOfArrayOfNumberOnly.java | 111 ++ .../client/model/ArrayOfNumberOnly.java | 111 ++ .../openapitools/client/model/ArrayTest.java | 177 ++ .../client/model/Capitalization.java | 227 +++ .../org/openapitools/client/model/Cat.java | 101 ++ .../openapitools/client/model/Category.java | 11 +- .../client/model/ChildWithNullable.java | 101 ++ .../openapitools/client/model/ClassModel.java | 102 ++ .../org/openapitools/client/model/Client.java | 99 ++ .../client/model/DeprecatedObject.java | 99 ++ .../org/openapitools/client/model/Dog.java | 101 ++ .../openapitools/client/model/EnumArrays.java | 219 +++ .../openapitools/client/model/EnumClass.java | 80 + .../openapitools/client/model/EnumTest.java | 446 +++++ .../model/FakeBigDecimalMap200Response.java | 135 ++ .../client/model/FileSchemaTestClass.java | 136 ++ .../org/openapitools/client/model/Foo.java | 99 ++ .../client/model/FooGetDefaultResponse.java | 100 ++ .../openapitools/client/model/FormatTest.java | 494 ++++++ .../client/model/HasOnlyReadOnly.java | 114 ++ .../client/model/HealthCheckResult.java | 102 ++ .../openapitools/client/model/MapTest.java | 250 +++ ...ropertiesAndAdditionalPropertiesClass.java | 162 ++ .../client/model/Model200Response.java | 127 ++ .../client/model/ModelApiResponse.java | 9 +- .../openapitools/client/model/ModelFile.java | 105 ++ .../openapitools/client/model/ModelList.java | 99 ++ .../client/model/ModelReturn.java | 102 ++ .../org/openapitools/client/model/Name.java | 167 ++ .../client/model/NullableClass.java | 430 +++++ .../openapitools/client/model/NumberOnly.java | 100 ++ .../model/ObjectWithDeprecatedFields.java | 193 ++ .../org/openapitools/client/model/Order.java | 9 +- .../client/model/OuterComposite.java | 150 ++ .../openapitools/client/model/OuterEnum.java | 80 + .../client/model/OuterEnumDefaultValue.java | 80 + .../client/model/OuterEnumInteger.java | 80 + .../model/OuterEnumIntegerDefaultValue.java | 80 + .../model/OuterObjectWithEnumProperty.java | 100 ++ .../client/model/ParentWithNullable.java | 168 ++ .../org/openapitools/client/model/Pet.java | 23 +- .../client/model/ReadOnlyFirst.java | 123 ++ .../client/model/SingleRefType.java | 78 + .../client/model/SpecialModelName.java | 99 ++ .../org/openapitools/client/model/Tag.java | 9 +- ...neFreeformAdditionalPropertiesRequest.java | 102 ++ .../org/openapitools/client/model/User.java | 9 +- .../client/api/AnotherFakeApiTest.java | 65 + .../client/api/DefaultApiTest.java | 60 + .../openapitools/client/api/FakeApiTest.java | 446 +++++ .../api/FakeClassnameTags123ApiTest.java | 65 + .../model/AdditionalPropertiesClassTest.java | 52 + .../client/model/AllOfWithSingleRefTest.java | 51 + .../openapitools/client/model/AnimalTest.java | 50 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 46 + .../client/model/ArrayOfNumberOnlyTest.java | 46 + .../client/model/ArrayTestTest.java | 62 + .../client/model/CapitalizationTest.java | 82 + .../openapitools/client/model/CatTest.java | 59 + .../client/model/CategoryTest.java | 2 +- .../client/model/ChildWithNullableTest.java | 59 + .../client/model/ClassModelTest.java | 42 + .../openapitools/client/model/ClientTest.java | 42 + .../client/model/DeprecatedObjectTest.java | 42 + .../openapitools/client/model/DogTest.java | 59 + .../client/model/EnumArraysTest.java | 53 + .../client/model/EnumClassTest.java | 32 + .../client/model/EnumTestTest.java | 102 ++ .../FakeBigDecimalMap200ResponseTest.java | 53 + .../client/model/FileSchemaTestClassTest.java | 54 + .../model/FooGetDefaultResponseTest.java | 43 + .../openapitools/client/model/FooTest.java | 42 + .../client/model/FormatTestTest.java | 166 ++ .../client/model/HasOnlyReadOnlyTest.java | 50 + .../client/model/HealthCheckResultTest.java | 42 + .../client/model/MapTestTest.java | 68 + ...rtiesAndAdditionalPropertiesClassTest.java | 63 + .../client/model/Model200ResponseTest.java | 50 + .../client/model/ModelApiResponseTest.java | 2 +- .../client/model/ModelFileTest.java | 42 + .../client/model/ModelListTest.java | 42 + .../client/model/ModelReturnTest.java | 42 + .../openapitools/client/model/NameTest.java | 66 + .../client/model/NullableClassTest.java | 137 ++ .../client/model/NumberOnlyTest.java | 43 + .../model/ObjectWithDeprecatedFieldsTest.java | 71 + .../openapitools/client/model/OrderTest.java | 2 +- .../client/model/OuterCompositeTest.java | 59 + .../model/OuterEnumDefaultValueTest.java | 32 + .../OuterEnumIntegerDefaultValueTest.java | 32 + .../client/model/OuterEnumIntegerTest.java | 32 + .../client/model/OuterEnumTest.java | 32 + .../OuterObjectWithEnumPropertyTest.java | 43 + .../client/model/ParentWithNullableTest.java | 50 + .../openapitools/client/model/PetTest.java | 4 +- .../client/model/ReadOnlyFirstTest.java | 50 + .../client/model/SingleRefTypeTest.java | 32 + .../client/model/SpecialModelNameTest.java | 42 + .../openapitools/client/model/TagTest.java | 2 +- ...eeformAdditionalPropertiesRequestTest.java | 44 + .../openapitools/client/model/UserTest.java | 2 +- .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../org/openapitools/client/model/Cat.java | 1 + .../org/openapitools/client/model/Dog.java | 1 + .../org/openapitools/client/model/Status.java | 1 + .../pom.xml | 2 +- .../openapitools/client/model/Category.java | 4 + .../client/model/ModelApiResponse.java | 4 + .../org/openapitools/client/model/Order.java | 4 + .../org/openapitools/client/model/Pet.java | 4 + .../org/openapitools/client/model/Tag.java | 4 + .../org/openapitools/client/model/User.java | 4 + .../.openapi-generator/FILES | 96 + .../java/microprofile-rest-client/README.md | 2 +- .../docs/AdditionalPropertiesClass.md | 14 + .../docs/AllOfWithSingleRef.md | 14 + .../microprofile-rest-client/docs/Animal.md | 14 + .../docs/AnotherFakeApi.md | 75 + .../docs/ArrayOfArrayOfNumberOnly.md | 13 + .../docs/ArrayOfNumberOnly.md | 13 + .../docs/ArrayTest.md | 15 + .../docs/Capitalization.md | 18 + .../java/microprofile-rest-client/docs/Cat.md | 13 + .../microprofile-rest-client/docs/Category.md | 3 +- .../docs/ChildWithNullable.md | 13 + .../docs/ClassModel.md | 14 + .../microprofile-rest-client/docs/Client.md | 13 + .../docs/DefaultApi.md | 69 + .../docs/DeprecatedObject.md | 13 + .../java/microprofile-rest-client/docs/Dog.md | 13 + .../docs/EnumArrays.md | 32 + .../docs/EnumClass.md | 15 + .../microprofile-rest-client/docs/EnumTest.md | 58 + .../microprofile-rest-client/docs/FakeApi.md | 1555 +++++++++++++++++ .../docs/FakeBigDecimalMap200Response.md | 14 + .../docs/FakeClassnameTags123Api.md | 82 + .../docs/FileSchemaTestClass.md | 14 + .../java/microprofile-rest-client/docs/Foo.md | 13 + .../docs/FooGetDefaultResponse.md | 13 + .../docs/FormatTest.md | 28 + .../docs/HasOnlyReadOnly.md | 14 + .../docs/HealthCheckResult.md | 14 + .../microprofile-rest-client/docs/MapTest.md | 25 + ...dPropertiesAndAdditionalPropertiesClass.md | 15 + .../docs/Model200Response.md | 15 + .../docs/ModelApiResponse.md | 1 - .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../docs/ModelReturn.md | 14 + .../microprofile-rest-client/docs/Name.md | 17 + .../docs/NullableClass.md | 24 + .../docs/NumberOnly.md | 13 + .../docs/ObjectWithDeprecatedFields.md | 16 + .../microprofile-rest-client/docs/Order.md | 1 - .../docs/OuterComposite.md | 15 + .../docs/OuterEnum.md | 15 + .../docs/OuterEnumDefaultValue.md | 15 + .../docs/OuterEnumInteger.md | 15 + .../docs/OuterEnumIntegerDefaultValue.md | 15 + .../docs/OuterObjectWithEnumProperty.md | 13 + .../docs/ParentWithNullable.md | 22 + .../java/microprofile-rest-client/docs/Pet.md | 3 +- .../microprofile-rest-client/docs/PetApi.md | 126 +- .../docs/ReadOnlyFirst.md | 14 + .../docs/SingleRefType.md | 13 + .../docs/SpecialModelName.md | 13 + .../microprofile-rest-client/docs/StoreApi.md | 14 +- .../java/microprofile-rest-client/docs/Tag.md | 1 - ...lineFreeformAdditionalPropertiesRequest.md | 13 + .../microprofile-rest-client/docs/User.md | 1 - .../microprofile-rest-client/docs/UserApi.md | 74 +- .../java/microprofile-rest-client/pom.xml | 2 +- .../client/api/AnotherFakeApi.java | 54 + .../openapitools/client/api/ApiException.java | 2 +- .../client/api/ApiExceptionMapper.java | 2 +- .../openapitools/client/api/DefaultApi.java | 47 + .../org/openapitools/client/api/FakeApi.java | 237 +++ .../client/api/FakeClassnameTags123Api.java | 54 + .../org/openapitools/client/api/PetApi.java | 43 +- .../org/openapitools/client/api/StoreApi.java | 12 +- .../org/openapitools/client/api/UserApi.java | 4 +- .../model/AdditionalPropertiesClass.java | 139 ++ .../client/model/AllOfWithSingleRef.java | 122 ++ .../org/openapitools/client/model/Animal.java | 121 ++ .../model/ArrayOfArrayOfNumberOnly.java | 108 ++ .../client/model/ArrayOfNumberOnly.java | 108 ++ .../openapitools/client/model/ArrayTest.java | 174 ++ .../client/model/Capitalization.java | 224 +++ .../org/openapitools/client/model/Cat.java | 98 ++ .../openapitools/client/model/Category.java | 8 +- .../client/model/ChildWithNullable.java | 98 ++ .../openapitools/client/model/ClassModel.java | 99 ++ .../org/openapitools/client/model/Client.java | 96 + .../client/model/DeprecatedObject.java | 96 + .../org/openapitools/client/model/Dog.java | 98 ++ .../openapitools/client/model/EnumArrays.java | 216 +++ .../openapitools/client/model/EnumClass.java | 77 + .../openapitools/client/model/EnumTest.java | 443 +++++ .../model/FakeBigDecimalMap200Response.java | 132 ++ .../client/model/FileSchemaTestClass.java | 133 ++ .../org/openapitools/client/model/Foo.java | 96 + .../client/model/FooGetDefaultResponse.java | 97 + .../openapitools/client/model/FormatTest.java | 491 ++++++ .../client/model/HasOnlyReadOnly.java | 111 ++ .../client/model/HealthCheckResult.java | 99 ++ .../openapitools/client/model/MapTest.java | 247 +++ ...ropertiesAndAdditionalPropertiesClass.java | 159 ++ .../client/model/Model200Response.java | 124 ++ .../client/model/ModelApiResponse.java | 6 +- .../openapitools/client/model/ModelFile.java | 102 ++ .../openapitools/client/model/ModelList.java | 96 + .../client/model/ModelReturn.java | 99 ++ .../org/openapitools/client/model/Name.java | 164 ++ .../client/model/NullableClass.java | 427 +++++ .../openapitools/client/model/NumberOnly.java | 97 + .../model/ObjectWithDeprecatedFields.java | 190 ++ .../org/openapitools/client/model/Order.java | 6 +- .../client/model/OuterComposite.java | 147 ++ .../openapitools/client/model/OuterEnum.java | 77 + .../client/model/OuterEnumDefaultValue.java | 77 + .../client/model/OuterEnumInteger.java | 77 + .../model/OuterEnumIntegerDefaultValue.java | 77 + .../model/OuterObjectWithEnumProperty.java | 97 + .../client/model/ParentWithNullable.java | 163 ++ .../org/openapitools/client/model/Pet.java | 20 +- .../client/model/ReadOnlyFirst.java | 120 ++ .../client/model/SingleRefType.java | 75 + .../client/model/SpecialModelName.java | 96 + .../org/openapitools/client/model/Tag.java | 6 +- ...neFreeformAdditionalPropertiesRequest.java | 99 ++ .../org/openapitools/client/model/User.java | 6 +- .../client/api/AnotherFakeApiTest.java | 68 + .../client/api/DefaultApiTest.java | 63 + .../openapitools/client/api/FakeApiTest.java | 449 +++++ .../api/FakeClassnameTags123ApiTest.java | 68 + .../model/AdditionalPropertiesClassTest.java | 52 + .../client/model/AllOfWithSingleRefTest.java | 51 + .../openapitools/client/model/AnimalTest.java | 50 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 46 + .../client/model/ArrayOfNumberOnlyTest.java | 46 + .../client/model/ArrayTestTest.java | 62 + .../client/model/CapitalizationTest.java | 82 + .../openapitools/client/model/CatTest.java | 59 + .../client/model/ChildWithNullableTest.java | 59 + .../client/model/ClassModelTest.java | 42 + .../openapitools/client/model/ClientTest.java | 42 + .../client/model/DeprecatedObjectTest.java | 42 + .../openapitools/client/model/DogTest.java | 59 + .../client/model/EnumArraysTest.java | 53 + .../client/model/EnumClassTest.java | 32 + .../client/model/EnumTestTest.java | 102 ++ .../FakeBigDecimalMap200ResponseTest.java | 53 + .../client/model/FileSchemaTestClassTest.java | 54 + .../model/FooGetDefaultResponseTest.java | 43 + .../openapitools/client/model/FooTest.java | 42 + .../client/model/FormatTestTest.java | 166 ++ .../client/model/HasOnlyReadOnlyTest.java | 50 + .../client/model/HealthCheckResultTest.java | 42 + .../client/model/MapTestTest.java | 68 + ...rtiesAndAdditionalPropertiesClassTest.java | 63 + .../client/model/Model200ResponseTest.java | 50 + .../client/model/ModelFileTest.java | 42 + .../client/model/ModelListTest.java | 42 + .../client/model/ModelReturnTest.java | 42 + .../openapitools/client/model/NameTest.java | 66 + .../client/model/NullableClassTest.java | 137 ++ .../client/model/NumberOnlyTest.java | 43 + .../model/ObjectWithDeprecatedFieldsTest.java | 71 + .../client/model/OuterCompositeTest.java | 59 + .../model/OuterEnumDefaultValueTest.java | 32 + .../OuterEnumIntegerDefaultValueTest.java | 32 + .../client/model/OuterEnumIntegerTest.java | 32 + .../client/model/OuterEnumTest.java | 32 + .../OuterObjectWithEnumPropertyTest.java | 43 + .../client/model/ParentWithNullableTest.java | 50 + .../client/model/ReadOnlyFirstTest.java | 50 + .../client/model/SingleRefTypeTest.java | 32 + .../client/model/SpecialModelNameTest.java | 42 + ...eeformAdditionalPropertiesRequestTest.java | 44 + 572 files changed, 38137 insertions(+), 525 deletions(-) create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Animal.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Capitalization.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Cat.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ChildWithNullable.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ClassModel.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Client.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DefaultApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Dog.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumArrays.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeBigDecimalMap200Response.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Foo.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FormatTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MapTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Model200Response.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelFile.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelList.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelReturn.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Name.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NullableClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterComposite.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnum.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ParentWithNullable.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SingleRefType.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ChildWithNullable.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/DeprecatedObject.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ParentWithNullable.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SingleRefType.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Animal.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Capitalization.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Cat.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ChildWithNullable.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ClassModel.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Client.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/DefaultApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Dog.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumArrays.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeBigDecimalMap200Response.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Foo.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/FormatTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/MapTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Model200Response.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelFile.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelList.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelReturn.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/Name.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/NullableClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/NumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterComposite.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnum.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ParentWithNullable.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/SingleRefType.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ChildWithNullable.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/DeprecatedObject.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ParentWithNullable.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SingleRefType.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Animal.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ArrayTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Capitalization.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Cat.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ChildWithNullable.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ClassModel.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Client.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/DefaultApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Dog.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/EnumArrays.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/EnumClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/EnumTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/FakeApi.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/FakeBigDecimalMap200Response.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Foo.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/FormatTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/MapTest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Model200Response.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ModelFile.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ModelList.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ModelReturn.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/Name.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/NullableClass.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/NumberOnly.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/OuterComposite.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/OuterEnum.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ParentWithNullable.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/SingleRefType.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/docs/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ChildWithNullable.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/DeprecatedObject.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ParentWithNullable.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SingleRefType.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java diff --git a/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml b/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml index 6df972d7728e..7ffcc1cdcb85 100644 --- a/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml +++ b/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml @@ -1,7 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson library: microprofile -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: serializationLibrary: jackson diff --git a/bin/configs/java-microprofile-rest-client-3.0.yaml b/bin/configs/java-microprofile-rest-client-3.0.yaml index e0a2c0a3178d..0963a49c9d28 100644 --- a/bin/configs/java-microprofile-rest-client-3.0.yaml +++ b/bin/configs/java-microprofile-rest-client-3.0.yaml @@ -1,7 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/microprofile-rest-client-3.0 library: microprofile -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: microprofile-rest-client-3 diff --git a/bin/configs/java-microprofile-rest-client.yaml b/bin/configs/java-microprofile-rest-client.yaml index 325cebe61ca8..26328850db1d 100644 --- a/bin/configs/java-microprofile-rest-client.yaml +++ b/bin/configs/java-microprofile-rest-client.yaml @@ -1,7 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/microprofile-rest-client library: microprofile -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: microprofile-rest-client diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index d1eab74f3fa3..2242386b9b42 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 2ffb19c88591..f6c41195627e 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -72,7 +72,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index b5e7384f4ec6..8891de60a0d0 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -53,7 +53,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.client.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |rootJavaEEPackage|Root package name for Java EE| |Helidon 2.x and earlier: javax; Helidon 3.x and later: jakarta| |serializableModel|boolean - toggle "implements Serializable" for generated models| |false| diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index 13af83f52137..f46a9eda3f3f 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -53,7 +53,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.server.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |performBeanValidation|Perform BeanValidation| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |rootJavaEEPackage|Root package name for Java EE| |Helidon 2.x and earlier: javax; Helidon 3.x and later: jakarta| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 6c8c79dfcc3b..210db1efcb9a 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 72d32e61225b..4640a166ac1d 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -66,7 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseUrl|The URL of the license| |http://unlicense.org| |micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.4.3| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 71261b9aa644..4817892b446b 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -64,7 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseUrl|The URL of the license| |http://unlicense.org| |micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.4.3| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md index 335e71f9678a..11a92e692023 100644 --- a/docs/generators/java-microprofile.md +++ b/docs/generators/java-microprofile.md @@ -69,7 +69,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null| |microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null| |modelPackage|package for generated models| |org.openapitools.client.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index e87372b5fa5a..7ed5179526b2 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 6fa61fa2c9d2..789e58062aef 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |com.prokarma.pkmst.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 20d617d45ee3..c14d28f8f101 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |apimodels| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 2e02829c2ed5..18e29ce40f5b 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |null| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index b39dfcaf03f8..c95a7e65c6a0 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.vertxweb.server.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 9f9024732f28..8093e9fea525 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.server.api.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-wiremock.md b/docs/generators/java-wiremock.md index b8a0af01f014..c13cd11f5a87 100644 --- a/docs/generators/java-wiremock.md +++ b/docs/generators/java-wiremock.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |null| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java.md b/docs/generators/java.md index 96cb5b888bfe..184a6d1ca5f8 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -69,7 +69,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null| |microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null| |modelPackage|package for generated models| |org.openapitools.client.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 8029aa638bb0..0d8d492cf7ad 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 395719497aab..29a7923078b0 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 4228d9a6bae0..34e21c850e25 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -62,7 +62,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseUrl|The URL of the license| |http://unlicense.org| |loadTestDataFromFile|Load test data from a generated JSON file| |false| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 633cd7578058..ed011e27f2a7 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -60,7 +60,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 34d402be27d7..0e5ac8c87c61 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 7e75d1b939a9..149173bf40ad 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 4dfd3e6295a8..f4ab7ca6dbb5 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index ccd66e36bb0a..36656ae9e00f 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 745517a34ae8..ec4a499b39a9 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -65,7 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 7f10686ae7e1..399134bfcd6a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -326,7 +326,7 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newString(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, "Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); - cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable)); + cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.", this.openApiNullable)); cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); cliOptions.add(CliOption.newString(IMPLICIT_HEADERS_REGEX, "Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true")); cliOptions.add(CliOption.newBoolean(CAMEL_CASE_DOLLAR_SIGN, "Fix camelCase when starting with $ sign. when true : $Value when false : $value")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 8239da1fd6bd..45b62581f15f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -628,6 +628,10 @@ public void processOpts() { forceSerializationLibrary(SERIALIZATION_LIBRARY_JSONB); } + // currently not supported for Microprofile (neither for Jackson nor JSON-B) + openApiNullable = false; + additionalProperties.put(OPENAPI_NULLABLE, false); + if (microprofileFramework.equals(MICROPROFILE_KUMULUZEE)) { supportingFiles.add(new SupportingFile("kumuluzee.pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("kumuluzee.config.yaml.mustache", "src/main/resources", "config.yaml")); @@ -636,6 +640,9 @@ public void processOpts() { if ("3.0".equals(microprofileRestClientVersion)) { additionalProperties.put("microprofile3", true); + if (getSerializationLibrary().equals(SERIALIZATION_LIBRARY_JSONB)) { + additionalProperties.put("jsonbPolymorphism", true); + } } } else if (APACHE.equals(getLibrary())) { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/model.mustache index 2444f0eb46e8..8ac93be1b004 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/model.mustache @@ -37,9 +37,12 @@ import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; import {{rootJavaEEPackage}}.json.stream.JsonGenerator; import {{rootJavaEEPackage}}.json.stream.JsonParser; import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} +{{#jsonbPolymorphism}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbSubtype; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTransient; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeInfo; +{{/jsonbPolymorphism}} import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} {{/jsonb}} {{#useBeanValidation}} import {{rootJavaEEPackage}}.validation.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index 10ffbcf6c76c..9fcac409cb6d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -22,7 +22,7 @@ * {{{.}}} */ {{/description}} -{{>additionalModelTypeAnnotations}} +{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} {{#vendorExtensions.x-class-extra-annotation}} {{{vendorExtensions.x-class-extra-annotation}}} {{/vendorExtensions.x-class-extra-annotation}} @@ -45,7 +45,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi */ {{/description}} {{^withXml}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}} + {{#jsonb}}{{^isDiscriminator}}@JsonbProperty("{{baseName}}"){{/isDiscriminator}}{{#isDiscriminator}}{{#jsonbPolymorphism}}@JsonbTransient{{/jsonbPolymorphism}}{{^jsonbPolymorphism}}@JsonbProperty("{{baseName}}"){{/jsonbPolymorphism}}{{/isDiscriminator}}{{/jsonb}} {{/withXml}} {{#vendorExtensions.x-field-extra-annotation}} {{{vendorExtensions.x-field-extra-annotation}}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache index c09c296b42c6..e4ab3b15ec86 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache @@ -234,7 +234,7 @@ {{/jackson}} 2.1.0 2.0.0 - 2.0.0 + 3.0.0 2.0.1 3.0.0 3.0.1 diff --git a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache index c833321ebfa7..58bfed9c45b3 100644 --- a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache @@ -15,3 +15,9 @@ {{/-last}} {{/discriminator.mappedModels}} {{/jackson}} +{{#jsonbPolymorphism}} +@JsonbTypeInfo(key = "{{{discriminator.propertyBaseName}}}"{{#discriminator.mappedModels}}{{#-first}}, value = { +{{/-first}} + @JsonbSubtype(alias = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}", type = {{modelName}}.class), +{{#-last}} +}{{/-last}}{{/discriminator.mappedModels}}){{/jsonbPolymorphism}} \ No newline at end of file diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml index d53697eb8f7c..a6a61b273cb0 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml @@ -163,7 +163,7 @@ 2.17.1 2.1.0 2.0.0 - 2.0.0 + 3.0.0 2.0.1 3.0.0 3.0.1 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/.openapi-generator/FILES index 6943768893bd..719f590596a2 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/.openapi-generator/FILES +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/.openapi-generator/FILES @@ -1,23 +1,119 @@ README.md +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md docs/Pet.md docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md pom.xml src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java src/main/java/org/openapitools/client/api/ApiException.java src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java src/main/java/org/openapitools/client/api/PetApi.java src/main/java/org/openapitools/client/api/StoreApi.java src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +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 +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +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 +src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md index 4c3e40a34b5c..1cb837096230 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md @@ -1,6 +1,6 @@ # OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..fe69a56eebf4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4146d56a372b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Animal.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Animal.md new file mode 100644 index 000000000000..d9b32f14c88a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AnotherFakeApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..73c966d2d549 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/AnotherFakeApi.md @@ -0,0 +1,75 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..0188db3eb131 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..a5753530aada --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayTest.md new file mode 100644 index 000000000000..36077c9df300 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Capitalization.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Capitalization.md new file mode 100644 index 000000000000..82a812711de2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Cat.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Cat.md new file mode 100644 index 000000000000..390dd519c8ce --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Category.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Category.md index a7fc939d252e..ab6d1ec334dc 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Category.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Category.md @@ -2,14 +2,13 @@ # Category -A category for a pet ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **Long** | | [optional] | -|**name** | **String** | | [optional] | +|**name** | **String** | | | diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ChildWithNullable.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ChildWithNullable.md new file mode 100644 index 000000000000..73c0dd6d4737 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ClassModel.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ClassModel.md new file mode 100644 index 000000000000..af46dea1f6c8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Client.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Client.md new file mode 100644 index 000000000000..ef07b4ab8b9d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DefaultApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DefaultApi.md new file mode 100644 index 000000000000..3b2c1dbda173 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DefaultApi.md @@ -0,0 +1,69 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | response | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DeprecatedObject.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DeprecatedObject.md new file mode 100644 index 000000000000..48de1d624425 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Dog.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Dog.md new file mode 100644 index 000000000000..972c981c0d05 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumArrays.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumArrays.md new file mode 100644 index 000000000000..b2222d5beb25 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumTest.md new file mode 100644 index 000000000000..380a2aef0bc3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeApi.md new file mode 100644 index 000000000000..02df4858d16b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeApi.md @@ -0,0 +1,1555 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form 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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> void fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + void result = apiInstance.fakeHttpSignatureTest(pet, query1, header1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterObjectWithEnumProperty outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body + try { + OuterObjectWithEnumProperty result = apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakePropertyEnumIntegerSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testAdditionalPropertiesReference + +> void testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + void result = apiInstance.testAdditionalPropertiesReference(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.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 | - | + + +## testBodyWithBinary + +> void testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + File body = new File("/path/to/file"); // File | image to upload + try { + void result = apiInstance.testBodyWithBinary(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> void testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + void result = apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### 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** | Success | - | + + +## testBodyWithQueryParams + +> void testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + void result = apiInstance.testBodyWithQueryParams(query, user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### 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** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + Date date = new Date(); // Date | None + Date dateTime = new Date(); // Date | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **Date**| None | [optional] | +| **dateTime** | **Date**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> void testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumQueryModelArray = Arrays.asList(-efg); // List | + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + void result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> void testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + void result = apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + +## testInlineAdditionalProperties + +> void testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + void result = apiInstance.testInlineAdditionalProperties(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + + +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + void result = apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 | - | + + +## testJsonFormData + +> void testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + void result = apiInstance.testJsonFormData(param, param2); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testNullable + +> void testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body + try { + void result = apiInstance.testNullable(childWithNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testNullable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### 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) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | + Map language = new HashMap(); // Map | + try { + void result = apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + void result = apiInstance.testStringMapReference(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..475be1d2d738 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..e4ff70ed909b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FakeClassnameTags123Api.md @@ -0,0 +1,82 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FileSchemaTestClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..85d1a0636694 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Foo.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Foo.md new file mode 100644 index 000000000000..6b3f0556528a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FooGetDefaultResponse.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..ff3d7a3a56c3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FormatTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FormatTest.md new file mode 100644 index 000000000000..d5b492c6e4ec --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **Date** | | | +|**dateTime** | **Date** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..29da5205dbba --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HealthCheckResult.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HealthCheckResult.md new file mode 100644 index 000000000000..4885e6f1cada --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MapTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MapTest.md new file mode 100644 index 000000000000..54380188e1d6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..f9867c07e7c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **Date** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Model200Response.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Model200Response.md new file mode 100644 index 000000000000..109411580c62 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelApiResponse.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelApiResponse.md index cd7e3c400be6..e374c2dd2dec 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelApiResponse.md @@ -2,7 +2,6 @@ # ModelApiResponse -Describes the result of uploading an image resource ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelFile.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelFile.md new file mode 100644 index 000000000000..adcde984f527 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelList.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelList.md new file mode 100644 index 000000000000..f93ab7dde8d4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelReturn.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelReturn.md new file mode 100644 index 000000000000..0bd356861eb7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Name.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Name.md new file mode 100644 index 000000000000..c901d9435309 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NullableClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NullableClass.md new file mode 100644 index 000000000000..ba2b7f38034e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **Date** | | [optional] | +|**datetimeProp** | **Date** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NumberOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NumberOnly.md new file mode 100644 index 000000000000..b8ed1a4cfae1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..f1cf571f4c09 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Order.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Order.md index 7bfa42e6a902..4993c503e5f3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Order.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Order.md @@ -2,7 +2,6 @@ # Order -An order for a pets from the pet store ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterComposite.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterComposite.md new file mode 100644 index 000000000000..98b56e0763ff --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnum.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumInteger.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..0fafaaa27154 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ParentWithNullable.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ParentWithNullable.md new file mode 100644 index 000000000000..e4d322985632 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Pet.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Pet.md index 8bb363301232..54af77a9f5a7 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Pet.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Pet.md @@ -2,7 +2,6 @@ # Pet -A pet for sale in the pet store ## Properties @@ -11,7 +10,7 @@ A pet for sale in the pet store |**id** | **Long** | | [optional] | |**category** | [**Category**](Category.md) | | [optional] | |**name** | **String** | | | -|**photoUrls** | **List<String>** | | | +|**photoUrls** | **Set<String>** | | | |**tags** | [**List<Tag>**](Tag.md) | | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/PetApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/PetApi.md index fb5361b0808f..bf4b4333d964 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/PetApi.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/PetApi.md @@ -1,6 +1,6 @@ # PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -12,12 +12,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* | [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | | [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | | [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | ## addPet -> Pet addPet(pet) +> void addPet(pet) Add a new pet to the store @@ -37,7 +38,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -46,7 +47,7 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.addPet(pet); + void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -68,7 +69,7 @@ public class Example { ### Return type -[**Pet**](Pet.md) +[**void**](Void.md) ### Authorization @@ -77,13 +78,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Successful operation | - | | **405** | Invalid input | - | @@ -109,7 +110,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -157,6 +158,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | Successful operation | - | | **400** | Invalid pet value | - | @@ -182,7 +184,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -234,7 +236,7 @@ public class Example { ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,16 +256,16 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -281,11 +283,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **tags** | [**List<String>**](String.md)| Tags to filter by | | +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization @@ -326,7 +328,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -381,7 +383,7 @@ public class Example { ## updatePet -> Pet updatePet(pet) +> void updatePet(pet) Update an existing pet @@ -401,7 +403,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -410,7 +412,7 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.updatePet(pet); + void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -432,7 +434,7 @@ public class Example { ### Return type -[**Pet**](Pet.md) +[**void**](Void.md) ### Authorization @@ -441,13 +443,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -475,7 +477,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -525,6 +527,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | Successful operation | - | | **405** | Invalid input | - | @@ -550,7 +553,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -602,3 +605,78 @@ public class Example { |-------------|-------------|------------------| | **200** | successful operation | - | + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ReadOnlyFirst.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..ad6af7ee155f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SingleRefType.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SingleRefType.md new file mode 100644 index 000000000000..cc269bb871fd --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SpecialModelName.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SpecialModelName.md new file mode 100644 index 000000000000..4b6a06e36224 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/StoreApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/StoreApi.md index ae64b8574e22..7e03edf04b74 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/StoreApi.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/StoreApi.md @@ -1,12 +1,12 @@ # StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | | [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | -| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | | [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | @@ -32,7 +32,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); String orderId = "orderId_example"; // String | ID of the order that needs to be deleted @@ -100,7 +100,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -168,7 +168,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Long orderId = 56L; // Long | ID of pet that needs to be fetched @@ -236,7 +236,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Order order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Tag.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Tag.md index abfde4afb501..5088b2dd1c31 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Tag.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/Tag.md @@ -2,7 +2,6 @@ # Tag -A tag for a pet ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..dc066e6c7dac --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/User.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/User.md index 426845227bd3..08813e4b10b4 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/User.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/User.md @@ -2,7 +2,6 @@ # User -A User who is purchasing from the pet store ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/UserApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/UserApi.md index 89c1bfc6026d..d82f8da184b7 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/UserApi.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -30,20 +30,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); User user = new User(); // User | Created user object @@ -74,7 +67,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -103,20 +96,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -147,7 +133,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -176,20 +162,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -220,7 +199,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -249,20 +228,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be deleted @@ -293,7 +265,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -329,7 +301,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. @@ -397,7 +369,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The user name for login @@ -441,7 +413,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| | **400** | Invalid username/password supplied | - | @@ -460,20 +432,13 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); try { @@ -500,7 +465,7 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -529,20 +494,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted @@ -575,7 +533,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml index 5fe978cf467e..16079576ce67 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml @@ -4,7 +4,7 @@ microprofile-rest-client-3-jackson jar microprofile-rest-client-3-jackson - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ 1.0.0 src/main/java @@ -158,7 +158,7 @@ 2.17.1 2.1.0 2.0.0 - 2.0.0 + 3.0.0 2.0.1 3.0.0 3.0.1 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java index c75ca023ce81..1d22650ec627 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..c22b045c6ed9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/another-fake/dummy") +public interface AnotherFakeApi { + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client call123testSpecialTags(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiException.java index 2fc6d04ee687..590cd07dc743 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiException.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiException.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java index 0dec2c6aec06..42895ef7d214 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..2c7f381b9336 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/foo") +public interface DefaultApi { + + @GET + + @Produces({ "application/json" }) + FooGetDefaultResponse fooGet() throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..c23faf8ba1b8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,237 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import java.util.Date; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake") +public interface FakeApi { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException, ProcessingException; + + /** + * Health check endpoint + * + */ + @GET + @Path("/health") + @Produces({ "application/json" }) + HealthCheckResult fakeHealthGet() throws ApiException, ProcessingException; + + /** + * test http signature authentication + * + */ + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + void fakeHttpSignatureTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException, ProcessingException; + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + String fakeOuterStringSerialize(String body) throws ApiException, ProcessingException; + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException, ProcessingException; + + /** + * test referenced additionalProperties + * + * + * + */ + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + void testAdditionalPropertiesReference(Map requestBody) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + void testBodyWithBinary(File body) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + void testBodyWithQueryParams(@QueryParam("query") String query, User user) throws ApiException, ProcessingException; + + /** + * To test \"client\" model + * + * To test \"client\" model + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClientModel(Client client) throws ApiException, ProcessingException; + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + */ + @POST + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary" , required = false) Attachment binaryDetail, @Multipart(value = "date", required = false) Date date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback) throws ApiException, ProcessingException; + + /** + * To test enum parameters + * + * To test enum parameters + * + */ + @GET + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString) throws ApiException, ProcessingException; + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + */ + @DELETE + + void testGroupParameters(@QueryParam("required_string_group") Integer requiredStringGroup, @HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, @QueryParam("required_int64_group") Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group) throws ApiException, ProcessingException; + + /** + * test inline additionalProperties + * + * + * + */ + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + void testInlineAdditionalProperties(Map requestBody) throws ApiException, ProcessingException; + + /** + * test inline free-form additionalProperties + * + * + * + */ + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException, ProcessingException; + + /** + * test json serialization of form data + * + * + * + */ + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "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 pipe, @QueryParam("ioutil") List ioutil, @QueryParam("http") List http, @QueryParam("url") List url, @QueryParam("context") List context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map language) throws ApiException, ProcessingException; + + /** + * test referenced string map + * + * + * + */ + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(Map requestBody) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..1db471b03658 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake_classname_test") +public interface FakeClassnameTags123Api { + + /** + * To test class name in snake case + * + * To test class name in snake case + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClassname(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/PetApi.java index d353688861ca..224b962916ed 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/PetApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -15,6 +15,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -33,13 +34,13 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ @RegisterRestClient(configKey="petstore") @RegisterProvider(ApiExceptionMapper.class) -@Path("/pet") +@Path("") public interface PetApi { /** @@ -49,10 +50,9 @@ public interface PetApi { * */ @POST - + @Path("/pet") @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - Pet addPet(Pet pet) throws ApiException, ProcessingException; + void addPet(Pet pet) throws ApiException, ProcessingException; /** * Deletes a pet @@ -61,7 +61,7 @@ public interface PetApi { * */ @DELETE - @Path("/{petId}") + @Path("/pet/{petId}") void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; /** @@ -71,7 +71,7 @@ public interface PetApi { * */ @GET - @Path("/findByStatus") + @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) List findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; @@ -84,9 +84,9 @@ public interface PetApi { */ @Deprecated @GET - @Path("/findByTags") + @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - List findPetsByTags(@QueryParam("tags") List tags) throws ApiException, ProcessingException; + Set findPetsByTags(@QueryParam("tags") Set tags) throws ApiException, ProcessingException; /** * Find pet by ID @@ -95,7 +95,7 @@ public interface PetApi { * */ @GET - @Path("/{petId}") + @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) Pet getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; @@ -106,10 +106,9 @@ public interface PetApi { * */ @PUT - + @Path("/pet") @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - Pet updatePet(Pet pet) throws ApiException, ProcessingException; + void updatePet(Pet pet) throws ApiException, ProcessingException; /** * Updates a pet in the store with form data @@ -118,7 +117,7 @@ public interface PetApi { * */ @POST - @Path("/{petId}") + @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException; @@ -129,8 +128,20 @@ public interface PetApi { * */ @POST - @Path("/{petId}/uploadImage") + @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException; + + /** + * uploads an image (required) + * + * + * + */ + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @Multipart(value = "requiredFile" ) Attachment requiredFileDetail, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata) throws ApiException, ProcessingException; } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/StoreApi.java index cd94c5b3bca6..0fdf70e0825b 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -31,7 +31,7 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ @@ -47,8 +47,8 @@ public interface StoreApi { * */ @DELETE - @Path("/order/{orderId}") - void deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException; + @Path("/order/{order_id}") + void deleteOrder(@PathParam("order_id") String orderId) throws ApiException, ProcessingException; /** * Returns pet inventories by status @@ -68,9 +68,9 @@ public interface StoreApi { * */ @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - Order getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException; + Order getOrderById(@PathParam("order_id") Long orderId) throws ApiException, ProcessingException; /** * Place an order for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/UserApi.java index 7f8c13c9e080..515c42ae977d 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -32,7 +32,7 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..be4be5765e0c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,143 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY +}) + +public class AdditionalPropertiesClass { + + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + + private Map mapProperty = null; + + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + */ + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + */ + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..53c0cb73bf2b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,126 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + AllOfWithSingleRef.JSON_PROPERTY_USERNAME, + AllOfWithSingleRef.JSON_PROPERTY_SINGLE_REF_TYPE +}) + +public class AllOfWithSingleRef { + + public static final String JSON_PROPERTY_USERNAME = "username"; + + private String username; + + public static final String JSON_PROPERTY_SINGLE_REF_TYPE = "SingleRefType"; + + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + /** + * Set username + */ + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + */ + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..d1d133daa3fa --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,138 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), +}) + +public class Animal { + + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + + private String className; + + public static final String JSON_PROPERTY_COLOR = "color"; + + private String color = "red"; + + /** + * Get className + * @return className + **/ + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + /** + * Set className + */ + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { + return color; + } + + /** + * Set color + */ + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..633f5951245a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,107 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) + +public class ArrayOfArrayOfNumberOnly { + + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + */ + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..eee630e931e7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,107 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) + +public class ArrayOfNumberOnly { + + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + */ + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..54969eb9ad64 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,183 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) + +public class ArrayTest { + + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + + private List arrayOfString = null; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + + private List> arrayArrayOfInteger = null; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + */ + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + */ + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + */ + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..5c6131e7761b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,248 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) + +public class Capitalization { + + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + + private String smallCamel; + + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + + private String capitalCamel; + + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + + private String smallSnake; + + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + + private String capitalSnake; + + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + + private String scAETHFlowPoints; + + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + /** + * Name of the pet + */ + + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + */ + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + */ + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + */ + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + */ + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + */ + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + */ + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..f8ee048670a1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Cat extends Animal { + + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + */ + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java index 0b66df25dc92..28e0277c8ae7 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -28,9 +28,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -/** - * A category for a pet - */ public class Category { @@ -40,7 +37,7 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; - private String name; + private String name = "default-name"; /** * Get id @@ -71,7 +68,7 @@ public Category id(Long id) { * @return name **/ @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { return name; } @@ -80,7 +77,7 @@ public String getName() { * Set name */ @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 000000000000..4c315942c2c1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.ParentWithNullable; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ChildWithNullable.JSON_PROPERTY_OTHER_PROPERTY +}) + +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class ChildWithNullable extends ParentWithNullable { + + public static final String JSON_PROPERTY_OTHER_PROPERTY = "otherProperty"; + + private String otherProperty; + + /** + * Get otherProperty + * @return otherProperty + **/ + @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOtherProperty() { + return otherProperty; + } + + /** + * Set otherProperty + */ + @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..5001a36e341d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) +/** + * Model for testing model with \"_class\" property + */ + +public class ClassModel { + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + */ + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..74256bdbc46e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,95 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) + +public class Client { + + public static final String JSON_PROPERTY_CLIENT = "client"; + + private String client; + + /** + * Get client + * @return client + **/ + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; + } + + /** + * Set client + */ + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 000000000000..84f363f42802 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,95 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + DeprecatedObject.JSON_PROPERTY_NAME +}) + +public class DeprecatedObject { + + public static final String JSON_PROPERTY_NAME = "name"; + + private String name; + + /** + * Get name + * @return name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * Set name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..a40c4f416e02 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Dog extends Animal { + + public static final String JSON_PROPERTY_BREED = "breed"; + + private String breed; + + /** + * Get breed + * @return breed + **/ + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; + } + + /** + * Set breed + */ + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..4c3728a3d099 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,200 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) + +public class EnumArrays { + + public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + String value; + + JustSymbolEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + + private JustSymbolEnum justSymbol; + + public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + String value; + + ArrayEnumEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + */ + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + */ + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..bfd8dd92cb15 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..c896035c6e69 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,438 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE +}) +@JsonTypeName("Enum_Test") + +public class EnumTest { + + public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + String value; + + EnumStringEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + + private EnumStringEnum enumString; + + public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + + private EnumStringRequiredEnum enumStringRequired; + + public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + @JsonValue + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + + private EnumIntegerEnum enumInteger; + + public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + @JsonValue + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + + private OuterEnum outerEnum; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + + private OuterEnumInteger outerEnumInteger; + + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + */ + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + */ + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + */ + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + */ + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + */ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + */ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + */ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + */ + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..9229df6b454f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID, + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP +}) +@JsonTypeName("fakeBigDecimalMap_200_response") + +public class FakeBigDecimalMap200Response { + + public static final String JSON_PROPERTY_SOME_ID = "someId"; + + private BigDecimal someId; + + public static final String JSON_PROPERTY_SOME_MAP = "someMap"; + + private Map someMap = null; + + /** + * Get someId + * @return someId + **/ + @JsonProperty(JSON_PROPERTY_SOME_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getSomeId() { + return someId; + } + + /** + * Set someId + */ + @JsonProperty(JSON_PROPERTY_SOME_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someMap + * @return someMap + **/ + @JsonProperty(JSON_PROPERTY_SOME_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getSomeMap() { + return someMap; + } + + /** + * Set someMap + */ + @JsonProperty(JSON_PROPERTY_SOME_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..18dd00075932 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) + +public class FileSchemaTestClass { + + public static final String JSON_PROPERTY_FILE = "file"; + + private ModelFile _file; + + public static final String JSON_PROPERTY_FILES = "files"; + + private List files = null; + + /** + * Get _file + * @return _file + **/ + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + */ + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + /** + * Set files + */ + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..5a4027297bc9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,95 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Foo.JSON_PROPERTY_BAR +}) + +public class Foo { + + public static final String JSON_PROPERTY_BAR = "bar"; + + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; + } + + /** + * Set bar + */ + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..b7402dc34a80 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + FooGetDefaultResponse.JSON_PROPERTY_STRING +}) +@JsonTypeName("_foo_get_default_response") + +public class FooGetDefaultResponse { + + public static final String JSON_PROPERTY_STRING = "string"; + + private Foo string; + + /** + * Get string + * @return string + **/ + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Foo getString() { + return string; + } + + /** + * Set string + */ + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..67d54cf4552d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,566 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_DECIMAL, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER +}) +@JsonTypeName("format_test") + +public class FormatTest { + + public static final String JSON_PROPERTY_INTEGER = "integer"; + + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + + private Double _double; + + public static final String JSON_PROPERTY_DECIMAL = "decimal"; + + private BigDecimal decimal; + + public static final String JSON_PROPERTY_STRING = "string"; + + private String string; + + public static final String JSON_PROPERTY_BYTE = "byte"; + + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + + private Date date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + + private Date dateTime; + + public static final String JSON_PROPERTY_UUID = "uuid"; + + private UUID uuid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + + private String password; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + /** + * A string that is a 10 digit number. Can have leading zeros. + */ + + private String patternWithDigits; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { + return integer; + } + + /** + * Set integer + */ + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { + return int32; + } + + /** + * Set int32 + */ + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { + return int64; + } + + /** + * Set int64 + */ + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { + return number; + } + + /** + * Set number + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { + return _float; + } + + /** + * Set _float + */ + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { + return _double; + } + + /** + * Set _double + */ + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + */ + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { + return string; + } + + /** + * Set string + */ + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + */ + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { + return binary; + } + + /** + * Set binary + */ + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Date getDate() { + return date; + } + + /** + * Set date + */ + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(Date date) { + this.date = date; + } + + public FormatTest date(Date date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Date getDateTime() { + return dateTime; + } + + /** + * Set dateTime + */ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { + return password; + } + + /** + * Set password + */ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + */ + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + */ + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..78de93c838b1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,112 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) +@JsonTypeName("hasOnlyReadOnly") + +public class HasOnlyReadOnly { + + public static final String JSON_PROPERTY_BAR = "bar"; + + private String bar; + + public static final String JSON_PROPERTY_FOO = "foo"; + + private String foo; + + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(value = JSON_PROPERTY_BAR) String bar, + @JsonProperty(value = JSON_PROPERTY_FOO) String foo + ) { + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { + return foo; + } + + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..faeae0f51c2d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE +}) +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ + +public class HealthCheckResult { + + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + */ + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..5adaa6bb314f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,251 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) + +public class MapTest { + + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + + private Map> mapMapOfString = null; + + public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + String value; + + InnerEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + + private Map mapOfEnumString = null; + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + + private Map directMap = null; + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + */ + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + */ + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + */ + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + */ + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..78060d4ef767 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,168 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) + +public class MixedPropertiesAndAdditionalPropertiesClass { + + public static final String JSON_PROPERTY_UUID = "uuid"; + + private UUID uuid; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + + private Date dateTime; + + public static final String JSON_PROPERTY_MAP = "map"; + + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Date getDateTime() { + return dateTime; + } + + /** + * Set dateTime + */ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { + return map; + } + + /** + * Set map + */ + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..56557b9ab1e2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,129 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) +@JsonTypeName("200_response") +/** + * Model for testing model name starting with number + */ + +public class Model200Response { + + public static final String JSON_PROPERTY_NAME = "name"; + + private Integer name; + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + + private String propertyClass; + + /** + * Get name + * @return name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { + return name; + } + + /** + * Set name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + */ + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b5436a50670b..8539f1173a92 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -30,9 +30,6 @@ ModelApiResponse.JSON_PROPERTY_MESSAGE }) @JsonTypeName("ApiResponse") -/** - * Describes the result of uploading an image resource - */ public class ModelApiResponse { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..77a5d760f0fa --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +/** + * Must be named `File` for test. + */ + +public class ModelFile { + + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + /** + * Test capitalization + */ + + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + */ + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..27814afbd025 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") + +public class ModelList { + + public static final String JSON_PROPERTY_123LIST = "123-list"; + + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; + } + + /** + * Set _123list + */ + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..53c7bc7623c9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) +@JsonTypeName("Return") +/** + * Model for testing reserved words + */ + +public class ModelReturn { + + public static final String JSON_PROPERTY_RETURN = "return"; + + private Integer _return; + + /** + * Get _return + * @return _return + **/ + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { + return _return; + } + + /** + * Set _return + */ + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..81ab3e3d38da --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,174 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) +/** + * Model for testing model name same as property name + */ + +public class Name { + + public static final String JSON_PROPERTY_NAME = "name"; + + private Integer name; + + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + + private Integer snakeCase; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + + private String property; + + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + + private Integer _123number; + + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(value = JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this.snakeCase = snakeCase; + this._123number = _123number; + } + + /** + * Get name + * @return name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { + return name; + } + + /** + * Set name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { + return property; + } + + /** + * Set property + */ + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { + return _123number; + } + + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..059c3597bcb0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,480 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) + +public class NullableClass extends HashMap { + + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + + private Integer integerProp; + + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + + private BigDecimal numberProp; + + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + + private Boolean booleanProp; + + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + + private String stringProp; + + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + + private Date dateProp; + + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + + private Date datetimeProp; + + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + + private List arrayNullableProp = null; + + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + + private List arrayAndItemsNullableProp = null; + + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + + private List arrayItemsNullable = null; + + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + + private Map objectNullableProp = null; + + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + + private Map objectAndItemsNullableProp = null; + + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + */ + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + */ + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + */ + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + */ + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Date getDateProp() { + return dateProp; + } + + /** + * Set dateProp + */ + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateProp(Date dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(Date dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Date getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + */ + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDatetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + */ + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + */ + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + */ + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + */ + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + */ + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + */ + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..6a9ffb70ff3c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) + +public class NumberOnly { + + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + */ + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..226bd6c44c93 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,204 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ObjectWithDeprecatedFields.JSON_PROPERTY_UUID, + ObjectWithDeprecatedFields.JSON_PROPERTY_ID, + ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, + ObjectWithDeprecatedFields.JSON_PROPERTY_BARS +}) + +public class ObjectWithDeprecatedFields { + + public static final String JSON_PROPERTY_UUID = "uuid"; + + private String uuid; + + public static final String JSON_PROPERTY_ID = "id"; + + private BigDecimal id; + + public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + + private DeprecatedObject deprecatedRef; + + public static final String JSON_PROPERTY_BARS = "bars"; + + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUuid() { + return uuid; + } + + /** + * Set uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getId() { + return id; + } + + /** + * Set id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + */ + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBars() { + return bars; + } + + /** + * Set bars + */ + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java index 97e82f85b215..271bd025d550 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -33,9 +33,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -/** - * An order for a pets from the pet store - */ public class Order { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..2c75587b5b34 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,156 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) + +public class OuterComposite { + + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + + private BigDecimal myNumber; + + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + + private String myString; + + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + */ + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { + return myString; + } + + /** + * Set myString + */ + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + */ + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..dac560c4dfce --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..11229e2d2f34 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..c987b34969d0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..3d7397718ba2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..8a297681902f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE +}) + +public class OuterObjectWithEnumProperty { + + public static final String JSON_PROPERTY_VALUE = "value"; + + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 000000000000..657f266e6db5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -0,0 +1,169 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ParentWithNullable.JSON_PROPERTY_TYPE, + ParentWithNullable.JSON_PROPERTY_NULLABLE_PROPERTY +}) + +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable"), +}) + +public class ParentWithNullable { + + public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + + String value; + + TypeEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + + private TypeEnum type; + + public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; + + private String nullableProperty; + + /** + * Get type + * @return type + **/ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Set type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set nullableProperty + */ + @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java index af204ae60757..f53d512ee9c2 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -21,9 +21,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,9 +40,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -/** - * A pet for sale in the pet store - */ public class Pet { @@ -57,7 +57,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @@ -180,27 +180,28 @@ public Pet name(String name) { **/ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } /** * Set photoUrls */ + @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new ArrayList<>(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); return this; @@ -241,9 +242,7 @@ public Pet addTagsItem(Tag tagsItem) { /** * pet status in the store * @return status - * @deprecated **/ - @Deprecated @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public StatusEnum getStatus() { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..12380db2a61d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,122 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) + +public class ReadOnlyFirst { + + public static final String JSON_PROPERTY_BAR = "bar"; + + private String bar; + + public static final String JSON_PROPERTY_BAZ = "baz"; + + private String baz; + + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(value = JSON_PROPERTY_BAR) String bar + ) { + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { + return baz; + } + + /** + * Set baz + */ + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 000000000000..de8e06fff89c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,56 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..36ceec5f5489 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) +@JsonTypeName("_special_model.name_") + +public class SpecialModelName { + + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + */ + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java index 90220db69136..b7968d2ea3b6 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -28,9 +28,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -/** - * A tag for a pet - */ public class Tag { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..27445b752c14 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + */ + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java index 555e1e3d2811..14db71eafc49 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -34,9 +34,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -/** - * A User who is purchasing from the pet store - */ public class User { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..0941a798c10f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() { + // TODO: test validations + Client client = null; + //Client response = api.call123testSpecialTags(client); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..f4e1951dc156 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private DefaultApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() { + // TODO: test validations + //FooGetDefaultResponse response = api.fooGet(); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..26ec6bf6711c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,446 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import java.util.Date; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeApi + */ +public class FakeApiTest { + + private FakeApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeBigDecimalMapTest() { + // TODO: test validations + //FakeBigDecimalMap200Response response = api.fakeBigDecimalMap(); + //Assertions.assertNotNull(response); + + + } + + /** + * Health check endpoint + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() { + // TODO: test validations + //HealthCheckResult response = api.fakeHealthGet(); + //Assertions.assertNotNull(response); + + + } + + /** + * test http signature authentication + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHttpSignatureTestTest() { + // TODO: test validations + Pet pet = null; + String query1 = null; + String header1 = null; + //api.fakeHttpSignatureTest(pet, query1, header1); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() { + // TODO: test validations + Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() { + // TODO: test validations + OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() { + // TODO: test validations + BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() { + // TODO: test validations + String body = null; + //String response = api.fakeOuterStringSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() { + // TODO: test validations + OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + //OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + //Assertions.assertNotNull(response); + + + } + + /** + * test referenced additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // TODO: test validations + Map requestBody = null; + //api.testAdditionalPropertiesReference(requestBody); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithBinaryTest() { + // TODO: test validations + org.apache.cxf.jaxrs.ext.multipart.Attachment body = null; + //api.testBodyWithBinary(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() { + // TODO: test validations + FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() { + // TODO: test validations + String query = null; + User user = null; + //api.testBodyWithQueryParams(query, user); + //Assertions.assertNotNull(response); + + + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() { + // TODO: test validations + Client client = null; + //Client response = api.testClientModel(client); + //Assertions.assertNotNull(response); + + + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() { + // TODO: test validations + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment binary = null; + Date date = null; + Date dateTime = null; + String password = null; + String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //Assertions.assertNotNull(response); + + + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() { + // TODO: test validations + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumQueryModelArray = null; + List enumFormStringArray = null; + String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + //Assertions.assertNotNull(response); + + + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() { + // TODO: test validations + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + //Assertions.assertNotNull(response); + + + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + // TODO: test validations + Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody); + //Assertions.assertNotNull(response); + + + } + + /** + * test inline free-form additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // TODO: test validations + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + //api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //Assertions.assertNotNull(response); + + + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() { + // TODO: test validations + String param = null; + String param2 = null; + //api.testJsonFormData(param, param2); + //Assertions.assertNotNull(response); + + + } + + /** + * test nullable parent property + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testNullableTest() { + // TODO: test validations + ChildWithNullable childWithNullable = null; + //api.testNullable(childWithNullable); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() { + // TODO: test validations + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + String allowEmpty = null; + Map language = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + //Assertions.assertNotNull(response); + + + } + + /** + * test referenced string map + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testStringMapReferenceTest() { + // TODO: test validations + Map requestBody = null; + //api.testStringMapReference(requestBody); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..ada30ee8f95e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private FakeClassnameTags123Api client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() { + // TODO: test validations + Client client = null; + //Client response = api.testClassname(client); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..5b42763a7947 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..6b37cf507611 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,56 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..73732a3e5c22 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..2825e20e5bdc --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..18277c8e6f56 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..9620b7ff72e9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..409bf0546f69 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,87 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..a94308d1ce6c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java index c90a5364a5f3..950acb4b8a6e 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..dacd3d339e44 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.ParentWithNullable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..e37d9ccd3ecd --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..90ecebd0f031 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..bf67d23a6e3f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..27a294b59e93 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..6f674ef9de41 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..1b428fce8da4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..562455c24ac9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,107 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..569c7e9d480e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..61a284fbc62e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..c00504758c94 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..a1a2acb55d7b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..1348cb47e2e9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,171 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..c1ebcae72e1f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..a84fa9c59c00 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..0d967ad63274 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..e099ec508629 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..f77de62fb1e4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index ca84c5ea519c..b602e056991a 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..58c6c354681c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..87cb23417f99 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..e9db6db670ee --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..385da9b52c95 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,71 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..4a0abb629e5d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,142 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..cf9812f24f92 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..a813f7fefab7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java index d76f9c3e5435..d679c05ec068 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..2b94247bb6db --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..e492f3e0ff6f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..d72626405cc5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..b7dd55cda628 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..1116901010b0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..0693c009d468 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..40da11eea19f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java index 1398113cd875..ef6ed17143c9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -18,9 +18,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import org.junit.jupiter.api.Assertions; diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..9c72a6168511 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..210c2a450379 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..99c6982835df --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java index 2573ba6494f3..8e5aba19989b 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..dd03556a5b20 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java index 3cbc09cd7792..b93729249f27 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml index 5dfda58407b2..5804a8d6e32b 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml @@ -165,7 +165,7 @@ 2.17.1 2.1.0 2.0.0 - 2.0.0 + 3.0.0 2.0.1 3.0.0 3.0.1 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java index d7d5dca2bc60..6effb8514c2f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A category for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2791024ba294..fc1400696257 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * Describes the result of uploading an image resource diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java index d7e654ce3a9e..06c78288e181 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java @@ -25,6 +25,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * An order for a pets from the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java index d2b51d9db1cb..28dd90e2ebd4 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java @@ -29,6 +29,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java index 1317a25b1776..a12166bacceb 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A tag for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java index d717a4bd3219..f66763660060 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A User who is purchasing from the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client-3.0/.openapi-generator/FILES index ae145903e52b..c2568cfe3018 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/.openapi-generator/FILES +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/.openapi-generator/FILES @@ -1,22 +1,118 @@ README.md +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md docs/Pet.md docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md pom.xml +src/main/java/org/openapitools/client/api/AnotherFakeApi.java src/main/java/org/openapitools/client/api/ApiException.java src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java src/main/java/org/openapitools/client/api/PetApi.java src/main/java/org/openapitools/client/api/StoreApi.java src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +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 +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +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 +src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/README.md b/samples/client/petstore/java/microprofile-rest-client-3.0/README.md index 4c3e40a34b5c..1cb837096230 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/README.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/README.md @@ -1,6 +1,6 @@ # OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..fe69a56eebf4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4146d56a372b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Animal.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Animal.md new file mode 100644 index 000000000000..d9b32f14c88a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AnotherFakeApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..73c966d2d549 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/AnotherFakeApi.md @@ -0,0 +1,75 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..0188db3eb131 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..a5753530aada --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayTest.md new file mode 100644 index 000000000000..36077c9df300 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Capitalization.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Capitalization.md new file mode 100644 index 000000000000..82a812711de2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Cat.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Cat.md new file mode 100644 index 000000000000..390dd519c8ce --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Category.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Category.md index a7fc939d252e..ab6d1ec334dc 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Category.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Category.md @@ -2,14 +2,13 @@ # Category -A category for a pet ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **Long** | | [optional] | -|**name** | **String** | | [optional] | +|**name** | **String** | | | diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ChildWithNullable.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ChildWithNullable.md new file mode 100644 index 000000000000..73c0dd6d4737 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ClassModel.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ClassModel.md new file mode 100644 index 000000000000..af46dea1f6c8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Client.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Client.md new file mode 100644 index 000000000000..ef07b4ab8b9d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/DefaultApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/DefaultApi.md new file mode 100644 index 000000000000..3b2c1dbda173 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/DefaultApi.md @@ -0,0 +1,69 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | response | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/DeprecatedObject.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/DeprecatedObject.md new file mode 100644 index 000000000000..48de1d624425 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Dog.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Dog.md new file mode 100644 index 000000000000..972c981c0d05 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumArrays.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumArrays.md new file mode 100644 index 000000000000..b2222d5beb25 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumTest.md new file mode 100644 index 000000000000..380a2aef0bc3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeApi.md new file mode 100644 index 000000000000..02df4858d16b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeApi.md @@ -0,0 +1,1555 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form 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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> void fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + void result = apiInstance.fakeHttpSignatureTest(pet, query1, header1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterObjectWithEnumProperty outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body + try { + OuterObjectWithEnumProperty result = apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakePropertyEnumIntegerSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testAdditionalPropertiesReference + +> void testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + void result = apiInstance.testAdditionalPropertiesReference(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.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 | - | + + +## testBodyWithBinary + +> void testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + File body = new File("/path/to/file"); // File | image to upload + try { + void result = apiInstance.testBodyWithBinary(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> void testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + void result = apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### 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** | Success | - | + + +## testBodyWithQueryParams + +> void testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + void result = apiInstance.testBodyWithQueryParams(query, user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### 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** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + Date date = new Date(); // Date | None + Date dateTime = new Date(); // Date | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **Date**| None | [optional] | +| **dateTime** | **Date**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> void testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumQueryModelArray = Arrays.asList(-efg); // List | + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + void result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> void testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + void result = apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + +## testInlineAdditionalProperties + +> void testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + void result = apiInstance.testInlineAdditionalProperties(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + + +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + void result = apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 | - | + + +## testJsonFormData + +> void testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + void result = apiInstance.testJsonFormData(param, param2); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testNullable + +> void testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body + try { + void result = apiInstance.testNullable(childWithNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testNullable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### 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) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | + Map language = new HashMap(); // Map | + try { + void result = apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + void result = apiInstance.testStringMapReference(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..475be1d2d738 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..e4ff70ed909b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FakeClassnameTags123Api.md @@ -0,0 +1,82 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FileSchemaTestClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..85d1a0636694 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Foo.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Foo.md new file mode 100644 index 000000000000..6b3f0556528a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FooGetDefaultResponse.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..ff3d7a3a56c3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FormatTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FormatTest.md new file mode 100644 index 000000000000..d5b492c6e4ec --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **Date** | | | +|**dateTime** | **Date** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..29da5205dbba --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/HealthCheckResult.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/HealthCheckResult.md new file mode 100644 index 000000000000..4885e6f1cada --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/MapTest.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/MapTest.md new file mode 100644 index 000000000000..54380188e1d6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..f9867c07e7c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **Date** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Model200Response.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Model200Response.md new file mode 100644 index 000000000000..109411580c62 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelApiResponse.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelApiResponse.md index cd7e3c400be6..e374c2dd2dec 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelApiResponse.md @@ -2,7 +2,6 @@ # ModelApiResponse -Describes the result of uploading an image resource ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelFile.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelFile.md new file mode 100644 index 000000000000..adcde984f527 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelList.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelList.md new file mode 100644 index 000000000000..f93ab7dde8d4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelReturn.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelReturn.md new file mode 100644 index 000000000000..0bd356861eb7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Name.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Name.md new file mode 100644 index 000000000000..c901d9435309 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/NullableClass.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/NullableClass.md new file mode 100644 index 000000000000..ba2b7f38034e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **Date** | | [optional] | +|**datetimeProp** | **Date** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/NumberOnly.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/NumberOnly.md new file mode 100644 index 000000000000..b8ed1a4cfae1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..f1cf571f4c09 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Order.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Order.md index 7bfa42e6a902..4993c503e5f3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Order.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Order.md @@ -2,7 +2,6 @@ # Order -An order for a pets from the pet store ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterComposite.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterComposite.md new file mode 100644 index 000000000000..98b56e0763ff --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnum.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumInteger.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..0fafaaa27154 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ParentWithNullable.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ParentWithNullable.md new file mode 100644 index 000000000000..e4d322985632 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Pet.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Pet.md index 8bb363301232..54af77a9f5a7 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Pet.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Pet.md @@ -2,7 +2,6 @@ # Pet -A pet for sale in the pet store ## Properties @@ -11,7 +10,7 @@ A pet for sale in the pet store |**id** | **Long** | | [optional] | |**category** | [**Category**](Category.md) | | [optional] | |**name** | **String** | | | -|**photoUrls** | **List<String>** | | | +|**photoUrls** | **Set<String>** | | | |**tags** | [**List<Tag>**](Tag.md) | | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/PetApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/PetApi.md index fb5361b0808f..bf4b4333d964 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/PetApi.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/PetApi.md @@ -1,6 +1,6 @@ # PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -12,12 +12,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* | [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | | [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | | [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | ## addPet -> Pet addPet(pet) +> void addPet(pet) Add a new pet to the store @@ -37,7 +38,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -46,7 +47,7 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.addPet(pet); + void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -68,7 +69,7 @@ public class Example { ### Return type -[**Pet**](Pet.md) +[**void**](Void.md) ### Authorization @@ -77,13 +78,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Successful operation | - | | **405** | Invalid input | - | @@ -109,7 +110,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -157,6 +158,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | Successful operation | - | | **400** | Invalid pet value | - | @@ -182,7 +184,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -234,7 +236,7 @@ public class Example { ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,16 +256,16 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -281,11 +283,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **tags** | [**List<String>**](String.md)| Tags to filter by | | +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization @@ -326,7 +328,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -381,7 +383,7 @@ public class Example { ## updatePet -> Pet updatePet(pet) +> void updatePet(pet) Update an existing pet @@ -401,7 +403,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -410,7 +412,7 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.updatePet(pet); + void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -432,7 +434,7 @@ public class Example { ### Return type -[**Pet**](Pet.md) +[**void**](Void.md) ### Authorization @@ -441,13 +443,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -475,7 +477,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -525,6 +527,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | Successful operation | - | | **405** | Invalid input | - | @@ -550,7 +553,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -602,3 +605,78 @@ public class Example { |-------------|-------------|------------------| | **200** | successful operation | - | + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ReadOnlyFirst.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..ad6af7ee155f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/SingleRefType.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/SingleRefType.md new file mode 100644 index 000000000000..cc269bb871fd --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/SpecialModelName.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/SpecialModelName.md new file mode 100644 index 000000000000..4b6a06e36224 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/StoreApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/StoreApi.md index ae64b8574e22..7e03edf04b74 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/StoreApi.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/StoreApi.md @@ -1,12 +1,12 @@ # StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | | [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | -| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | | [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | @@ -32,7 +32,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); String orderId = "orderId_example"; // String | ID of the order that needs to be deleted @@ -100,7 +100,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -168,7 +168,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Long orderId = 56L; // Long | ID of pet that needs to be fetched @@ -236,7 +236,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Order order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Tag.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Tag.md index abfde4afb501..5088b2dd1c31 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Tag.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/Tag.md @@ -2,7 +2,6 @@ # Tag -A tag for a pet ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..dc066e6c7dac --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/User.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/User.md index 426845227bd3..08813e4b10b4 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/User.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/User.md @@ -2,7 +2,6 @@ # User -A User who is purchasing from the pet store ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/UserApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/UserApi.md index 89c1bfc6026d..d82f8da184b7 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/docs/UserApi.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -30,20 +30,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); User user = new User(); // User | Created user object @@ -74,7 +67,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -103,20 +96,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -147,7 +133,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -176,20 +162,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -220,7 +199,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -249,20 +228,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be deleted @@ -293,7 +265,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -329,7 +301,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. @@ -397,7 +369,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The user name for login @@ -441,7 +413,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| | **400** | Invalid username/password supplied | - | @@ -460,20 +432,13 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); try { @@ -500,7 +465,7 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -529,20 +494,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted @@ -575,7 +533,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml index 4a245c6749f7..d62c69aa7957 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml @@ -4,7 +4,7 @@ microprofile-rest-client-3 jar microprofile-rest-client-3 - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ 1.0.0 src/main/java @@ -160,7 +160,7 @@ 2.17.1 2.1.0 2.0.0 - 2.0.0 + 3.0.0 2.0.1 3.0.0 3.0.1 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..c22b045c6ed9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/another-fake/dummy") +public interface AnotherFakeApi { + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client call123testSpecialTags(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiException.java index 2fc6d04ee687..590cd07dc743 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiException.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiException.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java index 0dec2c6aec06..42895ef7d214 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..2c7f381b9336 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/foo") +public interface DefaultApi { + + @GET + + @Produces({ "application/json" }) + FooGetDefaultResponse fooGet() throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..c23faf8ba1b8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,237 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import java.util.Date; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake") +public interface FakeApi { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException, ProcessingException; + + /** + * Health check endpoint + * + */ + @GET + @Path("/health") + @Produces({ "application/json" }) + HealthCheckResult fakeHealthGet() throws ApiException, ProcessingException; + + /** + * test http signature authentication + * + */ + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + void fakeHttpSignatureTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException, ProcessingException; + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + String fakeOuterStringSerialize(String body) throws ApiException, ProcessingException; + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException, ProcessingException; + + /** + * test referenced additionalProperties + * + * + * + */ + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + void testAdditionalPropertiesReference(Map requestBody) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + void testBodyWithBinary(File body) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + void testBodyWithQueryParams(@QueryParam("query") String query, User user) throws ApiException, ProcessingException; + + /** + * To test \"client\" model + * + * To test \"client\" model + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClientModel(Client client) throws ApiException, ProcessingException; + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + */ + @POST + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary" , required = false) Attachment binaryDetail, @Multipart(value = "date", required = false) Date date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback) throws ApiException, ProcessingException; + + /** + * To test enum parameters + * + * To test enum parameters + * + */ + @GET + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString) throws ApiException, ProcessingException; + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + */ + @DELETE + + void testGroupParameters(@QueryParam("required_string_group") Integer requiredStringGroup, @HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, @QueryParam("required_int64_group") Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group) throws ApiException, ProcessingException; + + /** + * test inline additionalProperties + * + * + * + */ + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + void testInlineAdditionalProperties(Map requestBody) throws ApiException, ProcessingException; + + /** + * test inline free-form additionalProperties + * + * + * + */ + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException, ProcessingException; + + /** + * test json serialization of form data + * + * + * + */ + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "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 pipe, @QueryParam("ioutil") List ioutil, @QueryParam("http") List http, @QueryParam("url") List url, @QueryParam("context") List context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map language) throws ApiException, ProcessingException; + + /** + * test referenced string map + * + * + * + */ + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(Map requestBody) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..1db471b03658 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake_classname_test") +public interface FakeClassnameTags123Api { + + /** + * To test class name in snake case + * + * To test class name in snake case + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClassname(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/PetApi.java index d353688861ca..224b962916ed 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/PetApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -15,6 +15,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -33,13 +34,13 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ @RegisterRestClient(configKey="petstore") @RegisterProvider(ApiExceptionMapper.class) -@Path("/pet") +@Path("") public interface PetApi { /** @@ -49,10 +50,9 @@ public interface PetApi { * */ @POST - + @Path("/pet") @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - Pet addPet(Pet pet) throws ApiException, ProcessingException; + void addPet(Pet pet) throws ApiException, ProcessingException; /** * Deletes a pet @@ -61,7 +61,7 @@ public interface PetApi { * */ @DELETE - @Path("/{petId}") + @Path("/pet/{petId}") void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; /** @@ -71,7 +71,7 @@ public interface PetApi { * */ @GET - @Path("/findByStatus") + @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) List findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; @@ -84,9 +84,9 @@ public interface PetApi { */ @Deprecated @GET - @Path("/findByTags") + @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - List findPetsByTags(@QueryParam("tags") List tags) throws ApiException, ProcessingException; + Set findPetsByTags(@QueryParam("tags") Set tags) throws ApiException, ProcessingException; /** * Find pet by ID @@ -95,7 +95,7 @@ public interface PetApi { * */ @GET - @Path("/{petId}") + @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) Pet getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; @@ -106,10 +106,9 @@ public interface PetApi { * */ @PUT - + @Path("/pet") @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - Pet updatePet(Pet pet) throws ApiException, ProcessingException; + void updatePet(Pet pet) throws ApiException, ProcessingException; /** * Updates a pet in the store with form data @@ -118,7 +117,7 @@ public interface PetApi { * */ @POST - @Path("/{petId}") + @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException; @@ -129,8 +128,20 @@ public interface PetApi { * */ @POST - @Path("/{petId}/uploadImage") + @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException; + + /** + * uploads an image (required) + * + * + * + */ + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @Multipart(value = "requiredFile" ) Attachment requiredFileDetail, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata) throws ApiException, ProcessingException; } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/StoreApi.java index cd94c5b3bca6..0fdf70e0825b 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/StoreApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -31,7 +31,7 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ @@ -47,8 +47,8 @@ public interface StoreApi { * */ @DELETE - @Path("/order/{orderId}") - void deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException; + @Path("/order/{order_id}") + void deleteOrder(@PathParam("order_id") String orderId) throws ApiException, ProcessingException; /** * Returns pet inventories by status @@ -68,9 +68,9 @@ public interface StoreApi { * */ @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - Order getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException; + Order getOrderById(@PathParam("order_id") Long orderId) throws ApiException, ProcessingException; /** * Place an order for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/UserApi.java index 7f8c13c9e080..515c42ae977d 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -32,7 +32,7 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..14f3cad2e83c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,142 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class AdditionalPropertiesClass { + + @JsonbProperty("map_property") + private Map mapProperty = null; + + @JsonbProperty("map_of_map_property") + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + */ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + */ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..bc4870ebb9d0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,125 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.SingleRefType; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class AllOfWithSingleRef { + + @JsonbProperty("username") + private String username; + + @JsonbProperty("SingleRefType") + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + */ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + */ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..b35b06484d03 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +@JsonbTypeInfo(key = "className", value = { + @JsonbSubtype(alias = "CAT", type = Cat.class), + @JsonbSubtype(alias = "DOG", type = Dog.class), +}) +public class Animal { + + @JsonbTransient + private String className; + + @JsonbProperty("color") + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + /** + * Set className + */ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + */ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..b9f65c9f2a17 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,111 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class ArrayOfArrayOfNumberOnly { + + @JsonbProperty("ArrayArrayNumber") + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + */ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..cfada48cfc9a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,111 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class ArrayOfNumberOnly { + + @JsonbProperty("ArrayNumber") + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + */ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..1b17f1643d7a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,177 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class ArrayTest { + + @JsonbProperty("array_of_string") + private List arrayOfString = null; + + @JsonbProperty("array_array_of_integer") + private List> arrayArrayOfInteger = null; + + @JsonbProperty("array_array_of_model") + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + */ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + */ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + */ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..abf9cf2243b8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,227 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class Capitalization { + + @JsonbProperty("smallCamel") + private String smallCamel; + + @JsonbProperty("CapitalCamel") + private String capitalCamel; + + @JsonbProperty("small_Snake") + private String smallSnake; + + @JsonbProperty("Capital_Snake") + private String capitalSnake; + + @JsonbProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints; + + /** + * Name of the pet + */ + @JsonbProperty("ATT_NAME") + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + */ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + */ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + */ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + */ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + */ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + */ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..8544e1850fc9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,101 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.Animal; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +@JsonbTypeInfo(key = "className") +public class Cat extends Animal { + + @JsonbProperty("declawed") + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + */ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java index d7d5dca2bc60..08a19fdd00f4 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,11 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; -/** - * A category for a pet - */ public class Category { @@ -35,7 +36,7 @@ public class Category { private Long id; @JsonbProperty("name") - private String name; + private String name = "default-name"; /** * Get id diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 000000000000..0bf4b66fe46b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,101 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.ParentWithNullable; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +@JsonbTypeInfo(key = "type") +public class ChildWithNullable extends ParentWithNullable { + + @JsonbProperty("otherProperty") + private String otherProperty; + + /** + * Get otherProperty + * @return otherProperty + **/ + public String getOtherProperty() { + return otherProperty; + } + + /** + * Set otherProperty + */ + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..5ee047f40539 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +/** + * Model for testing model with \"_class\" property + */ + +public class ClassModel { + + @JsonbProperty("_class") + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + */ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..864f08d8edac --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class Client { + + @JsonbProperty("client") + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + */ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 000000000000..aab14a4f44d1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class DeprecatedObject { + + @JsonbProperty("name") + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..c477ed0159fa --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,101 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.Animal; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +@JsonbTypeInfo(key = "className") +public class Dog extends Animal { + + @JsonbProperty("breed") + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + */ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..2fffb41be6e0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,219 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class EnumArrays { + + @JsonbTypeSerializer(JustSymbolEnum.Serializer.class) + @JsonbTypeDeserializer(JustSymbolEnum.Deserializer.class) + public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public JustSymbolEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(JustSymbolEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("just_symbol") + private JustSymbolEnum justSymbol; + + @JsonbTypeSerializer(ArrayEnumEnum.Serializer.class) + @JsonbTypeDeserializer(ArrayEnumEnum.Deserializer.class) + public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public ArrayEnumEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(ArrayEnumEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("array_enum") + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + */ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + */ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..e6c6539427aa --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets EnumClass + */ +@JsonbTypeSerializer(EnumClass.Serializer.class) +@JsonbTypeDeserializer(EnumClass.Deserializer.class) +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumClass deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumClass obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..90a4b5150488 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,446 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class EnumTest { + + @JsonbTypeSerializer(EnumStringEnum.Serializer.class) + @JsonbTypeDeserializer(EnumStringEnum.Deserializer.class) + public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumStringEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumStringEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_string") + private EnumStringEnum enumString; + + @JsonbTypeSerializer(EnumStringRequiredEnum.Serializer.class) + @JsonbTypeDeserializer(EnumStringRequiredEnum.Deserializer.class) + public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumStringRequiredEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumStringRequiredEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired; + + @JsonbTypeSerializer(EnumIntegerEnum.Serializer.class) + @JsonbTypeDeserializer(EnumIntegerEnum.Deserializer.class) + public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumIntegerEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumIntegerEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_integer") + private EnumIntegerEnum enumInteger; + + @JsonbTypeSerializer(EnumNumberEnum.Serializer.class) + @JsonbTypeDeserializer(EnumNumberEnum.Deserializer.class) + public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumNumberEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumNumberEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_number") + private EnumNumberEnum enumNumber; + + @JsonbProperty("outerEnum") + private OuterEnum outerEnum; + + @JsonbProperty("outerEnumInteger") + private OuterEnumInteger outerEnumInteger; + + @JsonbProperty("outerEnumDefaultValue") + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + @JsonbProperty("outerEnumIntegerDefaultValue") + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + */ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + */ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + */ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + */ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + */ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + */ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + */ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + */ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..e7cb4ce57392 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,135 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class FakeBigDecimalMap200Response { + + @JsonbProperty("someId") + private BigDecimal someId; + + @JsonbProperty("someMap") + private Map someMap = null; + + /** + * Get someId + * @return someId + **/ + public BigDecimal getSomeId() { + return someId; + } + + /** + * Set someId + */ + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someMap + * @return someMap + **/ + public Map getSomeMap() { + return someMap; + } + + /** + * Set someMap + */ + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..0c125fffb384 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,136 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class FileSchemaTestClass { + + @JsonbProperty("file") + private ModelFile _file; + + @JsonbProperty("files") + private List files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + */ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List getFiles() { + return files; + } + + /** + * Set files + */ + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..993bbd2a6f56 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class Foo { + + @JsonbProperty("bar") + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + */ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..0f1b9946bf54 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,100 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.Foo; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class FooGetDefaultResponse { + + @JsonbProperty("string") + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + */ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..0a28a8ffb143 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,494 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class FormatTest { + + @JsonbProperty("integer") + private Integer integer; + + @JsonbProperty("int32") + private Integer int32; + + @JsonbProperty("int64") + private Long int64; + + @JsonbProperty("number") + private BigDecimal number; + + @JsonbProperty("float") + private Float _float; + + @JsonbProperty("double") + private Double _double; + + @JsonbProperty("decimal") + private BigDecimal decimal; + + @JsonbProperty("string") + private String string; + + @JsonbProperty("byte") + private byte[] _byte; + + @JsonbProperty("binary") + private File binary; + + @JsonbProperty("date") + private Date date; + + @JsonbProperty("dateTime") + private Date dateTime; + + @JsonbProperty("uuid") + private UUID uuid; + + @JsonbProperty("password") + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + */ + @JsonbProperty("pattern_with_digits") + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + @JsonbProperty("pattern_with_digits_and_delimiter") + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + /** + * Set integer + */ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + /** + * Set int32 + */ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + */ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + /** + * Set number + */ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + /** + * Set _float + */ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + /** + * Set _double + */ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + */ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + /** + * Set string + */ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + */ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + */ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public Date getDate() { + return date; + } + + /** + * Set date + */ + public void setDate(Date date) { + this.date = date; + } + + public FormatTest date(Date date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public Date getDateTime() { + return dateTime; + } + + /** + * Set dateTime + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + */ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + */ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + */ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + */ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..a0acef63f83a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,114 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class HasOnlyReadOnly { + + @JsonbProperty("bar") + private String bar; + + @JsonbProperty("foo") + private String foo; + + public HasOnlyReadOnly() { + } + + @JsonbCreator + public HasOnlyReadOnly( + @JsonbProperty(value = "bar", nillable = true) String bar, + @JsonbProperty(value = "foo", nillable = true) String foo + ) { + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..2d31a84671a7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ + +public class HealthCheckResult { + + @JsonbProperty("NullableMessage") + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + */ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..a72e26d96327 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,250 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class MapTest { + + @JsonbProperty("map_map_of_string") + private Map> mapMapOfString = null; + + @JsonbTypeSerializer(InnerEnum.Serializer.class) + @JsonbTypeDeserializer(InnerEnum.Deserializer.class) + public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public InnerEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(InnerEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("map_of_enum_string") + private Map mapOfEnumString = null; + + @JsonbProperty("direct_map") + private Map directMap = null; + + @JsonbProperty("indirect_map") + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + */ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + */ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + */ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + */ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..514f7b526a01 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,162 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + @JsonbProperty("uuid") + private UUID uuid; + + @JsonbProperty("dateTime") + private Date dateTime; + + @JsonbProperty("map") + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + */ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public Date getDateTime() { + return dateTime; + } + + /** + * Set dateTime + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + */ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..3df24e0a6e3e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +/** + * Model for testing model name starting with number + */ + +public class Model200Response { + + @JsonbProperty("name") + private Integer name; + + @JsonbProperty("class") + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + */ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + */ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2791024ba294..e7e28fc9d241 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,11 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; -/** - * Describes the result of uploading an image resource - */ public class ModelApiResponse { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..f20227a239d0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +/** + * Must be named `File` for test. + */ + +public class ModelFile { + + /** + * Test capitalization + */ + @JsonbProperty("sourceURI") + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + */ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..59088b385b2b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class ModelList { + + @JsonbProperty("123-list") + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + */ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..13c0976d0d2e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +/** + * Model for testing reserved words + */ + +public class ModelReturn { + + @JsonbProperty("return") + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + */ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..03554c24af52 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,167 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +/** + * Model for testing model name same as property name + */ + +public class Name { + + @JsonbProperty("name") + private Integer name; + + @JsonbProperty("snake_case") + private Integer snakeCase; + + @JsonbProperty("property") + private String property; + + @JsonbProperty("123Number") + private Integer _123number; + + public Name() { + } + + @JsonbCreator + public Name( + @JsonbProperty(value = "snake_case", nillable = true) Integer snakeCase, + @JsonbProperty(value = "123Number", nillable = true) Integer _123number + ) { + this.snakeCase = snakeCase; + this._123number = _123number; + } + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + */ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + */ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..1203f4749cd9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,430 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class NullableClass extends HashMap { + + @JsonbProperty("integer_prop") + private Integer integerProp; + + @JsonbProperty("number_prop") + private BigDecimal numberProp; + + @JsonbProperty("boolean_prop") + private Boolean booleanProp; + + @JsonbProperty("string_prop") + private String stringProp; + + @JsonbProperty("date_prop") + private Date dateProp; + + @JsonbProperty("datetime_prop") + private Date datetimeProp; + + @JsonbProperty("array_nullable_prop") + private List arrayNullableProp = null; + + @JsonbProperty("array_and_items_nullable_prop") + private List arrayAndItemsNullableProp = null; + + @JsonbProperty("array_items_nullable") + private List arrayItemsNullable = null; + + @JsonbProperty("object_nullable_prop") + private Map objectNullableProp = null; + + @JsonbProperty("object_and_items_nullable_prop") + private Map objectAndItemsNullableProp = null; + + @JsonbProperty("object_items_nullable") + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + */ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + */ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + */ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + */ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public Date getDateProp() { + return dateProp; + } + + /** + * Set dateProp + */ + public void setDateProp(Date dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(Date dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public Date getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + */ + public void setDatetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + */ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + */ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + */ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + */ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + */ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + */ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..36bf4b2fcc91 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,100 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class NumberOnly { + + @JsonbProperty("JustNumber") + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + */ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..d78f2b5d9b79 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,193 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class ObjectWithDeprecatedFields { + + @JsonbProperty("uuid") + private String uuid; + + @JsonbProperty("id") + private BigDecimal id; + + @JsonbProperty("deprecatedRef") + private DeprecatedObject deprecatedRef; + + @JsonbProperty("bars") + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + */ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + */ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + */ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + */ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java index d7e654ce3a9e..5a3f97ede37b 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -25,10 +25,11 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; -/** - * An order for a pets from the pet store - */ public class Order { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..f206e7d341b5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,150 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class OuterComposite { + + @JsonbProperty("my_number") + private BigDecimal myNumber; + + @JsonbProperty("my_string") + private String myString; + + @JsonbProperty("my_boolean") + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + */ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + */ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + */ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..a9b470bc3799 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnum + */ +@JsonbTypeSerializer(OuterEnum.Serializer.class) +@JsonbTypeDeserializer(OuterEnum.Deserializer.class) +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..1bd09711b215 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnumDefaultValue + */ +@JsonbTypeSerializer(OuterEnumDefaultValue.Serializer.class) +@JsonbTypeDeserializer(OuterEnumDefaultValue.Deserializer.class) +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnumDefaultValue deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnumDefaultValue obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..9b439f909bea --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnumInteger + */ +@JsonbTypeSerializer(OuterEnumInteger.Serializer.class) +@JsonbTypeDeserializer(OuterEnumInteger.Deserializer.class) +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnumInteger deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnumInteger obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..7c27c2664805 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +@JsonbTypeSerializer(OuterEnumIntegerDefaultValue.Serializer.class) +@JsonbTypeDeserializer(OuterEnumIntegerDefaultValue.Deserializer.class) +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnumIntegerDefaultValue deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnumIntegerDefaultValue obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..5d174aeb8f22 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,100 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.OuterEnumInteger; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class OuterObjectWithEnumProperty { + + @JsonbProperty("value") + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + */ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 000000000000..5908510fdb9c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -0,0 +1,168 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + +@JsonbTypeInfo(key = "type", value = { + @JsonbSubtype(alias = "ChildWithNullable", type = ChildWithNullable.class), +}) +public class ParentWithNullable { + + @JsonbTypeSerializer(TypeEnum.Serializer.class) + @JsonbTypeDeserializer(TypeEnum.Deserializer.class) + public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + + String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public TypeEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(TypeEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbTransient + private TypeEnum type; + + @JsonbProperty("nullableProperty") + private String nullableProperty; + + /** + * Get type + * @return type + **/ + public TypeEnum getType() { + return type; + } + + /** + * Set type + */ + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set nullableProperty + */ + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + Objects.equals(this.nullableProperty, parentWithNullable.nullableProperty); + } + + @Override + public int hashCode() { + return Objects.hash(type, nullableProperty); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java index d2b51d9db1cb..89186a67e942 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -16,7 +16,9 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import java.lang.reflect.Type; @@ -29,10 +31,11 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; -/** - * A pet for sale in the pet store - */ public class Pet { @@ -46,7 +49,7 @@ public class Pet { private String name; @JsonbProperty("photoUrls") - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonbProperty("tags") private List tags = null; @@ -163,25 +166,25 @@ public Pet name(String name) { * Get photoUrls * @return photoUrls **/ - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } /** * Set photoUrls */ - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new ArrayList<>(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); return this; @@ -218,9 +221,7 @@ public Pet addTagsItem(Tag tagsItem) { /** * pet status in the store * @return status - * @deprecated **/ - @Deprecated public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..05ee12b1e4d1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class ReadOnlyFirst { + + @JsonbProperty("bar") + private String bar; + + @JsonbProperty("baz") + private String baz; + + public ReadOnlyFirst() { + } + + @JsonbCreator + public ReadOnlyFirst( + @JsonbProperty(value = "bar", nillable = true) String bar + ) { + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + */ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 000000000000..d64747ac30b7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,78 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets SingleRefType + */ +@JsonbTypeSerializer(SingleRefType.Serializer.class) +@JsonbTypeDeserializer(SingleRefType.Deserializer.class) +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public SingleRefType deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(SingleRefType obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..b4475eaebe58 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class SpecialModelName { + + @JsonbProperty("$special[property.name]") + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + */ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java index 1317a25b1776..5bbbbcda804d 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,11 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; -/** - * A tag for a pet - */ public class Tag { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..b2375404c813 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + @JsonbProperty("someProperty") + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + */ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java index d717a4bd3219..426d7d7f0e50 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,11 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; -/** - * A User who is purchasing from the pet store - */ public class User { diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..0941a798c10f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() { + // TODO: test validations + Client client = null; + //Client response = api.call123testSpecialTags(client); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..f4e1951dc156 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private DefaultApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() { + // TODO: test validations + //FooGetDefaultResponse response = api.fooGet(); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..26ec6bf6711c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,446 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import java.util.Date; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeApi + */ +public class FakeApiTest { + + private FakeApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeBigDecimalMapTest() { + // TODO: test validations + //FakeBigDecimalMap200Response response = api.fakeBigDecimalMap(); + //Assertions.assertNotNull(response); + + + } + + /** + * Health check endpoint + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() { + // TODO: test validations + //HealthCheckResult response = api.fakeHealthGet(); + //Assertions.assertNotNull(response); + + + } + + /** + * test http signature authentication + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHttpSignatureTestTest() { + // TODO: test validations + Pet pet = null; + String query1 = null; + String header1 = null; + //api.fakeHttpSignatureTest(pet, query1, header1); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() { + // TODO: test validations + Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() { + // TODO: test validations + OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() { + // TODO: test validations + BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() { + // TODO: test validations + String body = null; + //String response = api.fakeOuterStringSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() { + // TODO: test validations + OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + //OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + //Assertions.assertNotNull(response); + + + } + + /** + * test referenced additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // TODO: test validations + Map requestBody = null; + //api.testAdditionalPropertiesReference(requestBody); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithBinaryTest() { + // TODO: test validations + org.apache.cxf.jaxrs.ext.multipart.Attachment body = null; + //api.testBodyWithBinary(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() { + // TODO: test validations + FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() { + // TODO: test validations + String query = null; + User user = null; + //api.testBodyWithQueryParams(query, user); + //Assertions.assertNotNull(response); + + + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() { + // TODO: test validations + Client client = null; + //Client response = api.testClientModel(client); + //Assertions.assertNotNull(response); + + + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() { + // TODO: test validations + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment binary = null; + Date date = null; + Date dateTime = null; + String password = null; + String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //Assertions.assertNotNull(response); + + + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() { + // TODO: test validations + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumQueryModelArray = null; + List enumFormStringArray = null; + String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + //Assertions.assertNotNull(response); + + + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() { + // TODO: test validations + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + //Assertions.assertNotNull(response); + + + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + // TODO: test validations + Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody); + //Assertions.assertNotNull(response); + + + } + + /** + * test inline free-form additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // TODO: test validations + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + //api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //Assertions.assertNotNull(response); + + + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() { + // TODO: test validations + String param = null; + String param2 = null; + //api.testJsonFormData(param, param2); + //Assertions.assertNotNull(response); + + + } + + /** + * test nullable parent property + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testNullableTest() { + // TODO: test validations + ChildWithNullable childWithNullable = null; + //api.testNullable(childWithNullable); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() { + // TODO: test validations + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + String allowEmpty = null; + Map language = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + //Assertions.assertNotNull(response); + + + } + + /** + * test referenced string map + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testStringMapReferenceTest() { + // TODO: test validations + Map requestBody = null; + //api.testStringMapReference(requestBody); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..ada30ee8f95e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private FakeClassnameTags123Api client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() { + // TODO: test validations + Client client = null; + //Client response = api.testClassname(client); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..c33042cf8e79 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..ba32c589b850 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.SingleRefType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..bf91c4a20f02 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..4a72072e65eb --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..8f6a0038a230 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..0f7d0d93ee74 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,62 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..cc892e34a39c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..c67c1b01b9c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java index d0568f977669..caf668f224c5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..52ee57ee7635 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.ParentWithNullable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..2b5a94e3abd1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..631cd9ec97f2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..f910877f265d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..06550b080eaa --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..5a4482a48e5b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,53 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..1b428fce8da4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..e88f4913fac3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..bf85a56f9cb5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,53 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..574f81629d27 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..db0cbf8b71da --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.Foo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..85be29d44852 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..73dab4e2d947 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,166 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..905c931aab50 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..6d6129521201 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..c1bc74afd090 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..0aab1ece1a9e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..9a31cadf7209 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index ddfa78c4ac31..45e942fad1a3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..88a8d0d8f902 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..15f4af11ddbf --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..40aa9479d1b4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..fbe1d4d6c03b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..2dc4edf27b40 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..399dec94c676 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..360689566a28 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,71 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java index 0d23109bd825..d7c9bb66162b 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..7a906cb31cd7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..e492f3e0ff6f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..d72626405cc5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..b7dd55cda628 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..1116901010b0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..f773156fb5e5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.OuterEnumInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..e2a5a37b6cbb --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java index e939e3b1d45a..89a08d731f6a 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -15,7 +15,9 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import org.junit.jupiter.api.Assertions; diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..b3205f147207 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..210c2a450379 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..07c9acddd158 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java index 5131a8a3e889..cfbaea84bddf 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..011ed8b26d49 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,44 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java index d0d84b127052..7065b494b841 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java index 5a53099479ee..dbfb7aa3cd86 100644 --- a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java @@ -24,6 +24,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** * A category for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 6926a2e2270f..f2058433f57f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -24,6 +24,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** * Describes the result of uploading an image resource diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java index 4f743c78a6c8..2ca6b66700ff 100644 --- a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java @@ -25,6 +25,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** * An order for a pets from the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java index 03b5f5cd88f6..fc10762ad1d2 100644 --- a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java @@ -29,6 +29,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java index 5bb307506c92..a15e2acf85a9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java @@ -24,6 +24,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** * A tag for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java index 1542e3dfc587..c59ea245f6f9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java @@ -24,6 +24,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** * A User who is purchasing from the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java index 1b03fa72cdd7..1166644d5660 100644 --- a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java @@ -25,6 +25,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; public class Cat { diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java index 7eb427a23a31..255f4ee9ea3a 100644 --- a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java @@ -25,6 +25,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; public class Dog { diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java index 7d56e2588283..f75b74510be9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java @@ -24,6 +24,7 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; /** diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml index 3e687e538331..ec0b6c7eb2bf 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml @@ -160,7 +160,7 @@ 2.17.1 2.1.0 2.0.0 - 2.0.0 + 3.0.0 2.0.1 3.0.0 3.0.1 diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java index d7d5dca2bc60..6effb8514c2f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A category for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2791024ba294..fc1400696257 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * Describes the result of uploading an image resource diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java index d7e654ce3a9e..06c78288e181 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java @@ -25,6 +25,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * An order for a pets from the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java index d2b51d9db1cb..28dd90e2ebd4 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java @@ -29,6 +29,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java index 1317a25b1776..a12166bacceb 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A tag for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java index d717a4bd3219..f66763660060 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java @@ -24,6 +24,10 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import jakarta.json.bind.annotation.JsonbProperty; +import jakarta.json.bind.annotation.JsonbSubtype; +import jakarta.json.bind.annotation.JsonbTransient; +import jakarta.json.bind.annotation.JsonbTypeInfo; +import jakarta.json.bind.annotation.JsonbCreator; /** * A User who is purchasing from the pet store diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES index ae145903e52b..c2568cfe3018 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES @@ -1,22 +1,118 @@ README.md +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md docs/Pet.md docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md pom.xml +src/main/java/org/openapitools/client/api/AnotherFakeApi.java src/main/java/org/openapitools/client/api/ApiException.java src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java src/main/java/org/openapitools/client/api/PetApi.java src/main/java/org/openapitools/client/api/StoreApi.java src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +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 +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +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 +src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/microprofile-rest-client/README.md b/samples/client/petstore/java/microprofile-rest-client/README.md index 4c3e40a34b5c..1cb837096230 100644 --- a/samples/client/petstore/java/microprofile-rest-client/README.md +++ b/samples/client/petstore/java/microprofile-rest-client/README.md @@ -1,6 +1,6 @@ # OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/microprofile-rest-client/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..fe69a56eebf4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/microprofile-rest-client/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4146d56a372b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Animal.md b/samples/client/petstore/java/microprofile-rest-client/docs/Animal.md new file mode 100644 index 000000000000..d9b32f14c88a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/AnotherFakeApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..73c966d2d549 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/AnotherFakeApi.md @@ -0,0 +1,75 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..0188db3eb131 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..a5753530aada --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ArrayTest.md b/samples/client/petstore/java/microprofile-rest-client/docs/ArrayTest.md new file mode 100644 index 000000000000..36077c9df300 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Capitalization.md b/samples/client/petstore/java/microprofile-rest-client/docs/Capitalization.md new file mode 100644 index 000000000000..82a812711de2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Cat.md b/samples/client/petstore/java/microprofile-rest-client/docs/Cat.md new file mode 100644 index 000000000000..390dd519c8ce --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Category.md b/samples/client/petstore/java/microprofile-rest-client/docs/Category.md index a7fc939d252e..ab6d1ec334dc 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/Category.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Category.md @@ -2,14 +2,13 @@ # Category -A category for a pet ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **Long** | | [optional] | -|**name** | **String** | | [optional] | +|**name** | **String** | | | diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ChildWithNullable.md b/samples/client/petstore/java/microprofile-rest-client/docs/ChildWithNullable.md new file mode 100644 index 000000000000..73c0dd6d4737 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ClassModel.md b/samples/client/petstore/java/microprofile-rest-client/docs/ClassModel.md new file mode 100644 index 000000000000..af46dea1f6c8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Client.md b/samples/client/petstore/java/microprofile-rest-client/docs/Client.md new file mode 100644 index 000000000000..ef07b4ab8b9d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/DefaultApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/DefaultApi.md new file mode 100644 index 000000000000..3b2c1dbda173 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/DefaultApi.md @@ -0,0 +1,69 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | response | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/DeprecatedObject.md b/samples/client/petstore/java/microprofile-rest-client/docs/DeprecatedObject.md new file mode 100644 index 000000000000..48de1d624425 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Dog.md b/samples/client/petstore/java/microprofile-rest-client/docs/Dog.md new file mode 100644 index 000000000000..972c981c0d05 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/EnumArrays.md b/samples/client/petstore/java/microprofile-rest-client/docs/EnumArrays.md new file mode 100644 index 000000000000..b2222d5beb25 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/EnumClass.md b/samples/client/petstore/java/microprofile-rest-client/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/EnumTest.md b/samples/client/petstore/java/microprofile-rest-client/docs/EnumTest.md new file mode 100644 index 000000000000..380a2aef0bc3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/FakeApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/FakeApi.md new file mode 100644 index 000000000000..02df4858d16b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/FakeApi.md @@ -0,0 +1,1555 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form 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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> void fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + void result = apiInstance.fakeHttpSignatureTest(pet, query1, header1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterObjectWithEnumProperty outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body + try { + OuterObjectWithEnumProperty result = apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakePropertyEnumIntegerSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testAdditionalPropertiesReference + +> void testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + void result = apiInstance.testAdditionalPropertiesReference(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.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 | - | + + +## testBodyWithBinary + +> void testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + File body = new File("/path/to/file"); // File | image to upload + try { + void result = apiInstance.testBodyWithBinary(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> void testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + void result = apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### 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** | Success | - | + + +## testBodyWithQueryParams + +> void testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + void result = apiInstance.testBodyWithQueryParams(query, user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### 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** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + Date date = new Date(); // Date | None + Date dateTime = new Date(); // Date | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **Date**| None | [optional] | +| **dateTime** | **Date**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> void testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumQueryModelArray = Arrays.asList(-efg); // List | + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + void result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> void testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + void result = apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + +## testInlineAdditionalProperties + +> void testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + void result = apiInstance.testInlineAdditionalProperties(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + + +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + void result = apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 | - | + + +## testJsonFormData + +> void testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + void result = apiInstance.testJsonFormData(param, param2); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testNullable + +> void testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body + try { + void result = apiInstance.testNullable(childWithNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testNullable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### 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) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | + Map language = new HashMap(); // Map | + try { + void result = apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + void result = apiInstance.testStringMapReference(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java/microprofile-rest-client/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..475be1d2d738 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/microprofile-rest-client/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..e4ff70ed909b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/FakeClassnameTags123Api.md @@ -0,0 +1,82 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/FileSchemaTestClass.md b/samples/client/petstore/java/microprofile-rest-client/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..85d1a0636694 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Foo.md b/samples/client/petstore/java/microprofile-rest-client/docs/Foo.md new file mode 100644 index 000000000000..6b3f0556528a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/FooGetDefaultResponse.md b/samples/client/petstore/java/microprofile-rest-client/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..ff3d7a3a56c3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/FormatTest.md b/samples/client/petstore/java/microprofile-rest-client/docs/FormatTest.md new file mode 100644 index 000000000000..d5b492c6e4ec --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **Date** | | | +|**dateTime** | **Date** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/microprofile-rest-client/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..29da5205dbba --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/HealthCheckResult.md b/samples/client/petstore/java/microprofile-rest-client/docs/HealthCheckResult.md new file mode 100644 index 000000000000..4885e6f1cada --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/MapTest.md b/samples/client/petstore/java/microprofile-rest-client/docs/MapTest.md new file mode 100644 index 000000000000..54380188e1d6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/microprofile-rest-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..f9867c07e7c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **Date** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Model200Response.md b/samples/client/petstore/java/microprofile-rest-client/docs/Model200Response.md new file mode 100644 index 000000000000..109411580c62 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ModelApiResponse.md b/samples/client/petstore/java/microprofile-rest-client/docs/ModelApiResponse.md index cd7e3c400be6..e374c2dd2dec 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ModelApiResponse.md @@ -2,7 +2,6 @@ # ModelApiResponse -Describes the result of uploading an image resource ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ModelFile.md b/samples/client/petstore/java/microprofile-rest-client/docs/ModelFile.md new file mode 100644 index 000000000000..adcde984f527 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ModelList.md b/samples/client/petstore/java/microprofile-rest-client/docs/ModelList.md new file mode 100644 index 000000000000..f93ab7dde8d4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ModelReturn.md b/samples/client/petstore/java/microprofile-rest-client/docs/ModelReturn.md new file mode 100644 index 000000000000..0bd356861eb7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Name.md b/samples/client/petstore/java/microprofile-rest-client/docs/Name.md new file mode 100644 index 000000000000..c901d9435309 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/NullableClass.md b/samples/client/petstore/java/microprofile-rest-client/docs/NullableClass.md new file mode 100644 index 000000000000..ba2b7f38034e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **Date** | | [optional] | +|**datetimeProp** | **Date** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/NumberOnly.md b/samples/client/petstore/java/microprofile-rest-client/docs/NumberOnly.md new file mode 100644 index 000000000000..b8ed1a4cfae1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/microprofile-rest-client/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..f1cf571f4c09 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Order.md b/samples/client/petstore/java/microprofile-rest-client/docs/Order.md index 7bfa42e6a902..4993c503e5f3 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/Order.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Order.md @@ -2,7 +2,6 @@ # Order -An order for a pets from the pet store ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/OuterComposite.md b/samples/client/petstore/java/microprofile-rest-client/docs/OuterComposite.md new file mode 100644 index 000000000000..98b56e0763ff --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnum.md b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumInteger.md b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java/microprofile-rest-client/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..0fafaaa27154 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ParentWithNullable.md b/samples/client/petstore/java/microprofile-rest-client/docs/ParentWithNullable.md new file mode 100644 index 000000000000..e4d322985632 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Pet.md b/samples/client/petstore/java/microprofile-rest-client/docs/Pet.md index 8bb363301232..54af77a9f5a7 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/Pet.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Pet.md @@ -2,7 +2,6 @@ # Pet -A pet for sale in the pet store ## Properties @@ -11,7 +10,7 @@ A pet for sale in the pet store |**id** | **Long** | | [optional] | |**category** | [**Category**](Category.md) | | [optional] | |**name** | **String** | | | -|**photoUrls** | **List<String>** | | | +|**photoUrls** | **Set<String>** | | | |**tags** | [**List<Tag>**](Tag.md) | | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md index fb5361b0808f..bf4b4333d964 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md @@ -1,6 +1,6 @@ # PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -12,12 +12,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* | [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | | [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | | [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | ## addPet -> Pet addPet(pet) +> void addPet(pet) Add a new pet to the store @@ -37,7 +38,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -46,7 +47,7 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.addPet(pet); + void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -68,7 +69,7 @@ public class Example { ### Return type -[**Pet**](Pet.md) +[**void**](Void.md) ### Authorization @@ -77,13 +78,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Successful operation | - | | **405** | Invalid input | - | @@ -109,7 +110,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -157,6 +158,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | Successful operation | - | | **400** | Invalid pet value | - | @@ -182,7 +184,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -234,7 +236,7 @@ public class Example { ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,16 +256,16 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -281,11 +283,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **tags** | [**List<String>**](String.md)| Tags to filter by | | +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization @@ -326,7 +328,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -381,7 +383,7 @@ public class Example { ## updatePet -> Pet updatePet(pet) +> void updatePet(pet) Update an existing pet @@ -401,7 +403,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -410,7 +412,7 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.updatePet(pet); + void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -432,7 +434,7 @@ public class Example { ### Return type -[**Pet**](Pet.md) +[**void**](Void.md) ### Authorization @@ -441,13 +443,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -475,7 +477,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -525,6 +527,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | Successful operation | - | | **405** | Invalid input | - | @@ -550,7 +553,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -602,3 +605,78 @@ public class Example { |-------------|-------------|------------------| | **200** | successful operation | - | + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/ReadOnlyFirst.md b/samples/client/petstore/java/microprofile-rest-client/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..ad6af7ee155f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/SingleRefType.md b/samples/client/petstore/java/microprofile-rest-client/docs/SingleRefType.md new file mode 100644 index 000000000000..cc269bb871fd --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/SpecialModelName.md b/samples/client/petstore/java/microprofile-rest-client/docs/SpecialModelName.md new file mode 100644 index 000000000000..4b6a06e36224 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md index ae64b8574e22..7e03edf04b74 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md @@ -1,12 +1,12 @@ # StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | | [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | -| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | | [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | @@ -32,7 +32,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); String orderId = "orderId_example"; // String | ID of the order that needs to be deleted @@ -100,7 +100,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -168,7 +168,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Long orderId = 56L; // Long | ID of pet that needs to be fetched @@ -236,7 +236,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Order order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/Tag.md b/samples/client/petstore/java/microprofile-rest-client/docs/Tag.md index abfde4afb501..5088b2dd1c31 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/Tag.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/Tag.md @@ -2,7 +2,6 @@ # Tag -A tag for a pet ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/microprofile-rest-client/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..dc066e6c7dac --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/User.md b/samples/client/petstore/java/microprofile-rest-client/docs/User.md index 426845227bd3..08813e4b10b4 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/User.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/User.md @@ -2,7 +2,6 @@ # User -A User who is purchasing from the pet store ## Properties diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md index 89c1bfc6026d..d82f8da184b7 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -30,20 +30,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); User user = new User(); // User | Created user object @@ -74,7 +67,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -103,20 +96,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -147,7 +133,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -176,20 +162,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -220,7 +199,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -249,20 +228,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be deleted @@ -293,7 +265,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -329,7 +301,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. @@ -397,7 +369,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The user name for login @@ -441,7 +413,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| | **400** | Invalid username/password supplied | - | @@ -460,20 +432,13 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); try { @@ -500,7 +465,7 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -529,20 +494,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted @@ -575,7 +533,7 @@ public class Example { ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers diff --git a/samples/client/petstore/java/microprofile-rest-client/pom.xml b/samples/client/petstore/java/microprofile-rest-client/pom.xml index 6dee8d3a89b6..f3bb0cf3c400 100644 --- a/samples/client/petstore/java/microprofile-rest-client/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client/pom.xml @@ -4,7 +4,7 @@ microprofile-rest-client jar microprofile-rest-client - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ 1.0.0 src/main/java diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..a15c245c8494 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="anotherfake-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/another-fake/dummy") +public interface AnotherFakeApi { + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client call123testSpecialTags(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiException.java index 13fb50ad633e..06a1cc2eaed2 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiException.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiException.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java index 51c2aa50a62a..323e30a2c52a 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..1ca1a836550c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="default-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/foo") +public interface DefaultApi { + + @GET + + @Produces({ "application/json" }) + FooGetDefaultResponse fooGet() throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..411aebd5d178 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,237 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import java.util.Date; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="fake-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake") +public interface FakeApi { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException, ProcessingException; + + /** + * Health check endpoint + * + */ + @GET + @Path("/health") + @Produces({ "application/json" }) + HealthCheckResult fakeHealthGet() throws ApiException, ProcessingException; + + /** + * test http signature authentication + * + */ + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + void fakeHttpSignatureTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException, ProcessingException; + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + String fakeOuterStringSerialize(String body) throws ApiException, ProcessingException; + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException, ProcessingException; + + /** + * test referenced additionalProperties + * + * + * + */ + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + void testAdditionalPropertiesReference(Map requestBody) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + void testBodyWithBinary(File body) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + void testBodyWithQueryParams(@QueryParam("query") String query, User user) throws ApiException, ProcessingException; + + /** + * To test \"client\" model + * + * To test \"client\" model + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClientModel(Client client) throws ApiException, ProcessingException; + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + */ + @POST + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary" , required = false) Attachment binaryDetail, @Multipart(value = "date", required = false) Date date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback) throws ApiException, ProcessingException; + + /** + * To test enum parameters + * + * To test enum parameters + * + */ + @GET + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString) throws ApiException, ProcessingException; + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + */ + @DELETE + + void testGroupParameters(@QueryParam("required_string_group") Integer requiredStringGroup, @HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, @QueryParam("required_int64_group") Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group) throws ApiException, ProcessingException; + + /** + * test inline additionalProperties + * + * + * + */ + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + void testInlineAdditionalProperties(Map requestBody) throws ApiException, ProcessingException; + + /** + * test inline free-form additionalProperties + * + * + * + */ + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException, ProcessingException; + + /** + * test json serialization of form data + * + * + * + */ + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "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 pipe, @QueryParam("ioutil") List ioutil, @QueryParam("http") List http, @QueryParam("url") List url, @QueryParam("context") List context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map language) throws ApiException, ProcessingException; + + /** + * test referenced string map + * + * + * + */ + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(Map requestBody) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..ec882fa3ce56 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + */ + +@RegisterRestClient(configKey="fakeclassnametags123-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake_classname_test") +public interface FakeClassnameTags123Api { + + /** + * To test class name in snake case + * + * To test class name in snake case + * + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClassname(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java index 49b834824263..f5ce26c6765a 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -15,6 +15,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -33,13 +34,13 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ @RegisterRestClient(configKey="pet-api") @RegisterProvider(ApiExceptionMapper.class) -@Path("/pet") +@Path("") public interface PetApi { /** @@ -49,10 +50,9 @@ public interface PetApi { * */ @POST - + @Path("/pet") @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - Pet addPet(Pet pet) throws ApiException, ProcessingException; + void addPet(Pet pet) throws ApiException, ProcessingException; /** * Deletes a pet @@ -61,7 +61,7 @@ public interface PetApi { * */ @DELETE - @Path("/{petId}") + @Path("/pet/{petId}") void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; /** @@ -71,7 +71,7 @@ public interface PetApi { * */ @GET - @Path("/findByStatus") + @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) List findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; @@ -84,9 +84,9 @@ public interface PetApi { */ @Deprecated @GET - @Path("/findByTags") + @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - List findPetsByTags(@QueryParam("tags") List tags) throws ApiException, ProcessingException; + Set findPetsByTags(@QueryParam("tags") Set tags) throws ApiException, ProcessingException; /** * Find pet by ID @@ -95,7 +95,7 @@ public interface PetApi { * */ @GET - @Path("/{petId}") + @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) Pet getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; @@ -106,10 +106,9 @@ public interface PetApi { * */ @PUT - + @Path("/pet") @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - Pet updatePet(Pet pet) throws ApiException, ProcessingException; + void updatePet(Pet pet) throws ApiException, ProcessingException; /** * Updates a pet in the store with form data @@ -118,7 +117,7 @@ public interface PetApi { * */ @POST - @Path("/{petId}") + @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException; @@ -129,8 +128,20 @@ public interface PetApi { * */ @POST - @Path("/{petId}/uploadImage") + @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException; + + /** + * uploads an image (required) + * + * + * + */ + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @Multipart(value = "requiredFile" ) Attachment requiredFileDetail, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata) throws ApiException, ProcessingException; } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java index 84e982c9e011..d63a429c9e96 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -31,7 +31,7 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ @@ -47,8 +47,8 @@ public interface StoreApi { * */ @DELETE - @Path("/order/{orderId}") - void deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException; + @Path("/order/{order_id}") + void deleteOrder(@PathParam("order_id") String orderId) throws ApiException, ProcessingException; /** * Returns pet inventories by status @@ -68,9 +68,9 @@ public interface StoreApi { * */ @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - Order getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException; + Order getOrderById(@PathParam("order_id") Long orderId) throws ApiException, ProcessingException; /** * Place an order for a pet diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java index 4a30e10a9fb6..d1088c95cffb 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -32,7 +32,7 @@ /** * OpenAPI Petstore * - *

This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * */ diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..9a40b7262f7b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,139 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class AdditionalPropertiesClass { + + @JsonbProperty("map_property") + private Map mapProperty = null; + + @JsonbProperty("map_of_map_property") + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + */ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + */ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..80b81b328ca7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,122 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.SingleRefType; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class AllOfWithSingleRef { + + @JsonbProperty("username") + private String username; + + @JsonbProperty("SingleRefType") + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + */ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + */ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..5b5e41797b17 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,121 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class Animal { + + @JsonbProperty("className") + private String className; + + @JsonbProperty("color") + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + /** + * Set className + */ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + */ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..7acf21a3c85f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ArrayOfArrayOfNumberOnly { + + @JsonbProperty("ArrayArrayNumber") + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + */ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..1b6cb911e51c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ArrayOfNumberOnly { + + @JsonbProperty("ArrayNumber") + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + */ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..a1fe7d282589 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,174 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ArrayTest { + + @JsonbProperty("array_of_string") + private List arrayOfString = null; + + @JsonbProperty("array_array_of_integer") + private List> arrayArrayOfInteger = null; + + @JsonbProperty("array_array_of_model") + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + */ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + */ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + */ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..440707e52868 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,224 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class Capitalization { + + @JsonbProperty("smallCamel") + private String smallCamel; + + @JsonbProperty("CapitalCamel") + private String capitalCamel; + + @JsonbProperty("small_Snake") + private String smallSnake; + + @JsonbProperty("Capital_Snake") + private String capitalSnake; + + @JsonbProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints; + + /** + * Name of the pet + */ + @JsonbProperty("ATT_NAME") + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + */ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + */ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + */ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + */ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + */ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + */ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..ce0fe89e5bbb --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.Animal; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class Cat extends Animal { + + @JsonbProperty("declawed") + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + */ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java index 5a53099479ee..e72028194baf 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,8 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; -/** - * A category for a pet - */ public class Category { @@ -35,7 +33,7 @@ public class Category { private Long id; @JsonbProperty("name") - private String name; + private String name = "default-name"; /** * Get id diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 000000000000..39704940cb8c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.ParentWithNullable; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ChildWithNullable extends ParentWithNullable { + + @JsonbProperty("otherProperty") + private String otherProperty; + + /** + * Get otherProperty + * @return otherProperty + **/ + public String getOtherProperty() { + return otherProperty; + } + + /** + * Set otherProperty + */ + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..3f19ba4c89be --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + +/** + * Model for testing model with \"_class\" property + */ + +public class ClassModel { + + @JsonbProperty("_class") + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + */ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..25902e22be21 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class Client { + + @JsonbProperty("client") + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + */ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 000000000000..1a4638a275a2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class DeprecatedObject { + + @JsonbProperty("name") + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..50ccc9b5f7c3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.Animal; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class Dog extends Animal { + + @JsonbProperty("breed") + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + */ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..29267b36bf13 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,216 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class EnumArrays { + + @JsonbTypeSerializer(JustSymbolEnum.Serializer.class) + @JsonbTypeDeserializer(JustSymbolEnum.Deserializer.class) + public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public JustSymbolEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(JustSymbolEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("just_symbol") + private JustSymbolEnum justSymbol; + + @JsonbTypeSerializer(ArrayEnumEnum.Serializer.class) + @JsonbTypeDeserializer(ArrayEnumEnum.Deserializer.class) + public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public ArrayEnumEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(ArrayEnumEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("array_enum") + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + */ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + */ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..e322dfe00e8f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets EnumClass + */ +@JsonbTypeSerializer(EnumClass.Serializer.class) +@JsonbTypeDeserializer(EnumClass.Deserializer.class) +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumClass deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumClass obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..489fb70ed740 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,443 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class EnumTest { + + @JsonbTypeSerializer(EnumStringEnum.Serializer.class) + @JsonbTypeDeserializer(EnumStringEnum.Deserializer.class) + public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumStringEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumStringEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_string") + private EnumStringEnum enumString; + + @JsonbTypeSerializer(EnumStringRequiredEnum.Serializer.class) + @JsonbTypeDeserializer(EnumStringRequiredEnum.Deserializer.class) + public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumStringRequiredEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumStringRequiredEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired; + + @JsonbTypeSerializer(EnumIntegerEnum.Serializer.class) + @JsonbTypeDeserializer(EnumIntegerEnum.Deserializer.class) + public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumIntegerEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumIntegerEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_integer") + private EnumIntegerEnum enumInteger; + + @JsonbTypeSerializer(EnumNumberEnum.Serializer.class) + @JsonbTypeDeserializer(EnumNumberEnum.Deserializer.class) + public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public EnumNumberEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(EnumNumberEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("enum_number") + private EnumNumberEnum enumNumber; + + @JsonbProperty("outerEnum") + private OuterEnum outerEnum; + + @JsonbProperty("outerEnumInteger") + private OuterEnumInteger outerEnumInteger; + + @JsonbProperty("outerEnumDefaultValue") + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + @JsonbProperty("outerEnumIntegerDefaultValue") + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + */ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + */ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + */ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + */ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + */ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + */ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + */ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + */ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..43696c63f3c7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,132 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class FakeBigDecimalMap200Response { + + @JsonbProperty("someId") + private BigDecimal someId; + + @JsonbProperty("someMap") + private Map someMap = null; + + /** + * Get someId + * @return someId + **/ + public BigDecimal getSomeId() { + return someId; + } + + /** + * Set someId + */ + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someMap + * @return someMap + **/ + public Map getSomeMap() { + return someMap; + } + + /** + * Set someMap + */ + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..4ede19f0d15c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,133 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class FileSchemaTestClass { + + @JsonbProperty("file") + private ModelFile _file; + + @JsonbProperty("files") + private List files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + */ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List getFiles() { + return files; + } + + /** + * Set files + */ + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..53bccc72e8dc --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class Foo { + + @JsonbProperty("bar") + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + */ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..3c440a0baa45 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.Foo; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class FooGetDefaultResponse { + + @JsonbProperty("string") + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + */ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..ae0b8b735434 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,491 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class FormatTest { + + @JsonbProperty("integer") + private Integer integer; + + @JsonbProperty("int32") + private Integer int32; + + @JsonbProperty("int64") + private Long int64; + + @JsonbProperty("number") + private BigDecimal number; + + @JsonbProperty("float") + private Float _float; + + @JsonbProperty("double") + private Double _double; + + @JsonbProperty("decimal") + private BigDecimal decimal; + + @JsonbProperty("string") + private String string; + + @JsonbProperty("byte") + private byte[] _byte; + + @JsonbProperty("binary") + private File binary; + + @JsonbProperty("date") + private Date date; + + @JsonbProperty("dateTime") + private Date dateTime; + + @JsonbProperty("uuid") + private UUID uuid; + + @JsonbProperty("password") + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + */ + @JsonbProperty("pattern_with_digits") + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + @JsonbProperty("pattern_with_digits_and_delimiter") + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + /** + * Set integer + */ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + /** + * Set int32 + */ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + */ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + /** + * Set number + */ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + /** + * Set _float + */ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + /** + * Set _double + */ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + */ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + /** + * Set string + */ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + */ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + */ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public Date getDate() { + return date; + } + + /** + * Set date + */ + public void setDate(Date date) { + this.date = date; + } + + public FormatTest date(Date date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public Date getDateTime() { + return dateTime; + } + + /** + * Set dateTime + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + */ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + */ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + */ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + */ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..d57075a19175 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,111 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class HasOnlyReadOnly { + + @JsonbProperty("bar") + private String bar; + + @JsonbProperty("foo") + private String foo; + + public HasOnlyReadOnly() { + } + + @JsonbCreator + public HasOnlyReadOnly( + @JsonbProperty(value = "bar", nillable = true) String bar, + @JsonbProperty(value = "foo", nillable = true) String foo + ) { + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..e54c3f3d1e66 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ + +public class HealthCheckResult { + + @JsonbProperty("NullableMessage") + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + */ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..e6977a0567d5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,247 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class MapTest { + + @JsonbProperty("map_map_of_string") + private Map> mapMapOfString = null; + + @JsonbTypeSerializer(InnerEnum.Serializer.class) + @JsonbTypeDeserializer(InnerEnum.Deserializer.class) + public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public InnerEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(InnerEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("map_of_enum_string") + private Map mapOfEnumString = null; + + @JsonbProperty("direct_map") + private Map directMap = null; + + @JsonbProperty("indirect_map") + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + */ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + */ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + */ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + */ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..d9599a2b4d24 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,159 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + @JsonbProperty("uuid") + private UUID uuid; + + @JsonbProperty("dateTime") + private Date dateTime; + + @JsonbProperty("map") + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + */ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public Date getDateTime() { + return dateTime; + } + + /** + * Set dateTime + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + */ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..1e6501396a54 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,124 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + +/** + * Model for testing model name starting with number + */ + +public class Model200Response { + + @JsonbProperty("name") + private Integer name; + + @JsonbProperty("class") + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + */ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + */ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 6926a2e2270f..78c6036f6b64 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,8 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; -/** - * Describes the result of uploading an image resource - */ public class ModelApiResponse { diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..81d92e29b7a6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + +/** + * Must be named `File` for test. + */ + +public class ModelFile { + + /** + * Test capitalization + */ + @JsonbProperty("sourceURI") + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + */ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..1a73f5d3b87b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ModelList { + + @JsonbProperty("123-list") + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + */ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..cd0fbdb8b723 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + +/** + * Model for testing reserved words + */ + +public class ModelReturn { + + @JsonbProperty("return") + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + */ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..72824cd1d4c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,164 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + +/** + * Model for testing model name same as property name + */ + +public class Name { + + @JsonbProperty("name") + private Integer name; + + @JsonbProperty("snake_case") + private Integer snakeCase; + + @JsonbProperty("property") + private String property; + + @JsonbProperty("123Number") + private Integer _123number; + + public Name() { + } + + @JsonbCreator + public Name( + @JsonbProperty(value = "snake_case", nillable = true) Integer snakeCase, + @JsonbProperty(value = "123Number", nillable = true) Integer _123number + ) { + this.snakeCase = snakeCase; + this._123number = _123number; + } + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + */ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + */ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..57edf7e20a44 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,427 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class NullableClass extends HashMap { + + @JsonbProperty("integer_prop") + private Integer integerProp; + + @JsonbProperty("number_prop") + private BigDecimal numberProp; + + @JsonbProperty("boolean_prop") + private Boolean booleanProp; + + @JsonbProperty("string_prop") + private String stringProp; + + @JsonbProperty("date_prop") + private Date dateProp; + + @JsonbProperty("datetime_prop") + private Date datetimeProp; + + @JsonbProperty("array_nullable_prop") + private List arrayNullableProp = null; + + @JsonbProperty("array_and_items_nullable_prop") + private List arrayAndItemsNullableProp = null; + + @JsonbProperty("array_items_nullable") + private List arrayItemsNullable = null; + + @JsonbProperty("object_nullable_prop") + private Map objectNullableProp = null; + + @JsonbProperty("object_and_items_nullable_prop") + private Map objectAndItemsNullableProp = null; + + @JsonbProperty("object_items_nullable") + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + */ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + */ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + */ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + */ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public Date getDateProp() { + return dateProp; + } + + /** + * Set dateProp + */ + public void setDateProp(Date dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(Date dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public Date getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + */ + public void setDatetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + */ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + */ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + */ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + */ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + */ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + */ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..58b8daf52b92 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class NumberOnly { + + @JsonbProperty("JustNumber") + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + */ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..08ba5f09dfc5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,190 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ObjectWithDeprecatedFields { + + @JsonbProperty("uuid") + private String uuid; + + @JsonbProperty("id") + private BigDecimal id; + + @JsonbProperty("deprecatedRef") + private DeprecatedObject deprecatedRef; + + @JsonbProperty("bars") + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + */ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + */ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + */ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + */ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java index 4f743c78a6c8..e8f48097237f 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -25,10 +25,8 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; -/** - * An order for a pets from the pet store - */ public class Order { diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..43baed60c024 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,147 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class OuterComposite { + + @JsonbProperty("my_number") + private BigDecimal myNumber; + + @JsonbProperty("my_string") + private String myString; + + @JsonbProperty("my_boolean") + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + */ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + */ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + */ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..bfdbf3a50778 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnum + */ +@JsonbTypeSerializer(OuterEnum.Serializer.class) +@JsonbTypeDeserializer(OuterEnum.Deserializer.class) +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..ce5a0dfa611b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnumDefaultValue + */ +@JsonbTypeSerializer(OuterEnumDefaultValue.Serializer.class) +@JsonbTypeDeserializer(OuterEnumDefaultValue.Deserializer.class) +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnumDefaultValue deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnumDefaultValue obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..bc9a3e33a200 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnumInteger + */ +@JsonbTypeSerializer(OuterEnumInteger.Serializer.class) +@JsonbTypeDeserializer(OuterEnumInteger.Deserializer.class) +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnumInteger deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnumInteger obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..2df60a48b9ef --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +@JsonbTypeSerializer(OuterEnumIntegerDefaultValue.Serializer.class) +@JsonbTypeDeserializer(OuterEnumIntegerDefaultValue.Deserializer.class) +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public OuterEnumIntegerDefaultValue deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(OuterEnumIntegerDefaultValue obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..da99561a45c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import org.openapitools.client.model.OuterEnumInteger; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class OuterObjectWithEnumProperty { + + @JsonbProperty("value") + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + */ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 000000000000..f26bca67bcce --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -0,0 +1,163 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ParentWithNullable { + + @JsonbTypeSerializer(TypeEnum.Serializer.class) + @JsonbTypeDeserializer(TypeEnum.Deserializer.class) + public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + + String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public TypeEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(TypeEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + @JsonbProperty("type") + private TypeEnum type; + + @JsonbProperty("nullableProperty") + private String nullableProperty; + + /** + * Get type + * @return type + **/ + public TypeEnum getType() { + return type; + } + + /** + * Set type + */ + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set nullableProperty + */ + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + Objects.equals(this.nullableProperty, parentWithNullable.nullableProperty); + } + + @Override + public int hashCode() { + return Objects.hash(type, nullableProperty); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java index 03b5f5cd88f6..826495b93453 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -16,7 +16,9 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import java.lang.reflect.Type; @@ -29,10 +31,8 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; -/** - * A pet for sale in the pet store - */ public class Pet { @@ -46,7 +46,7 @@ public class Pet { private String name; @JsonbProperty("photoUrls") - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonbProperty("tags") private List tags = null; @@ -163,25 +163,25 @@ public Pet name(String name) { * Get photoUrls * @return photoUrls **/ - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } /** * Set photoUrls */ - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new ArrayList<>(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); return this; @@ -218,9 +218,7 @@ public Pet addTagsItem(Tag tagsItem) { /** * pet status in the store * @return status - * @deprecated **/ - @Deprecated public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..808fb7c3e606 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,120 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class ReadOnlyFirst { + + @JsonbProperty("bar") + private String bar; + + @JsonbProperty("baz") + private String baz; + + public ReadOnlyFirst() { + } + + @JsonbCreator + public ReadOnlyFirst( + @JsonbProperty(value = "bar", nillable = true) String bar + ) { + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + */ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 000000000000..503728d421dc --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +/** + * Gets or Sets SingleRefType + */ +@JsonbTypeSerializer(SingleRefType.Serializer.class) +@JsonbTypeDeserializer(SingleRefType.Deserializer.class) +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public SingleRefType deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(SingleRefType obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..4148cefea405 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class SpecialModelName { + + @JsonbProperty("$special[property.name]") + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + */ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java index 5bb307506c92..42ffd13fa6ef 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,8 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; -/** - * A tag for a pet - */ public class Tag { diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..284859c07b26 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + @JsonbProperty("someProperty") + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + */ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java index 1542e3dfc587..0558306bd639 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java @@ -1,6 +1,6 @@ /** * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -24,10 +24,8 @@ import javax.json.stream.JsonGenerator; import javax.json.stream.JsonParser; import javax.json.bind.annotation.JsonbProperty; +import javax.json.bind.annotation.JsonbCreator; -/** - * A User who is purchasing from the pet store - */ public class User { diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..041f9f7136ac --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(AnotherFakeApi.class); + } + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() { + // TODO: test validations + Client client = null; + //Client response = api.call123testSpecialTags(client); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..577645a5678d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private DefaultApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(DefaultApi.class); + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() { + // TODO: test validations + //FooGetDefaultResponse response = api.fooGet(); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..d25f42399053 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,449 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import java.util.Date; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeApi + */ +public class FakeApiTest { + + private FakeApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(FakeApi.class); + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeBigDecimalMapTest() { + // TODO: test validations + //FakeBigDecimalMap200Response response = api.fakeBigDecimalMap(); + //Assertions.assertNotNull(response); + + + } + + /** + * Health check endpoint + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() { + // TODO: test validations + //HealthCheckResult response = api.fakeHealthGet(); + //Assertions.assertNotNull(response); + + + } + + /** + * test http signature authentication + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHttpSignatureTestTest() { + // TODO: test validations + Pet pet = null; + String query1 = null; + String header1 = null; + //api.fakeHttpSignatureTest(pet, query1, header1); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() { + // TODO: test validations + Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() { + // TODO: test validations + OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() { + // TODO: test validations + BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() { + // TODO: test validations + String body = null; + //String response = api.fakeOuterStringSerialize(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() { + // TODO: test validations + OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + //OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + //Assertions.assertNotNull(response); + + + } + + /** + * test referenced additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // TODO: test validations + Map requestBody = null; + //api.testAdditionalPropertiesReference(requestBody); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithBinaryTest() { + // TODO: test validations + org.apache.cxf.jaxrs.ext.multipart.Attachment body = null; + //api.testBodyWithBinary(body); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() { + // TODO: test validations + FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() { + // TODO: test validations + String query = null; + User user = null; + //api.testBodyWithQueryParams(query, user); + //Assertions.assertNotNull(response); + + + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() { + // TODO: test validations + Client client = null; + //Client response = api.testClientModel(client); + //Assertions.assertNotNull(response); + + + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() { + // TODO: test validations + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment binary = null; + Date date = null; + Date dateTime = null; + String password = null; + String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //Assertions.assertNotNull(response); + + + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() { + // TODO: test validations + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumQueryModelArray = null; + List enumFormStringArray = null; + String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + //Assertions.assertNotNull(response); + + + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() { + // TODO: test validations + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + //Assertions.assertNotNull(response); + + + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + // TODO: test validations + Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody); + //Assertions.assertNotNull(response); + + + } + + /** + * test inline free-form additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // TODO: test validations + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + //api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //Assertions.assertNotNull(response); + + + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() { + // TODO: test validations + String param = null; + String param2 = null; + //api.testJsonFormData(param, param2); + //Assertions.assertNotNull(response); + + + } + + /** + * test nullable parent property + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testNullableTest() { + // TODO: test validations + ChildWithNullable childWithNullable = null; + //api.testNullable(childWithNullable); + //Assertions.assertNotNull(response); + + + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() { + // TODO: test validations + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + String allowEmpty = null; + Map language = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + //Assertions.assertNotNull(response); + + + } + + /** + * test referenced string map + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testStringMapReferenceTest() { + // TODO: test validations + Map requestBody = null; + //api.testStringMapReference(requestBody); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..e5ba1cc1b928 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private FakeClassnameTags123Api client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(FakeClassnameTags123Api.class); + } + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() { + // TODO: test validations + Client client = null; + //Client response = api.testClassname(client); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..c33042cf8e79 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..ba32c589b850 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.SingleRefType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..bf91c4a20f02 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..4a72072e65eb --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..8f6a0038a230 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..0f7d0d93ee74 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,62 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..cc892e34a39c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..c67c1b01b9c5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..52ee57ee7635 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.ParentWithNullable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..2b5a94e3abd1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..631cd9ec97f2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..f910877f265d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..06550b080eaa --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..5a4482a48e5b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,53 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..1b428fce8da4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..e88f4913fac3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..bf85a56f9cb5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,53 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..574f81629d27 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..db0cbf8b71da --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.Foo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..85be29d44852 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..73dab4e2d947 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,166 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..905c931aab50 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..6d6129521201 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..c1bc74afd090 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..0aab1ece1a9e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..9a31cadf7209 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..88a8d0d8f902 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..15f4af11ddbf --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..40aa9479d1b4 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..fbe1d4d6c03b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..2dc4edf27b40 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..399dec94c676 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..360689566a28 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,71 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..7a906cb31cd7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,59 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..e492f3e0ff6f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..d72626405cc5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..b7dd55cda628 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..1116901010b0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..f773156fb5e5 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.model.OuterEnumInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..e2a5a37b6cbb --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..b3205f147207 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..210c2a450379 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..07c9acddd158 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..011ed8b26d49 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,44 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} From 25d780ee6d8876217da38a019cecef604faf21d2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 3 Dec 2024 12:08:29 +0800 Subject: [PATCH 19/40] update python multipart dep to 0.0.18 (#20225) --- .../src/main/resources/python-fastapi/requirements.mustache | 2 +- samples/server/petstore/python-fastapi/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache index 06ea2e2887ea..a32429ef8219 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache @@ -22,7 +22,7 @@ orjson==3.9.15 promise==2.3 pydantic>=2 python-dotenv==0.17.1 -python-multipart==0.0.7 +python-multipart==0.0.18 PyYAML>=5.4.1,<6.1.0 requests==2.32.0 Rx==1.6.1 diff --git a/samples/server/petstore/python-fastapi/requirements.txt b/samples/server/petstore/python-fastapi/requirements.txt index 06ea2e2887ea..a32429ef8219 100644 --- a/samples/server/petstore/python-fastapi/requirements.txt +++ b/samples/server/petstore/python-fastapi/requirements.txt @@ -22,7 +22,7 @@ orjson==3.9.15 promise==2.3 pydantic>=2 python-dotenv==0.17.1 -python-multipart==0.0.7 +python-multipart==0.0.18 PyYAML>=5.4.1,<6.1.0 requests==2.32.0 Rx==1.6.1 From 26609e9ad3ede44002af2b89dd5dd02a8778182a Mon Sep 17 00:00:00 2001 From: Kirill Romanov Date: Tue, 3 Dec 2024 07:10:41 +0300 Subject: [PATCH 20/40] fix: register gson CustomTypeAdapterFactory in kotlin-client if generateOneOfAnyOfWrappers enabled (#20217) --- .../jvm-common/infrastructure/Serializer.kt.mustache | 11 +++++++++++ .../openapitools/client/infrastructure/Serializer.kt | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache index 241c462f3ad1..418523fc590a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -97,6 +97,17 @@ import java.util.concurrent.atomic.AtomicLong .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + {{#generateOneOfAnyOfWrappers}} + {{#models}} + {{#model}} + {{^isEnum}} + {{^hasChildren}} + .registerTypeAdapterFactory({{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) + {{/hasChildren}} + {{/isEnum}} + {{/model}} + {{/models}} + {{/generateOneOfAnyOfWrappers}} @JvmStatic val gson: Gson by lazy { diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 6e16e4f6582b..1426926f13fc 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -14,6 +14,17 @@ object Serializer { .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiAnnotation.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPetOrArrayString.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiApiResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiCategory.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiOrder.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiTag.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiUser.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPetOrArrayString.CustomTypeAdapterFactory()) @JvmStatic val gson: Gson by lazy { From cf78f1028df55147da8f4c84b6a56eeb67f54915 Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Tue, 3 Dec 2024 11:38:43 +0100 Subject: [PATCH 21/40] Fix dangerous destructuration in typescript-nestjs services (#20157) * refactor: remove requestParameters destructuration * feat: add reserved param names sample * feat: quote params * feat: improve with reservedWords * feat: use vendorExtensions instead of extending CodegenParameter --- ...ypescript-nestjs-reserved-param-names.yaml | 6 + docs/generators/typescript-nestjs.md | 2 + .../TypeScriptNestjsClientCodegen.java | 6 + .../typescript-nestjs/api.service.mustache | 4 +- .../typescript-nestjs/modelGeneric.mustache | 2 +- .../modelTaggedUnion.mustache | 4 +- .../reserved-param-names.yaml | 43 +++++ .../builds/reservedParamNames/.gitignore | 4 + .../.openapi-generator-ignore | 23 +++ .../.openapi-generator/FILES | 10 ++ .../.openapi-generator/VERSION | 1 + .../builds/reservedParamNames/README.md | 162 ++++++++++++++++++ .../builds/reservedParamNames/api.module.ts | 70 ++++++++ .../builds/reservedParamNames/api/api.ts | 3 + .../reservedParamNames/api/default.service.ts | 147 ++++++++++++++++ .../reservedParamNames/configuration.ts | 109 ++++++++++++ .../builds/reservedParamNames/git_push.sh | 57 ++++++ .../builds/reservedParamNames/index.ts | 4 + .../builds/reservedParamNames/model/models.ts | 0 .../builds/reservedParamNames/variables.ts | 7 + 20 files changed, 659 insertions(+), 5 deletions(-) create mode 100644 bin/configs/typescript-nestjs-reserved-param-names.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/typescript-nestjs/reserved-param-names.yaml create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.gitignore create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/README.md create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api.module.ts create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/api.ts create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/index.ts create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/model/models.ts create mode 100644 samples/client/petstore/typescript-nestjs/builds/reservedParamNames/variables.ts diff --git a/bin/configs/typescript-nestjs-reserved-param-names.yaml b/bin/configs/typescript-nestjs-reserved-param-names.yaml new file mode 100644 index 000000000000..c80064785d3e --- /dev/null +++ b/bin/configs/typescript-nestjs-reserved-param-names.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-nestjs +outputDir: samples/client/petstore/typescript-nestjs/builds/reservedParamNames +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-nestjs/reserved-param-names.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-nestjs +additionalProperties: + "useSingleRequestParameter" : true diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index 2055133b6b89..47037f98f6b0 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -116,9 +116,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • float
  • for
  • formParams
  • +
  • from
  • function
  • goto
  • headerParams
  • +
  • headers
  • if
  • implements
  • import
  • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java index 520d69e2d62d..e12e8b2f030f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java @@ -88,6 +88,8 @@ public TypeScriptNestjsClientCodegen() { apiPackage = "api"; modelPackage = "model"; + reservedWords.addAll(Arrays.asList("from", "headers")); + this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); this.cliOptions.add(CliOption.newBoolean(WITH_INTERFACES, @@ -327,6 +329,10 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap operations, L // Overwrite path to TypeScript template string, after applying everything we just did. op.path = pathBuffer.toString(); + + for (CodegenParameter param : op.allParams) { + param.vendorExtensions.putIfAbsent("x-param-has-sanitized-name", !param.baseName.equals(param.paramName)); + } } operations.put("hasSomeFormParams", hasSomeFormParams); diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache index d33a206803f7..12bf8d238860 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -35,7 +35,7 @@ export interface {{classname}}{{operationIdCamelCase}}Request { * @type {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> * @memberof {{classname}}{{operationIdCamelCase}} */ - readonly {{paramName}}{{^required}}?{{/required}}: {{{dataType}}} + readonly {{#vendorExtensions.x-param-has-sanitized-name}}'{{{baseName}}}'{{/vendorExtensions.x-param-has-sanitized-name}}{{^vendorExtensions.x-param-has-sanitized-name}}{{{paramName}}}{{/vendorExtensions.x-param-has-sanitized-name}}{{^required}}?{{/required}}: {{{dataType}}} {{^-last}} {{/-last}} @@ -106,7 +106,7 @@ export class {{classname}} { {{#useSingleRequestParameter}} const { {{#allParams}} - {{paramName}}, + {{#vendorExtensions.x-param-has-sanitized-name}}'{{{baseName}}}': {{/vendorExtensions.x-param-has-sanitized-name}}{{paramName}}, {{/allParams}} } = requestParameters; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache index 43207b65e305..720aac912881 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache @@ -5,6 +5,6 @@ export interface {{classname}}{{#allParents}}{{#-first}} extends {{/-first}}{{{. * {{{.}}} */ {{/description}} - {{#isReadOnly}}readonly {{/isReadOnly}}{{{name}}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; + {{#isReadOnly}}readonly {{/isReadOnly}}{{#hasSanitizedName}}'{{{baseName}}}'{{/hasSanitizedName}}{{^hasSanitizedName}}{{{name}}}{{/hasSanitizedName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; {{/vars}} }{{>modelGenericEnums}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache index 24a9c0f0b60f..754c1db278ba 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache @@ -10,7 +10,7 @@ export interface {{classname}} { {{>modelGenericAdditionalProperties}} * {{{.}}} */ {{/description}} - {{name}}{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}}; + {{#hasSanitizedName}}'{{{baseName}}}'{{/hasSanitizedName}}{{^hasSanitizedName}}{{{name}}}{{/hasSanitizedName}}{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}}; {{/allVars}} } {{>modelGenericEnums}} @@ -18,4 +18,4 @@ export interface {{classname}} { {{>modelGenericAdditionalProperties}} {{^parent}} {{>modelGeneric}} {{/parent}} -{{/discriminator}} \ No newline at end of file +{{/discriminator}} diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-nestjs/reserved-param-names.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-nestjs/reserved-param-names.yaml new file mode 100644 index 000000000000..ab02beffe8c6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-nestjs/reserved-param-names.yaml @@ -0,0 +1,43 @@ +openapi: 3.0.0 +info: + description: Test reserved param names + version: 1.0.0 + title: Reserved param names +paths: + /test: + post: + security: + - bearerAuth: [] + summary: Test reserved param names + description: '' + operationId: testReservedParamNames + parameters: + - name: notReserved + in: query + description: Should not be treated as a reserved param name + required: true + schema: + type: string + - name: from + in: query + description: Might conflict with rxjs import + required: true + schema: + type: string + - name: headers + in: header + description: Might conflict with headers const + required: true + schema: + type: string + responses: + '200': + description: successful operation + '405': + description: Invalid input +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.gitignore b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator-ignore b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/FILES b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/FILES new file mode 100644 index 000000000000..229c09ab6277 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/FILES @@ -0,0 +1,10 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/default.service.ts +configuration.ts +git_push.sh +index.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/VERSION new file mode 100644 index 000000000000..884119126398 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/README.md b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/README.md new file mode 100644 index 000000000000..0cc526067ed1 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/README.md @@ -0,0 +1,162 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +#### General usage + +In your Nestjs project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpModule } from '@nestjs/axios'; + +@Module({ + imports: [ + ApiModule, + HttpModule + ], + providers: [] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@Module({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule a dynamic module and instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpModule } from '@nestjs/axios'; + +@Module({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@Module({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +### Configuring the module with `forRootAsync` + +You can also use the Nestjs Config Module/Service to configure your app with `forRootAsync`. + +``` +@Module({ + imports: [ + ApiModule.forRootAsync({ + imports: [ConfigModule], + inject: [ConfigService], + useFactory: (config: ConfigService): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + basePath: config.get('API_URL'), + }; + return new Configuration(params); + }, + }) + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +#### Using @nestjs/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@Module({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [ + { + provide: 'BASE_PATH', + useValue: environment.API_BASE_PATH + } + ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api.module.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api.module.ts new file mode 100644 index 000000000000..5743870b91c1 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api.module.ts @@ -0,0 +1,70 @@ +import { DynamicModule, Module, Global, Provider } from '@nestjs/common'; +import { HttpModule, HttpService } from '@nestjs/axios'; +import { AsyncConfiguration, Configuration, ConfigurationFactory } from './configuration'; + +import { DefaultService } from './api/default.service'; + +@Global() +@Module({ + imports: [ HttpModule ], + exports: [ + DefaultService + ], + providers: [ + DefaultService + ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): DynamicModule { + return { + module: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + /** + * Register the module asynchronously. + */ + static forRootAsync(options: AsyncConfiguration): DynamicModule { + const providers = [...this.createAsyncProviders(options)]; + return { + module: ApiModule, + imports: options.imports || [], + providers, + exports: providers, + }; + } + + private static createAsyncProviders(options: AsyncConfiguration): Provider[] { + if (options.useClass) { + return [ + this.createAsyncConfigurationProvider(options), + { + provide: options.useClass, + useClass: options.useClass, + }, + ]; + } + return [this.createAsyncConfigurationProvider(options)]; + } + + private static createAsyncConfigurationProvider( + options: AsyncConfiguration, + ): Provider { + if (options.useFactory) { + return { + provide: Configuration, + useFactory: options.useFactory, + inject: options.inject || [], + }; + } + return { + provide: Configuration, + useFactory: async (optionsFactory: ConfigurationFactory) => + await optionsFactory.createConfiguration(), + inject: (options.useExisting && [options.useExisting]) || (options.useClass && [options.useClass]) || [], + }; + } + + constructor( httpService: HttpService) { } +} diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/api.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/api.ts new file mode 100644 index 000000000000..8e76619647f4 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/api.ts @@ -0,0 +1,3 @@ +export * from './default.service'; +import { DefaultService } from './default.service'; +export const APIS = [DefaultService]; diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts new file mode 100644 index 000000000000..c41aa37ec06b --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts @@ -0,0 +1,147 @@ +/** + * Reserved param names + * Test reserved param names + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Injectable, Optional } from '@nestjs/common'; +import { HttpService } from '@nestjs/axios'; +import { AxiosResponse } from 'axios'; +import { Observable, from, of, switchMap } from 'rxjs'; +import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; + +/** + * Request parameters for testReservedParamNames operation in DefaultService. + * @export + * @interface DefaultServiceTestReservedParamNamesRequest + */ +export interface DefaultServiceTestReservedParamNamesRequest { + /** + * Should not be treated as a reserved param name + * @type {string} + * @memberof DefaultServiceTestReservedParamNames + */ + readonly notReserved: string + + /** + * Might conflict with rxjs import + * @type {string} + * @memberof DefaultServiceTestReservedParamNames + */ + readonly 'from': string + + /** + * Might conflict with headers const + * @type {string} + * @memberof DefaultServiceTestReservedParamNames + */ + readonly 'headers': string +} + + +@Injectable() +export class DefaultService { + + protected basePath = 'http://localhost'; + public defaultHeaders: Record = {}; + public configuration = new Configuration(); + protected httpClient: HttpService; + + constructor(httpClient: HttpService, @Optional() configuration: Configuration) { + this.configuration = configuration || this.configuration; + this.basePath = configuration?.basePath || this.basePath; + this.httpClient = configuration?.httpClient || httpClient; + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + return consumes.includes(form); + } + + /** + * Test reserved param names + * + * @param {DefaultServiceTestReservedParamNamesRequest} requestParameters Request parameters. + */ + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable>; + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable { + const { + notReserved, + 'from': _from, + 'headers': _headers, + } = requestParameters; + + if (notReserved === null || notReserved === undefined) { + throw new Error('Required parameter notReserved was null or undefined when calling testReservedParamNames.'); + } + + if (_from === null || _from === undefined) { + throw new Error('Required parameter _from was null or undefined when calling testReservedParamNames.'); + } + + if (_headers === null || _headers === undefined) { + throw new Error('Required parameter _headers was null or undefined when calling testReservedParamNames.'); + } + + let queryParameters = new URLSearchParams(); + if (notReserved !== undefined && notReserved !== null) { + queryParameters.append('notReserved', notReserved); + } + if (_from !== undefined && _from !== null) { + queryParameters.append('from', _from); + } + + let headers = {...this.defaultHeaders}; + if (_headers !== undefined && _headers !== null) { + headers['headers'] = String(_headers); + } + + let accessTokenObservable: Observable = of(null); + + // authentication (bearerAuth) required + if (typeof this.configuration.accessToken === 'function') { + accessTokenObservable = from(Promise.resolve(this.configuration.accessToken())); + } else if (this.configuration.accessToken) { + accessTokenObservable = from(Promise.resolve(this.configuration.accessToken)); + } + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/test`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) + ); + } +} diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts new file mode 100644 index 000000000000..5db77aed7255 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts @@ -0,0 +1,109 @@ +import type { HttpService } from '@nestjs/axios'; +import { ModuleMetadata, Type } from '@nestjs/common/interfaces'; + +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | Promise | (() => string | Promise); + basePath?: string; + withCredentials?: boolean; + httpClient?: HttpService; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | Promise | (() => string | Promise); + basePath?: string; + withCredentials?: boolean; + httpClient?: HttpService; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.httpClient = configurationParameters.httpClient; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length == 0) { + return undefined; + } + + let type = contentTypes.find(x => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length == 0) { + return undefined; + } + + let type = accepts.find(x => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} + +export interface ConfigurationFactory { + createConfiguration(): Promise | Configuration; +} + +export interface AsyncConfiguration extends Pick { + /** + * The `useExisting` syntax allows you to create aliases for existing providers. + */ + useExisting?: Type; + /** + * The `useClass` syntax allows you to dynamically determine a class + * that a token should resolve to. + */ + useClass?: Type; + /** + * The `useFactory` syntax allows for creating providers dynamically. + */ + useFactory?: (...args: any[]) => Promise | Configuration; + /** + * Optional list of providers to be injected into the context of the Factory function. + */ + inject?: any[]; +} diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/index.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/index.ts new file mode 100644 index 000000000000..d20921b6d5de --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/index.ts @@ -0,0 +1,4 @@ +export * from './api/api'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/model/models.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/model/models.ts new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/variables.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/variables.ts new file mode 100644 index 000000000000..d52a33f70e5b --- /dev/null +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/variables.ts @@ -0,0 +1,7 @@ + +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} From 423ba6739a2c5f5663d26f192907189b136e60ef Mon Sep 17 00:00:00 2001 From: Thibaud Sowa Date: Tue, 3 Dec 2024 17:58:17 +0100 Subject: [PATCH 22/40] feat(typescript-angular): add support for Angular V19 (#20205) * feat(typescript-angular): add support for Angular V19 fix #20204 * feat(typescript-angular): add options to override angular deps + refactor deps definition add tsVersion, rxjsVersion, ngPackagrVersion and zonejsVersion options to override default config if new version of Angular is available but not yet implemented in openapi-generator refactor Angular dependencies definition in separate readable yaml config file fix #20204 * feat(typescript-angular): add better angular 19 exemple for ci testing fix #20204 * feat(typescript-angular): unify tsVersion param fix #20204 --------- Co-authored-by: Thibaud SOWA --- CI/circle_parallel.sh | 1 + README.md | 2 +- ...pescript-angular-v19-provided-in-root.yaml | 7 + docs/generators/typescript-angular.md | 8 +- modules/openapi-generator/pom.xml | 5 + .../TypeScriptAngularClientCodegen.java | 159 +- .../codegen/utils/YamlConfigUtils.java | 69 + .../angularDependenciesByVersion.yaml | 74 + ...ypeScriptAngularClientOptionsProvider.java | 8 + .../codegen/utils/YamlConfigUtilsTest.java | 45 + .../src/test/resources/yamlConfigMap.yaml | 10 + pom.xml | 1 + .../.gitignore | 42 + .../angular.json | 96 + .../builds/default/.gitignore | 4 + .../builds/default/.openapi-generator-ignore | 23 + .../builds/default/.openapi-generator/FILES | 20 + .../builds/default/.openapi-generator/VERSION | 1 + .../builds/default/README.md | 236 + .../builds/default/api.module.ts | 30 + .../builds/default/api/api.ts | 7 + .../builds/default/api/pet.service.ts | 781 + .../builds/default/api/store.service.ts | 367 + .../builds/default/api/user.service.ts | 706 + .../builds/default/configuration.ts | 186 + .../builds/default/encoder.ts | 20 + .../builds/default/git_push.sh | 57 + .../builds/default/index.ts | 6 + .../builds/default/model/apiResponse.ts | 20 + .../builds/default/model/category.ts | 19 + .../builds/default/model/models.ts | 6 + .../builds/default/model/order.ts | 35 + .../builds/default/model/pet.ts | 38 + .../builds/default/model/tag.ts | 19 + .../builds/default/model/user.ts | 28 + .../builds/default/param.ts | 69 + .../builds/default/variables.ts | 9 + .../package-lock.json | 15104 ++++++++++++++++ .../package.json | 38 + .../src/app/app.component.css | 0 .../src/app/app.component.html | 1 + .../src/app/app.component.spec.ts | 42 + .../src/app/app.component.ts | 18 + .../src/app/app.config.ts | 15 + .../src/app/app.routes.ts | 3 + .../src/index.html | 12 + .../src/main.ts | 6 + .../src/styles.css | 1 + .../tsconfig.app.json | 15 + .../tsconfig.json | 30 + .../tsconfig.spec.json | 15 + 51 files changed, 18400 insertions(+), 114 deletions(-) create mode 100644 bin/configs/typescript-angular-v19-provided-in-root.yaml create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/YamlConfigUtils.java create mode 100644 modules/openapi-generator/src/main/resources/typescript-angular/angularDependenciesByVersion.yaml create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/YamlConfigUtilsTest.java create mode 100644 modules/openapi-generator/src/test/resources/yamlConfigMap.yaml create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/angular.json create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/index.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/param.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/variables.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/package-lock.json create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/package.json create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.css create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.html create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.spec.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.config.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.routes.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/index.html create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/main.ts create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/src/styles.css create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.app.json create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.spec.json diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 3941f7724664..9d54203ba031 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -80,6 +80,7 @@ elif [ "$NODE_INDEX" = "3" ]; then (cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test) (cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test) (cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test) + (cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test) (cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test) (cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test) (cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test) diff --git a/README.md b/README.md index 903ea36a90f8..8639ac37741a 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 18.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** | +| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 19.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** | | **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | diff --git a/bin/configs/typescript-angular-v19-provided-in-root.yaml b/bin/configs/typescript-angular-v19-provided-in-root.yaml new file mode 100644 index 000000000000..17025ad1df9a --- /dev/null +++ b/bin/configs/typescript-angular-v19-provided-in-root.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 19.0.0 + supportsES6: true diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 999539372ddb..8e3e41c6f9df 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -11,7 +11,7 @@ title: Documentation for the typescript-angular Generator | generator type | CLIENT | | | generator language | Typescript | | | generator default templating engine | mustache | | -| helpTxt | Generates a TypeScript Angular (9.x - 18.x) client library. | | +| helpTxt | Generates a TypeScript Angular (9.x - 19.x) client library. | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. @@ -33,7 +33,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |modelSuffix|The suffix of the generated model.| |null| -|ngVersion|The version of Angular. (At least 9.0.0)| |18.0.0| +|ngPackagrVersion|The version of ng-packagr compatible with Angular (see ngVersion option).| |null| +|ngVersion|The version of Angular. (At least 9.0.0)| |19.0.0| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| @@ -42,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |providedIn|Use this property to provide Injectables in wanted level.|
    **root**
    The application-level injector in most apps.
    **none**
    No providedIn)
    **any**
    Provides a unique instance in each lazy loaded module while all eagerly loaded modules share one instance.
    **platform**
    A special singleton platform injector shared by all applications on the page.
    |root| |queryParamObjectFormat|The format for query param objects: 'dot', 'json', 'key'.| |dot| +|rxjsVersion|The version of RxJS compatible with Angular (see ngVersion option).| |null| |serviceFileSuffix|The suffix of the file of the generated service (service<suffix>.ts).| |.service| |serviceSuffix|The suffix of the generated service.| |Service| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| @@ -50,9 +52,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl |stringEnums|Generate string enums instead of objects for enum values.| |false| |supportsES6|Generate code that conforms to ES6.| |false| |taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| +|tsVersion|The version of typescript compatible with Angular (see ngVersion option).| |null| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| +|zoneJsVersion|The version of zone.js compatible with Angular (see ngVersion option).| |null| ## IMPORT MAPPING diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 49d4b81d07aa..5e64320be74d 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -459,6 +459,11 @@ lombok ${lombok.version} + + org.yaml + snakeyaml + ${snakeyaml.version} + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 18d4051c9c0a..af8865e78e0a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -19,6 +19,7 @@ import io.swagger.v3.oas.models.media.Schema; import lombok.AccessLevel; +import lombok.Data; import lombok.Getter; import lombok.Setter; import org.openapitools.codegen.*; @@ -31,6 +32,7 @@ import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.SemVer; +import org.openapitools.codegen.utils.YamlConfigUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,8 +78,12 @@ public static enum PROVIDED_IN_LEVEL {none, root, any, platform} public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; public static final String QUERY_PARAM_OBJECT_FORMAT = "queryParamObjectFormat"; public static final String USE_SQUARE_BRACKETS_IN_ARRAY_NAMES = "useSquareBracketsInArrayNames"; + public static final String TS_VERSION = "tsVersion"; + public static final String RXJS_VERSION = "rxjsVersion"; + public static final String NGPACKAGR_VERSION = "ngPackagrVersion"; + public static final String ZONEJS_VERSION = "zoneJsVersion"; - protected String ngVersion = "18.0.0"; + protected String ngVersion = "19.0.0"; @Getter @Setter protected String npmRepository = null; @Setter(AccessLevel.PRIVATE) private boolean useSingleRequestParameter = false; @@ -144,6 +150,10 @@ public TypeScriptAngularClientCodegen() { this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC).defaultValue(String.valueOf(this.stringEnums))); this.cliOptions.add(new CliOption(QUERY_PARAM_OBJECT_FORMAT, "The format for query param objects: 'dot', 'json', 'key'.").defaultValue(this.queryParamObjectFormat.name())); this.cliOptions.add(CliOption.newBoolean(USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, "Setting this property to true will add brackets to array attribute names, e.g. my_values[].", false)); + this.cliOptions.add(new CliOption(TS_VERSION, "The version of typescript compatible with Angular (see ngVersion option).")); + this.cliOptions.add(new CliOption(RXJS_VERSION, "The version of RxJS compatible with Angular (see ngVersion option).")); + this.cliOptions.add(new CliOption(NGPACKAGR_VERSION, "The version of ng-packagr compatible with Angular (see ngVersion option).")); + this.cliOptions.add(new CliOption(ZONEJS_VERSION, "The version of zone.js compatible with Angular (see ngVersion option).")); } @Override @@ -159,7 +169,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a TypeScript Angular (9.x - 18.x) client library."; + return "Generates a TypeScript Angular (9.x - 19.x) client library."; } @Override @@ -286,126 +296,53 @@ public void processOpts() { } + @Data + static class AngularDependencies { + String tsVersion; + String rxjsVersion; + String ngPackagrVersion; + String zonejsVersion; + String tsickleVersion; + } + private void addNpmPackageGeneration(SemVer ngVersion) { if (additionalProperties.containsKey(NPM_REPOSITORY)) { this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString()); } - // Set the typescript version compatible to the Angular version - // based on https://angular.io/guide/versions#actively-supported-versions - if (ngVersion.atLeast("18.1.0")) { - additionalProperties.put("tsVersion", ">=5.4.0 <5.6.0"); - } else if (ngVersion.atLeast("18.0.0")) { - additionalProperties.put("tsVersion", ">=5.4.0 <5.5.0"); - } else if (ngVersion.atLeast("17.0.0")) { - additionalProperties.put("tsVersion", ">=4.9.3 <5.3.0"); - } else if (ngVersion.atLeast("16.1.0")) { - additionalProperties.put("tsVersion", ">=4.9.3 <5.2.0"); - } else if (ngVersion.atLeast("16.0.0")) { - additionalProperties.put("tsVersion", ">=4.9.3 <5.1.0"); - } else if (ngVersion.atLeast("15.0.0")) { - additionalProperties.put("tsVersion", ">=4.8.2 <4.10.0"); - } else if (ngVersion.atLeast("14.0.0")) { - additionalProperties.put("tsVersion", ">=4.6.0 <=4.8.0"); - } else if (ngVersion.atLeast("13.0.0")) { - additionalProperties.put("tsVersion", ">=4.4.2 <4.5.0"); - } else if (ngVersion.atLeast("12.0.0")) { - additionalProperties.put("tsVersion", ">=4.3.0 <4.4.0"); - } else if (ngVersion.atLeast("11.0.0")) { - additionalProperties.put("tsVersion", ">=4.0.0 <4.1.0"); - } else if (ngVersion.atLeast("10.0.0")) { - additionalProperties.put("tsVersion", ">=3.9.2 <4.0.0"); - } else if (ngVersion.atLeast("9.0.0")) { - additionalProperties.put("tsVersion", ">=3.6.0 <3.8.0"); - } else { - throw new IllegalArgumentException("Invalid ngVersion. Only Angular v9+ is supported."); - } - - // Set the rxJS version compatible to the Angular version - if (ngVersion.atLeast("18.0.0")) { - additionalProperties.put("rxjsVersion", "7.4.0"); - } else if (ngVersion.atLeast("17.0.0")) { - additionalProperties.put("rxjsVersion", "7.4.0"); - } else if (ngVersion.atLeast("16.0.0")) { - additionalProperties.put("rxjsVersion", "7.4.0"); - } else if (ngVersion.atLeast("15.0.0")) { - additionalProperties.put("rxjsVersion", "7.5.5"); - } else if (ngVersion.atLeast("14.0.0")) { - additionalProperties.put("rxjsVersion", "7.5.5"); - } else if (ngVersion.atLeast("13.0.0")) { - additionalProperties.put("rxjsVersion", "7.4.0"); - } else if (ngVersion.atLeast("10.0.0")) { - additionalProperties.put("rxjsVersion", "6.6.0"); - } else if (ngVersion.atLeast("9.0.0")) { - additionalProperties.put("rxjsVersion", "6.5.3"); - } + Map angularDependenciesByVersion = YamlConfigUtils.loadAsMap("typescript-angular/angularDependenciesByVersion.yaml", AngularDependencies.class); - supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json")); + AngularDependencies angularDependencies = angularDependenciesByVersion.entrySet().stream() + // we filter only config version above or equal the current one + .filter(versionMatrix -> ngVersion.atLeast(versionMatrix.getKey())) + // get can the latest version configured that match the current one + .max(Comparator.comparing(s -> new SemVer(s.getKey()))) + .map(Map.Entry::getValue) + .orElseThrow(() -> new IllegalArgumentException("Invalid ngVersion. Only Angular v9+ is supported.")); - // Specific ng-packagr configuration - if (ngVersion.atLeast("18.1.0")) { - additionalProperties.put("ngPackagrVersion", "18.1.0"); - // tsTickle is not required and there is no available version compatible with - // versions of TypeScript compatible with Angular 18. - } else if (ngVersion.atLeast("18.0.0")) { - additionalProperties.put("ngPackagrVersion", "18.0.0"); - // tsTickle is not required and there is no available version compatible with - // versions of TypeScript compatible with Angular 18. - } else if (ngVersion.atLeast("17.0.0")) { - additionalProperties.put("ngPackagrVersion", "17.0.3"); - // tsTickle is not required and there is no available version compatible with - // versions of TypeScript compatible with Angular 17. - } else if (ngVersion.atLeast("16.0.0")) { - additionalProperties.put("ngPackagrVersion", "16.0.0"); - // tsTickle is not required and there is no available version compatible with - // versions of TypeScript compatible with Angular 16. - } else if (ngVersion.atLeast("15.0.0")) { - additionalProperties.put("ngPackagrVersion", "15.0.2"); - // tsTickle is not required and there is no available version compatible with - // versions of TypeScript compatible with Angular 15. - } else if (ngVersion.atLeast("14.0.0")) { - additionalProperties.put("ngPackagrVersion", "14.0.2"); - additionalProperties.put("tsickleVersion", "0.46.3"); - } else if (ngVersion.atLeast("13.0.0")) { - additionalProperties.put("ngPackagrVersion", "13.0.3"); - additionalProperties.put("tsickleVersion", "0.43.0"); - } else if (ngVersion.atLeast("12.0.0")) { - additionalProperties.put("ngPackagrVersion", "12.2.1"); - additionalProperties.put("tsickleVersion", "0.43.0"); - } else if (ngVersion.atLeast("11.0.0")) { - additionalProperties.put("ngPackagrVersion", "11.0.2"); - additionalProperties.put("tsickleVersion", "0.39.1"); - } else if (ngVersion.atLeast("10.0.0")) { - additionalProperties.put("ngPackagrVersion", "10.0.3"); - additionalProperties.put("tsickleVersion", "0.39.1"); - } else if (ngVersion.atLeast("9.0.0")) { - additionalProperties.put("ngPackagrVersion", "9.0.1"); - additionalProperties.put("tsickleVersion", "0.38.0"); - } - - // set zone.js version - if (ngVersion.atLeast("18.0.0")) { - additionalProperties.put("zonejsVersion", "0.14.7"); - } else if (ngVersion.atLeast("17.0.0")) { - additionalProperties.put("zonejsVersion", "0.14.0"); - } else if (ngVersion.atLeast("16.0.0")) { - additionalProperties.put("zonejsVersion", "0.13.0"); - } else if (ngVersion.atLeast("15.0.0")) { - additionalProperties.put("zonejsVersion", "0.11.5"); - } else if (ngVersion.atLeast("14.0.0")) { - additionalProperties.put("zonejsVersion", "0.11.5"); - } else if (ngVersion.atLeast("12.0.0")) { - additionalProperties.put("zonejsVersion", "0.11.4"); - } else if (ngVersion.atLeast("11.0.0")) { - additionalProperties.put("zonejsVersion", "0.11.3"); - } else if (ngVersion.atLeast("9.0.0")) { - additionalProperties.put("zonejsVersion", "0.10.2"); - } else if (ngVersion.atLeast("8.0.0")) { - additionalProperties.put("zonejsVersion", "0.9.1"); + additionalProperties.put(TS_VERSION, additionalProperties.containsKey(TS_VERSION) + ? additionalProperties.containsKey(TS_VERSION) + : angularDependencies.getTsVersion()); + + additionalProperties.put(RXJS_VERSION, additionalProperties.containsKey(RXJS_VERSION) + ? additionalProperties.containsKey(RXJS_VERSION) + : angularDependencies.getRxjsVersion()); + + additionalProperties.put(NGPACKAGR_VERSION, additionalProperties.containsKey(NGPACKAGR_VERSION) + ? additionalProperties.containsKey(NGPACKAGR_VERSION) + : angularDependencies.getNgPackagrVersion()); + + additionalProperties.put("zonejsVersion", additionalProperties.containsKey(ZONEJS_VERSION) + ? additionalProperties.containsKey(ZONEJS_VERSION) + : angularDependencies.getZonejsVersion()); + + if (angularDependencies.getTsickleVersion() != null) { + additionalProperties.put("tsickleVersion", angularDependencies.getTsickleVersion()); } //Files for building our lib + supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json")); supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json")); supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json")); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/YamlConfigUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/YamlConfigUtils.java new file mode 100644 index 000000000000..eaa41f357c22 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/YamlConfigUtils.java @@ -0,0 +1,69 @@ +package org.openapitools.codegen.utils; + +import org.yaml.snakeyaml.LoaderOptions; +import org.yaml.snakeyaml.TypeDescription; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.introspector.BeanAccess; +import org.yaml.snakeyaml.nodes.MappingNode; +import org.yaml.snakeyaml.nodes.Node; +import org.yaml.snakeyaml.nodes.Tag; + +import java.io.InputStream; +import java.util.Map; +import java.util.stream.Collectors; + +public class YamlConfigUtils { + + /** + * Load yaml config file as map + * + * @param configFile yaml config file to load + * @param clazz class of object to map data + * @param type of config object to generate + * @return config object generated + */ + public static Map loadAsMap(String configFile, Class clazz) { + LoaderOptions loaderOptions = new LoaderOptions(); + loaderOptions.setAllowDuplicateKeys(false); + + Yaml yaml = new Yaml(new MapConstructor(loaderOptions, clazz)); + yaml.setBeanAccess(BeanAccess.FIELD); + InputStream inputStream = YamlConfigUtils.class + .getClassLoader() + .getResourceAsStream(configFile); + + return yaml.load(inputStream); + } + + private static class MapConstructor extends Constructor { + private final TypeDescription itemType; + + public MapConstructor(LoaderOptions loaderOptions, Class clazz) { + super(loaderOptions); + this.rootTag = new Tag("root"); + itemType = new TypeDescription(clazz); + this.addTypeDescription(itemType); + } + + @Override + protected Object constructObject(Node node) { + if ("root".equals(node.getTag().getValue()) && node instanceof MappingNode) { + MappingNode mNode = (MappingNode) node; + return mNode.getValue().stream().collect( + Collectors.toMap( + t -> super.constructObject(t.getKeyNode()), + t -> { + Node child = t.getValueNode(); + child.setType(itemType.getType()); + return super.constructObject(child); + } + ) + ); + + } else { + return super.constructObject(node); + } + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/angularDependenciesByVersion.yaml b/modules/openapi-generator/src/main/resources/typescript-angular/angularDependenciesByVersion.yaml new file mode 100644 index 000000000000..26c53f39f9f9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-angular/angularDependenciesByVersion.yaml @@ -0,0 +1,74 @@ +# For future versions... +# Get typescript and rxjs version here: https://angular.dev/reference/versions +# Get zone.js version here: https://github.com/angular/angular/blob/main/packages/core/package.json +19.0.0: + tsVersion: '>=5.5.0 <5.7.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 19.0.0 + zonejsVersion: 0.15.0 +18.1.0: + tsVersion: '>=5.4.0 <5.6.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 18.1.0 + zonejsVersion: 0.14.7 +18.0.0: + tsVersion: '>=5.4.0 <5.5.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 18.0.0 + zonejsVersion: 0.14.7 +17.0.0: + tsVersion: '>=4.9.3 <5.3.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 17.0.3 + zonejsVersion: 0.14.0 +16.1.0: + tsVersion: '>=4.9.3 <5.2.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 16.0.0 + zonejsVersion: 0.13.0 +16.0.0: + tsVersion: '>=4.9.3 <5.1.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 16.0.0 + zonejsVersion: 0.13.0 +15.0.0: + tsVersion: '>=4.8.2 <4.10.0' + rxjsVersion: 7.5.5 + ngPackagrVersion: 15.0.2 + zonejsVersion: 0.11.5 +14.0.0: + tsVersion: '>=4.6.0 <=4.8.0' + rxjsVersion: 7.5.5 + ngPackagrVersion: 14.0.2 + zonejsVersion: 0.11.5 + tsickleVersion: 0.46.3 +13.0.0: + tsVersion: '>=4.4.2 <4.5.0' + rxjsVersion: 7.4.0 + ngPackagrVersion: 13.0.3 + zonejsVersion: 0.11.4 + tsickleVersion: 0.43.0 +12.0.0: + tsVersion: '>=4.3.0 <4.4.0' + rxjsVersion: 6.6.0 + ngPackagrVersion: 12.2.1 + zonejsVersion: 0.11.4 + tsickleVersion: 0.43.0 +11.0.0: + tsVersion: '>=4.0.0 <4.1.0' + rxjsVersion: 6.6.0 + ngPackagrVersion: 11.0.2 + zonejsVersion: 0.11.3 + tsickleVersion: 0.39.1 +10.0.0: + tsVersion: '>=3.9.2 <4.0.0' + rxjsVersion: 6.6.0 + ngPackagrVersion: 10.0.3 + zonejsVersion: 0.10.2 + tsickleVersion: 0.39.1 +9.0.0: + tsVersion: '>=3.6.0 <3.8.0' + rxjsVersion: 6.5.3 + ngPackagrVersion: 9.0.1 + zonejsVersion: 0.10.2 + tsickleVersion: 0.39.1 \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index c5ca1add41ba..3d3a8dc34a01 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -35,6 +35,10 @@ public class TypeScriptAngularClientOptionsProvider implements TypeScriptSharedC public static final String SERVICE_FILE_SUFFIX = ".service"; public static final String MODEL_SUFFIX = ""; public static final String MODEL_FILE_SUFFIX = ""; + public static final String TS_VERSION = ""; + public static final String RXJS_VERSION = ""; + public static final String NGPACKAGR_VERSION = " "; + public static final String ZONEJS_VERSION = ""; @Override public String getLanguage() { @@ -61,6 +65,10 @@ public Map createOptions() { .put(TypeScriptAngularClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) .put(TypeScriptAngularClientCodegen.QUERY_PARAM_OBJECT_FORMAT, QUERY_PARAM_OBJECT_FORMAT_VALUE) .put(TypeScriptAngularClientCodegen.USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, Boolean.FALSE.toString()) + .put(TypeScriptAngularClientCodegen.TS_VERSION, TS_VERSION) + .put(TypeScriptAngularClientCodegen.RXJS_VERSION, RXJS_VERSION) + .put(TypeScriptAngularClientCodegen.NGPACKAGR_VERSION, NGPACKAGR_VERSION) + .put(TypeScriptAngularClientCodegen.ZONEJS_VERSION, ZONEJS_VERSION) .build(); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/YamlConfigUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/YamlConfigUtilsTest.java new file mode 100644 index 000000000000..e36eac81b80d --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/YamlConfigUtilsTest.java @@ -0,0 +1,45 @@ +package org.openapitools.codegen.utils; + +import lombok.Data; +import org.testng.annotations.Test; + +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +public class YamlConfigUtilsTest { + + @Test + public void testLoadConfigAsMap() { + Map yamlConfig = YamlConfigUtils.loadAsMap("yamlConfigMap.yaml", YamlConfig.class); + assertThat(yamlConfig.keySet()).containsOnly("firstItem", "secondItem"); + + YamlConfig firstItem = yamlConfig.get("firstItem"); + assertThat(firstItem.getStringConfig()).isEqualTo("Hello"); + assertThat(firstItem.getNumberConfig()).isEqualTo(42); + assertThat(firstItem.getObjectConfig().getAttribut()).isEqualTo("openapi"); + assertThat(firstItem.getArrayConfig()).hasSize(2); + assertThat(firstItem.getArrayConfig().get(0)).isEqualTo("one"); + assertThat(firstItem.getArrayConfig().get(1)).isEqualTo("two"); + + YamlConfig secondItem = yamlConfig.get("secondItem"); + assertThat(secondItem.getStringConfig()).isEqualTo("World"); + assertThat(secondItem.getNumberConfig()).isNull(); + assertThat(secondItem.getObjectConfig()).isNull(); + assertThat(secondItem.getArrayConfig()).isNull(); + } + + @Data + static class YamlConfig { + private String stringConfig; + private Integer numberConfig; + private ObjectConfig objectConfig; + private List arrayConfig; + } + + @Data + static class ObjectConfig { + private String attribut; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/yamlConfigMap.yaml b/modules/openapi-generator/src/test/resources/yamlConfigMap.yaml new file mode 100644 index 000000000000..47309d197321 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/yamlConfigMap.yaml @@ -0,0 +1,10 @@ +firstItem: + stringConfig: 'Hello' + numberConfig: 42 + objectConfig: + attribut: 'openapi' + arrayConfig: + - 'one' + - 'two' +secondItem: + stringConfig: 'World' \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7bdf939e375e..65aa5564bca4 100644 --- a/pom.xml +++ b/pom.xml @@ -1246,6 +1246,7 @@ 1.4 4.6.1 1.7.36 + 2.3 3.1.12.2 io.swagger.parser.v3 2.1.22 diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/.gitignore b/samples/client/petstore/typescript-angular-v19-provided-in-root/.gitignore new file mode 100644 index 000000000000..cc7b141350ff --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/.gitignore @@ -0,0 +1,42 @@ +# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. + +# Compiled output +/dist +/tmp +/out-tsc +/bazel-out + +# Node +/node_modules +npm-debug.log +yarn-error.log + +# IDEs and editors +.idea/ +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# Miscellaneous +/.angular/cache +.sass-cache/ +/connect.lock +/coverage +/libpeerconnection.log +testem.log +/typings + +# System files +.DS_Store +Thumbs.db diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/angular.json b/samples/client/petstore/typescript-angular-v19-provided-in-root/angular.json new file mode 100644 index 000000000000..32e4aacf6c98 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/angular.json @@ -0,0 +1,96 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "typescript-angular-v19-unit-tests": { + "projectType": "application", + "schematics": {}, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/typescript-angular-v19-unit-tests", + "index": "src/index.html", + "browser": "src/main.ts", + "polyfills": [ + "zone.js" + ], + "tsConfig": "tsconfig.app.json", + "assets": [ + { + "glob": "**/*", + "input": "public" + } + ], + "styles": [ + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kB", + "maximumError": "1MB" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "4kB", + "maximumError": "8kB" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "typescript-angular-v19-unit-tests:build:production" + }, + "development": { + "buildTarget": "typescript-angular-v19-unit-tests:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n" + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "polyfills": [ + "zone.js", + "zone.js/testing" + ], + "tsConfig": "tsconfig.spec.json", + "assets": [ + { + "glob": "**/*", + "input": "public" + } + ], + "styles": [ + "src/styles.css" + ], + "scripts": [] + } + } + } + } + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..6e213a61aa6e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +param.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 000000000000..884119126398 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md new file mode 100644 index 000000000000..6653fc45df74 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md @@ -0,0 +1,236 @@ +# @ + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +The version of the OpenAPI document: 1.0.0 + +## Building + +To install the required dependencies and to build the typescript sources run: + +```console +npm install +npm run build +``` + +## Publishing + +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) + +## Consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +```console +npm install @ --save +``` + +_without publishing (not recommended):_ + +```console +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: + +```console +npm link +``` + +In your project: + +```console +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue for a solution / workaround. +Published packages are not effected by this issue. + +### General usage + +In your Angular project: + +```typescript +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +```typescript +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +```typescript +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +```typescript +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +### Using multiple OpenAPI files / APIs / ApiModules + +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: + +```typescript +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + +### Set service base path + +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +```typescript +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` + +or + +```typescript +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +### Using @angular/cli + +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +```typescript +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: + +```typescript +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: + +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api.module.ts new file mode 100644 index 000000000000..58d341fbd2e5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 000000000000..e4c401a2a64f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,781 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiResponse } from '../model/apiResponse'; +// @ts-ignore +import { Pet } from '../model/pet'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pet, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + [...status].join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/findByStatus`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + [...tags].join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/findByTags`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pet, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 000000000000..b3ab6eb55b04 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,367 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { Order } from '../model/order'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/inventory`; + return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: order, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 000000000000..316ece2e354d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,706 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { User } from '../model/user'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUser(user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithArrayInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/createWithArray`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithListInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/createWithList`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/login`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/logout`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts new file mode 100644 index 000000000000..4ad26d0bdcb9 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,186 @@ +import { HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.encodeParam) { + this.encodeParam = configurationParameters.encodeParam; + } + else { + this.encodeParam = param => this.defaultEncodeParam(param); + } + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/index.ts new file mode 100644 index 000000000000..104dd3d21e35 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/index.ts @@ -0,0 +1,6 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './param'; diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 000000000000..113ad7e11782 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,20 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/category.ts new file mode 100644 index 000000000000..c070dd83996c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,19 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts new file mode 100644 index 000000000000..5d9a0e440787 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,35 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 000000000000..b6971b3e5143 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,38 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + * @deprecated + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 000000000000..92a76d13dbb9 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,19 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/user.ts new file mode 100644 index 000000000000..ac591c5d45ad --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,28 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/param.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/param.ts new file mode 100644 index 000000000000..78a2d20a6433 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/package-lock.json b/samples/client/petstore/typescript-angular-v19-provided-in-root/package-lock.json new file mode 100644 index 000000000000..e0c70bf504cc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/package-lock.json @@ -0,0 +1,15104 @@ +{ + "name": "typescript-angular-v19-unit-tests", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "typescript-angular-v19-unit-tests", + "version": "0.0.0", + "dependencies": { + "@angular/animations": "^19.0.0", + "@angular/common": "^19.0.0", + "@angular/compiler": "^19.0.0", + "@angular/core": "^19.0.0", + "@angular/forms": "^19.0.0", + "@angular/platform-browser": "^19.0.0", + "@angular/platform-browser-dynamic": "^19.0.0", + "@angular/router": "^19.0.0", + "rxjs": "~7.8.0", + "tslib": "^2.3.0", + "zone.js": "~0.15.0" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^19.0.2", + "@angular/cli": "^19.0.2", + "@angular/compiler-cli": "^19.0.0", + "@types/jasmine": "~5.1.0", + "jasmine-core": "~5.4.0", + "karma": "~6.4.0", + "karma-chrome-launcher": "~3.2.0", + "karma-coverage": "~2.2.0", + "karma-jasmine": "~5.1.0", + "karma-jasmine-html-reporter": "~2.1.0", + "typescript": "~5.6.2" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@angular-devkit/architect": { + "version": "0.1900.2", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1900.2.tgz", + "integrity": "sha512-rGUgOgN/jb3Pyx3E1JsUbwQQZp4C0M/t0lwyWIFjUpndl27aBDjO2y5hzeG0B1+FgOuSNg8BPOYaEIO5vSCspw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "19.0.2", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular-devkit/build-angular": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-19.0.2.tgz", + "integrity": "sha512-F7wwo0fVshrlnTyBuqP6abt95soOsO+H/dYLn0JVud+SXhbSXpKDxZovlIBUKh1kj0BXny7erTYHmPWVtZpfsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "2.3.0", + "@angular-devkit/architect": "0.1900.2", + "@angular-devkit/build-webpack": "0.1900.2", + "@angular-devkit/core": "19.0.2", + "@angular/build": "19.0.2", + "@babel/core": "7.26.0", + "@babel/generator": "7.26.2", + "@babel/helper-annotate-as-pure": "7.25.9", + "@babel/helper-split-export-declaration": "7.24.7", + "@babel/plugin-transform-async-generator-functions": "7.25.9", + "@babel/plugin-transform-async-to-generator": "7.25.9", + "@babel/plugin-transform-runtime": "7.25.9", + "@babel/preset-env": "7.26.0", + "@babel/runtime": "7.26.0", + "@discoveryjs/json-ext": "0.6.3", + "@ngtools/webpack": "19.0.2", + "@vitejs/plugin-basic-ssl": "1.1.0", + "ansi-colors": "4.1.3", + "autoprefixer": "10.4.20", + "babel-loader": "9.2.1", + "browserslist": "^4.21.5", + "copy-webpack-plugin": "12.0.2", + "css-loader": "7.1.2", + "esbuild-wasm": "0.24.0", + "fast-glob": "3.3.2", + "http-proxy-middleware": "3.0.3", + "istanbul-lib-instrument": "6.0.3", + "jsonc-parser": "3.3.1", + "karma-source-map-support": "1.4.0", + "less": "4.2.0", + "less-loader": "12.2.0", + "license-webpack-plugin": "4.0.2", + "loader-utils": "3.3.1", + "mini-css-extract-plugin": "2.9.2", + "open": "10.1.0", + "ora": "5.4.1", + "picomatch": "4.0.2", + "piscina": "4.7.0", + "postcss": "8.4.49", + "postcss-loader": "8.1.1", + "resolve-url-loader": "5.0.0", + "rxjs": "7.8.1", + "sass": "1.80.7", + "sass-loader": "16.0.3", + "semver": "7.6.3", + "source-map-loader": "5.0.0", + "source-map-support": "0.5.21", + "terser": "5.36.0", + "tree-kill": "1.2.2", + "tslib": "2.8.1", + "webpack": "5.96.1", + "webpack-dev-middleware": "7.4.2", + "webpack-dev-server": "5.1.0", + "webpack-merge": "6.0.1", + "webpack-subresource-integrity": "5.1.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "optionalDependencies": { + "esbuild": "0.24.0" + }, + "peerDependencies": { + "@angular/compiler-cli": "^19.0.0", + "@angular/localize": "^19.0.0", + "@angular/platform-server": "^19.0.0", + "@angular/service-worker": "^19.0.0", + "@angular/ssr": "^19.0.2", + "@web/test-runner": "^0.19.0", + "browser-sync": "^3.0.2", + "jest": "^29.5.0", + "jest-environment-jsdom": "^29.5.0", + "karma": "^6.3.0", + "ng-packagr": "^19.0.0", + "protractor": "^7.0.0", + "tailwindcss": "^2.0.0 || ^3.0.0", + "typescript": ">=5.5 <5.7" + }, + "peerDependenciesMeta": { + "@angular/localize": { + "optional": true + }, + "@angular/platform-server": { + "optional": true + }, + "@angular/service-worker": { + "optional": true + }, + "@angular/ssr": { + "optional": true + }, + "@web/test-runner": { + "optional": true + }, + "browser-sync": { + "optional": true + }, + "jest": { + "optional": true + }, + "jest-environment-jsdom": { + "optional": true + }, + "karma": { + "optional": true + }, + "ng-packagr": { + "optional": true + }, + "protractor": { + "optional": true + }, + "tailwindcss": { + "optional": true + } + } + }, + "node_modules/@angular-devkit/build-webpack": { + "version": "0.1900.2", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1900.2.tgz", + "integrity": "sha512-4JHkY6908YsIWh9FM/6ihsVZyWAM4/C91D8S4v/aZhVLt37HwTAxbecPbYNbexgDca81LI5TAqR8cwb0syIkWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/architect": "0.1900.2", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "webpack": "^5.30.0", + "webpack-dev-server": "^5.0.2" + } + }, + "node_modules/@angular-devkit/core": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-19.0.2.tgz", + "integrity": "sha512-p5pTx9rAtJUfoa7BP6R5U7dGFWHrrgpYpVyF3jwqYIu0h1C0rJIyY8q/HlkvzFxgfWag1qRf15oANq3G9fqdwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "8.17.1", + "ajv-formats": "3.0.1", + "jsonc-parser": "3.3.1", + "picomatch": "4.0.2", + "rxjs": "7.8.1", + "source-map": "0.7.4" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^4.0.0" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "node_modules/@angular-devkit/schematics": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-19.0.2.tgz", + "integrity": "sha512-bwq8ReC92gGFTd2BeNBWCnOqIKu2YKNvwMVc7dl+D154WO2gzCaK2J5nL97qm5EjoUoXgvFRs84ysSAnLFzBxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "19.0.2", + "jsonc-parser": "3.3.1", + "magic-string": "0.30.12", + "ora": "5.4.1", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular/animations": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-19.0.1.tgz", + "integrity": "sha512-1TZ3meVmoMuQwXaHSCeIGq8tmGcwobCQM2AQ6hfK+j6eyWTSx8BdWWi+Z1iIjiYFx3pJljQiWLAHULZ66Ep/GQ==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/core": "19.0.1" + } + }, + "node_modules/@angular/build": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@angular/build/-/build-19.0.2.tgz", + "integrity": "sha512-i2mSg9ZoPto3IMNi/HnP2ZOwvcmaPEKrS7EOYeu1m1W9InuZ55ssMqrjKpeohKVYHwep8QmFrmDERbqutaN2hg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "2.3.0", + "@angular-devkit/architect": "0.1900.2", + "@babel/core": "7.26.0", + "@babel/helper-annotate-as-pure": "7.25.9", + "@babel/helper-split-export-declaration": "7.24.7", + "@babel/plugin-syntax-import-attributes": "7.26.0", + "@inquirer/confirm": "5.0.2", + "@vitejs/plugin-basic-ssl": "1.1.0", + "beasties": "0.1.0", + "browserslist": "^4.23.0", + "esbuild": "0.24.0", + "fast-glob": "3.3.2", + "https-proxy-agent": "7.0.5", + "istanbul-lib-instrument": "6.0.3", + "listr2": "8.2.5", + "magic-string": "0.30.12", + "mrmime": "2.0.0", + "parse5-html-rewriting-stream": "7.0.0", + "picomatch": "4.0.2", + "piscina": "4.7.0", + "rollup": "4.26.0", + "sass": "1.80.7", + "semver": "7.6.3", + "vite": "5.4.11", + "watchpack": "2.4.2" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "optionalDependencies": { + "lmdb": "3.1.5" + }, + "peerDependencies": { + "@angular/compiler": "^19.0.0", + "@angular/compiler-cli": "^19.0.0", + "@angular/localize": "^19.0.0", + "@angular/platform-server": "^19.0.0", + "@angular/service-worker": "^19.0.0", + "@angular/ssr": "^19.0.2", + "less": "^4.2.0", + "postcss": "^8.4.0", + "tailwindcss": "^2.0.0 || ^3.0.0", + "typescript": ">=5.5 <5.7" + }, + "peerDependenciesMeta": { + "@angular/localize": { + "optional": true + }, + "@angular/platform-server": { + "optional": true + }, + "@angular/service-worker": { + "optional": true + }, + "@angular/ssr": { + "optional": true + }, + "less": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tailwindcss": { + "optional": true + } + } + }, + "node_modules/@angular/cli": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-19.0.2.tgz", + "integrity": "sha512-TlPrs3hRkHWrQEKwHde9l2F4IgT5tWTx4zFcllzBh2dW9iRpqXSYRb82xNHsbopdAu4lXjsYl7JilV2DQPZEaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/architect": "0.1900.2", + "@angular-devkit/core": "19.0.2", + "@angular-devkit/schematics": "19.0.2", + "@inquirer/prompts": "7.1.0", + "@listr2/prompt-adapter-inquirer": "2.0.18", + "@schematics/angular": "19.0.2", + "@yarnpkg/lockfile": "1.1.0", + "ini": "5.0.0", + "jsonc-parser": "3.3.1", + "listr2": "8.2.5", + "npm-package-arg": "12.0.0", + "npm-pick-manifest": "10.0.0", + "pacote": "20.0.0", + "resolve": "1.22.8", + "semver": "7.6.3", + "symbol-observable": "4.0.0", + "yargs": "17.7.2" + }, + "bin": { + "ng": "bin/ng.js" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular/common": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-19.0.1.tgz", + "integrity": "sha512-FWAyHlEhPeLHvNLuzSl2rlksK/fVVB5O3soBYOeiKScN1vlAdALbwPDIHhimhNFBV8kmtc144WjkcTxt8MK/4g==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/core": "19.0.1", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/compiler": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-19.0.1.tgz", + "integrity": "sha512-loyI701+As+sWsE4yr9HpIPBqIohpNrGby/hsXtr+zJTMUWp/sKZlavctVtUsWWJhwHMevoybdgd3N9NY97F7g==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/core": "19.0.1" + }, + "peerDependenciesMeta": { + "@angular/core": { + "optional": true + } + } + }, + "node_modules/@angular/compiler-cli": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-19.0.1.tgz", + "integrity": "sha512-dIpJCRPmmgmPyAqkOwhP4IEj+T5H4s3x39sCCBohqr2mlZcTXp/Fir8CXnMHlzawh4eXm4pvHjvh/bmMH4efrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "7.26.0", + "@jridgewell/sourcemap-codec": "^1.4.14", + "chokidar": "^4.0.0", + "convert-source-map": "^1.5.1", + "reflect-metadata": "^0.2.0", + "semver": "^7.0.0", + "tslib": "^2.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "ng-xi18n": "bundles/src/bin/ng_xi18n.js", + "ngc": "bundles/src/bin/ngc.js", + "ngcc": "bundles/ngcc/index.js" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/compiler": "19.0.1", + "typescript": ">=5.5 <5.7" + } + }, + "node_modules/@angular/core": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-19.0.1.tgz", + "integrity": "sha512-+VpWcg2aC/dY9TM6fsj00enZ6RP5wpRqk/SeRe3UP3Je/n+vWIgHJTb1ZLNeOIvDaE86BhKPMwFS0QVjoEGQFA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "rxjs": "^6.5.3 || ^7.4.0", + "zone.js": "~0.15.0" + } + }, + "node_modules/@angular/forms": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-19.0.1.tgz", + "integrity": "sha512-PNMQVi97ZK9X7fQeO1li6LxoL9U6v7ByC+4kj7xHAcOGaBCB+EJ/ZPKCKeaGn4G7mJd3iH8SMVzoUQc028KIcw==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/common": "19.0.1", + "@angular/core": "19.0.1", + "@angular/platform-browser": "19.0.1", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/platform-browser": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-19.0.1.tgz", + "integrity": "sha512-ycl6GsK5avKz2PKyKR8G3eqH5rWdzTqRfYStN+1Ufhopx9jmCQ9r0JSIekoHJ8W2KDZfojWp6f4izDMvKnUpvA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/animations": "19.0.1", + "@angular/common": "19.0.1", + "@angular/core": "19.0.1" + }, + "peerDependenciesMeta": { + "@angular/animations": { + "optional": true + } + } + }, + "node_modules/@angular/platform-browser-dynamic": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-19.0.1.tgz", + "integrity": "sha512-A8sM0NTwZPFpv5kWSUeRhMENCw8kmBxR9CX9TMVeU6u9TP+IT3SFhUWhDQZNbmJAHhyAuk5B1gBJ/aoz0/OBcw==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/common": "19.0.1", + "@angular/compiler": "19.0.1", + "@angular/core": "19.0.1", + "@angular/platform-browser": "19.0.1" + } + }, + "node_modules/@angular/router": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-19.0.1.tgz", + "integrity": "sha512-/9f7RxVqOTASFhpqla7x9V58SE8Yv4SClKRikvv5Tn5EGDbSVR3DgGu6qENP57A2pVPW4Ho5er5KKT35HjhcFw==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/common": "19.0.1", + "@angular/core": "19.0.1", + "@angular/platform-browser": "19.0.1", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", + "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", + "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.2", + "@babel/types": "^7.26.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz", + "integrity": "sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", + "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", + "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/traverse": "^7.25.9", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz", + "integrity": "sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "regexpu-core": "^6.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz", + "integrity": "sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", + "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", + "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz", + "integrity": "sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-wrap-function": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", + "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz", + "integrity": "sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", + "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz", + "integrity": "sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz", + "integrity": "sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz", + "integrity": "sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz", + "integrity": "sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz", + "integrity": "sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/plugin-transform-optional-chaining": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz", + "integrity": "sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz", + "integrity": "sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz", + "integrity": "sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz", + "integrity": "sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-remap-async-to-generator": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz", + "integrity": "sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-remap-async-to-generator": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz", + "integrity": "sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz", + "integrity": "sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz", + "integrity": "sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz", + "integrity": "sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz", + "integrity": "sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/traverse": "^7.25.9", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz", + "integrity": "sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/template": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz", + "integrity": "sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz", + "integrity": "sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz", + "integrity": "sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz", + "integrity": "sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz", + "integrity": "sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz", + "integrity": "sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz", + "integrity": "sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz", + "integrity": "sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz", + "integrity": "sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz", + "integrity": "sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz", + "integrity": "sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz", + "integrity": "sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz", + "integrity": "sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz", + "integrity": "sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz", + "integrity": "sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-simple-access": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz", + "integrity": "sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz", + "integrity": "sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz", + "integrity": "sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz", + "integrity": "sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz", + "integrity": "sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz", + "integrity": "sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz", + "integrity": "sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/plugin-transform-parameters": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz", + "integrity": "sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz", + "integrity": "sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz", + "integrity": "sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz", + "integrity": "sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz", + "integrity": "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz", + "integrity": "sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz", + "integrity": "sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz", + "integrity": "sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "regenerator-transform": "^0.15.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regexp-modifiers": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz", + "integrity": "sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz", + "integrity": "sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.25.9.tgz", + "integrity": "sha512-nZp7GlEl+yULJrClz0SwHPqir3lc0zsPrDHQUcxGspSL7AKrexNSEfTbfqnDNJUO13bgKyfuOLMF8Xqtu8j3YQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.6", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz", + "integrity": "sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz", + "integrity": "sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz", + "integrity": "sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz", + "integrity": "sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz", + "integrity": "sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz", + "integrity": "sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz", + "integrity": "sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz", + "integrity": "sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz", + "integrity": "sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz", + "integrity": "sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.9", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.9", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.9", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-import-assertions": "^7.26.0", + "@babel/plugin-syntax-import-attributes": "^7.26.0", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.25.9", + "@babel/plugin-transform-async-generator-functions": "^7.25.9", + "@babel/plugin-transform-async-to-generator": "^7.25.9", + "@babel/plugin-transform-block-scoped-functions": "^7.25.9", + "@babel/plugin-transform-block-scoping": "^7.25.9", + "@babel/plugin-transform-class-properties": "^7.25.9", + "@babel/plugin-transform-class-static-block": "^7.26.0", + "@babel/plugin-transform-classes": "^7.25.9", + "@babel/plugin-transform-computed-properties": "^7.25.9", + "@babel/plugin-transform-destructuring": "^7.25.9", + "@babel/plugin-transform-dotall-regex": "^7.25.9", + "@babel/plugin-transform-duplicate-keys": "^7.25.9", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9", + "@babel/plugin-transform-dynamic-import": "^7.25.9", + "@babel/plugin-transform-exponentiation-operator": "^7.25.9", + "@babel/plugin-transform-export-namespace-from": "^7.25.9", + "@babel/plugin-transform-for-of": "^7.25.9", + "@babel/plugin-transform-function-name": "^7.25.9", + "@babel/plugin-transform-json-strings": "^7.25.9", + "@babel/plugin-transform-literals": "^7.25.9", + "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", + "@babel/plugin-transform-member-expression-literals": "^7.25.9", + "@babel/plugin-transform-modules-amd": "^7.25.9", + "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/plugin-transform-modules-systemjs": "^7.25.9", + "@babel/plugin-transform-modules-umd": "^7.25.9", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9", + "@babel/plugin-transform-new-target": "^7.25.9", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9", + "@babel/plugin-transform-numeric-separator": "^7.25.9", + "@babel/plugin-transform-object-rest-spread": "^7.25.9", + "@babel/plugin-transform-object-super": "^7.25.9", + "@babel/plugin-transform-optional-catch-binding": "^7.25.9", + "@babel/plugin-transform-optional-chaining": "^7.25.9", + "@babel/plugin-transform-parameters": "^7.25.9", + "@babel/plugin-transform-private-methods": "^7.25.9", + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@babel/plugin-transform-property-literals": "^7.25.9", + "@babel/plugin-transform-regenerator": "^7.25.9", + "@babel/plugin-transform-regexp-modifiers": "^7.26.0", + "@babel/plugin-transform-reserved-words": "^7.25.9", + "@babel/plugin-transform-shorthand-properties": "^7.25.9", + "@babel/plugin-transform-spread": "^7.25.9", + "@babel/plugin-transform-sticky-regex": "^7.25.9", + "@babel/plugin-transform-template-literals": "^7.25.9", + "@babel/plugin-transform-typeof-symbol": "^7.25.9", + "@babel/plugin-transform-unicode-escapes": "^7.25.9", + "@babel/plugin-transform-unicode-property-regex": "^7.25.9", + "@babel/plugin-transform-unicode-regex": "^7.25.9", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.9", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.6", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.38.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.6.3.tgz", + "integrity": "sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/checkbox": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.2.tgz", + "integrity": "sha512-+gznPl8ip8P8HYHYecDtUtdsh1t2jvb+sWCD72GAiZ9m45RqwrLmReDaqdC0umQfamtFXVRoMVJ2/qINKGm9Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/confirm": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.2.tgz", + "integrity": "sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.0.tgz", + "integrity": "sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2", + "cli-width": "^4.1.0", + "mute-stream": "^2.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/editor": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.1.0.tgz", + "integrity": "sha512-K1gGWsxEqO23tVdp5MT3H799OZ4ER1za7Dlc8F4um0W7lwSv0KGR/YyrUEyimj0g7dXZd8XknM/5QA2/Uy+TbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "external-editor": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/expand": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.2.tgz", + "integrity": "sha512-WdgCX1cUtinz+syKyZdJomovULYlKUWZbVYZzhf+ZeeYf4htAQ3jLymoNs3koIAKfZZl3HUBb819ClCBfyznaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.8.tgz", + "integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/input": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.0.2.tgz", + "integrity": "sha512-yCLCraigU085EcdpIVEDgyfGv4vBiE4I+k1qRkc9C5dMjWF42ADMGy1RFU94+eZlz4YlkmFsiyHZy0W1wdhaNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/number": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.2.tgz", + "integrity": "sha512-MKQhYofdUNk7eqJtz52KvM1dH6R93OMrqHduXCvuefKrsiMjHiMwjc3NZw5Imm2nqY7gWd9xdhYrtcHMJQZUxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/password": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.2.tgz", + "integrity": "sha512-tQXGSu7IO07gsYlGy3VgXRVsbOWqFBMbqAUrJSc1PDTQQ5Qdm+QVwkP0OC0jnUZ62D19iPgXOMO+tnWG+HhjNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/prompts": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.1.0.tgz", + "integrity": "sha512-5U/XiVRH2pp1X6gpNAjWOglMf38/Ys522ncEHIKT1voRUvSj/DQnR22OVxHnwu5S+rCFaUiPQ57JOtMFQayqYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/checkbox": "^4.0.2", + "@inquirer/confirm": "^5.0.2", + "@inquirer/editor": "^4.1.0", + "@inquirer/expand": "^4.0.2", + "@inquirer/input": "^4.0.2", + "@inquirer/number": "^3.0.2", + "@inquirer/password": "^4.0.2", + "@inquirer/rawlist": "^4.0.2", + "@inquirer/search": "^3.0.2", + "@inquirer/select": "^4.0.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/rawlist": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.2.tgz", + "integrity": "sha512-3XGcskMoVF8H0Dl1S5TSZ3rMPPBWXRcM0VeNVsS4ByWeWjSeb0lPqfnBg6N7T0608I1B2bSVnbi2cwCrmOD1Yw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/search": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.0.2.tgz", + "integrity": "sha512-Zv4FC7w4dJ13BOJfKRQCICQfShinGjb1bCEIHxTSnjj2telu3+3RHwHubPG9HyD4aix5s+lyAMEK/wSFD75HLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/select": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.2.tgz", + "integrity": "sha512-uSWUzaSYAEj0hlzxa1mUB6VqrKaYx0QxGBLZzU4xWFxaSyGaXxsSE4OSOwdU24j0xl8OajgayqFXW0l2bkl2kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz", + "integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@jsonjoy.com/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/@jsonjoy.com/json-pack": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz", + "integrity": "sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jsonjoy.com/base64": "^1.1.1", + "@jsonjoy.com/util": "^1.1.2", + "hyperdyperid": "^1.2.0", + "thingies": "^1.20.0" + }, + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/@jsonjoy.com/util": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.5.0.tgz", + "integrity": "sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@listr2/prompt-adapter-inquirer": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@listr2/prompt-adapter-inquirer/-/prompt-adapter-inquirer-2.0.18.tgz", + "integrity": "sha512-0hz44rAcrphyXcA8IS7EJ2SCoaBZD2u5goE8S/e+q/DL+dOGpqpcLidVOFeLG3VgML62SXmfRLAhWt0zL1oW4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/type": "^1.5.5" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@inquirer/prompts": ">= 3 < 8" + } + }, + "node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.5.5.tgz", + "integrity": "sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@listr2/prompt-adapter-inquirer/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@lmdb/lmdb-darwin-arm64": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-3.1.5.tgz", + "integrity": "sha512-ue5PSOzHMCIYrfvPP/MRS6hsKKLzqqhcdAvJCO8uFlDdj598EhgnacuOTuqA6uBK5rgiZXfDWyb7DVZSiBKxBA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@lmdb/lmdb-darwin-x64": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-3.1.5.tgz", + "integrity": "sha512-CGhsb0R5vE6mMNCoSfxHFD8QTvBHM51gs4DBeigTYHWnYv2V5YpJkC4rMo5qAAFifuUcc0+a8a3SIU0c9NrfNw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@lmdb/lmdb-linux-arm": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-3.1.5.tgz", + "integrity": "sha512-3WeW328DN+xB5PZdhSWmqE+t3+44xWXEbqQ+caWJEZfOFdLp9yklBZEbVqVdqzznkoaXJYxTCp996KD6HmANeg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@lmdb/lmdb-linux-arm64": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-3.1.5.tgz", + "integrity": "sha512-LAjaoOcBHGj6fiYB8ureiqPoph4eygbXu4vcOF+hsxiY74n8ilA7rJMmGUT0K0JOB5lmRQHSmor3mytRjS4qeQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@lmdb/lmdb-linux-x64": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-3.1.5.tgz", + "integrity": "sha512-k/IklElP70qdCXOQixclSl2GPLFiopynGoKX1FqDd1/H0E3Fo1oPwjY2rEVu+0nS3AOw1sryStdXk8CW3cVIsw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@lmdb/lmdb-win32-x64": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-3.1.5.tgz", + "integrity": "sha512-KYar6W8nraZfSJspcK7Kp7hdj238X/FNauYbZyrqPBrtsXI1hvI4/KcRcRGP50aQoV7fkKDyJERlrQGMGTZUsA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", + "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz", + "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz", + "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz", + "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz", + "integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz", + "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@napi-rs/nice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice/-/nice-1.0.1.tgz", + "integrity": "sha512-zM0mVWSXE0a0h9aKACLwKmD6nHcRiKrPpCfvaKqG1CqDEyjEawId0ocXxVzPMCAm6kkWr2P025msfxXEnt8UGQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@napi-rs/nice-android-arm-eabi": "1.0.1", + "@napi-rs/nice-android-arm64": "1.0.1", + "@napi-rs/nice-darwin-arm64": "1.0.1", + "@napi-rs/nice-darwin-x64": "1.0.1", + "@napi-rs/nice-freebsd-x64": "1.0.1", + "@napi-rs/nice-linux-arm-gnueabihf": "1.0.1", + "@napi-rs/nice-linux-arm64-gnu": "1.0.1", + "@napi-rs/nice-linux-arm64-musl": "1.0.1", + "@napi-rs/nice-linux-ppc64-gnu": "1.0.1", + "@napi-rs/nice-linux-riscv64-gnu": "1.0.1", + "@napi-rs/nice-linux-s390x-gnu": "1.0.1", + "@napi-rs/nice-linux-x64-gnu": "1.0.1", + "@napi-rs/nice-linux-x64-musl": "1.0.1", + "@napi-rs/nice-win32-arm64-msvc": "1.0.1", + "@napi-rs/nice-win32-ia32-msvc": "1.0.1", + "@napi-rs/nice-win32-x64-msvc": "1.0.1" + } + }, + "node_modules/@napi-rs/nice-android-arm-eabi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm-eabi/-/nice-android-arm-eabi-1.0.1.tgz", + "integrity": "sha512-5qpvOu5IGwDo7MEKVqqyAxF90I6aLj4n07OzpARdgDRfz8UbBztTByBp0RC59r3J1Ij8uzYi6jI7r5Lws7nn6w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-android-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm64/-/nice-android-arm64-1.0.1.tgz", + "integrity": "sha512-GqvXL0P8fZ+mQqG1g0o4AO9hJjQaeYG84FRfZaYjyJtZZZcMjXW5TwkL8Y8UApheJgyE13TQ4YNUssQaTgTyvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-arm64/-/nice-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-91k3HEqUl2fsrz/sKkuEkscj6EAj3/eZNCLqzD2AA0TtVbkQi8nqxZCZDMkfklULmxLkMxuUdKe7RvG/T6s2AA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-x64/-/nice-darwin-x64-1.0.1.tgz", + "integrity": "sha512-jXnMleYSIR/+TAN/p5u+NkCA7yidgswx5ftqzXdD5wgy/hNR92oerTXHc0jrlBisbd7DpzoaGY4cFD7Sm5GlgQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-freebsd-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-freebsd-x64/-/nice-freebsd-x64-1.0.1.tgz", + "integrity": "sha512-j+iJ/ezONXRQsVIB/FJfwjeQXX7A2tf3gEXs4WUGFrJjpe/z2KB7sOv6zpkm08PofF36C9S7wTNuzHZ/Iiccfw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm-gnueabihf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm-gnueabihf/-/nice-linux-arm-gnueabihf-1.0.1.tgz", + "integrity": "sha512-G8RgJ8FYXYkkSGQwywAUh84m946UTn6l03/vmEXBYNJxQJcD+I3B3k5jmjFG/OPiU8DfvxutOP8bi+F89MCV7Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-gnu/-/nice-linux-arm64-gnu-1.0.1.tgz", + "integrity": "sha512-IMDak59/W5JSab1oZvmNbrms3mHqcreaCeClUjwlwDr0m3BoR09ZiN8cKFBzuSlXgRdZ4PNqCYNeGQv7YMTjuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-musl/-/nice-linux-arm64-musl-1.0.1.tgz", + "integrity": "sha512-wG8fa2VKuWM4CfjOjjRX9YLIbysSVV1S3Kgm2Fnc67ap/soHBeYZa6AGMeR5BJAylYRjnoVOzV19Cmkco3QEPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-ppc64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-ppc64-gnu/-/nice-linux-ppc64-gnu-1.0.1.tgz", + "integrity": "sha512-lxQ9WrBf0IlNTCA9oS2jg/iAjQyTI6JHzABV664LLrLA/SIdD+I1i3Mjf7TsnoUbgopBcCuDztVLfJ0q9ubf6Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-riscv64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-riscv64-gnu/-/nice-linux-riscv64-gnu-1.0.1.tgz", + "integrity": "sha512-3xs69dO8WSWBb13KBVex+yvxmUeEsdWexxibqskzoKaWx9AIqkMbWmE2npkazJoopPKX2ULKd8Fm9veEn0g4Ig==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-s390x-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-s390x-gnu/-/nice-linux-s390x-gnu-1.0.1.tgz", + "integrity": "sha512-lMFI3i9rlW7hgToyAzTaEybQYGbQHDrpRkg+1gJWEpH0PLAQoZ8jiY0IzakLfNWnVda1eTYYlxxFYzW8Rqczkg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-x64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-gnu/-/nice-linux-x64-gnu-1.0.1.tgz", + "integrity": "sha512-XQAJs7DRN2GpLN6Fb+ZdGFeYZDdGl2Fn3TmFlqEL5JorgWKrQGRUrpGKbgZ25UeZPILuTKJ+OowG2avN8mThBA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-x64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-musl/-/nice-linux-x64-musl-1.0.1.tgz", + "integrity": "sha512-/rodHpRSgiI9o1faq9SZOp/o2QkKQg7T+DK0R5AkbnI/YxvAIEHf2cngjYzLMQSQgUhxym+LFr+UGZx4vK4QdQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-arm64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-arm64-msvc/-/nice-win32-arm64-msvc-1.0.1.tgz", + "integrity": "sha512-rEcz9vZymaCB3OqEXoHnp9YViLct8ugF+6uO5McifTedjq4QMQs3DHz35xBEGhH3gJWEsXMUbzazkz5KNM5YUg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-ia32-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-ia32-msvc/-/nice-win32-ia32-msvc-1.0.1.tgz", + "integrity": "sha512-t7eBAyPUrWL8su3gDxw9xxxqNwZzAqKo0Szv3IjVQd1GpXXVkb6vBBQUuxfIYaXMzZLwlxRQ7uzM2vdUE9ULGw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-x64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-x64-msvc/-/nice-win32-x64-msvc-1.0.1.tgz", + "integrity": "sha512-JlF+uDcatt3St2ntBG8H02F1mM45i5SF9W+bIKiReVE6wiy3o16oBP/yxt+RZ+N6LbCImJXJ6bXNO2kn9AXicg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ngtools/webpack": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-19.0.2.tgz", + "integrity": "sha512-wHAIItix6zAOczdLjY9Z/e4mtpBDSzBkN//N6GHoGtjtCSzqZg4uPg5KG7B5tpVb/u6IMRK+4hhu9Vu8lhzz8g==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "@angular/compiler-cli": "^19.0.0", + "typescript": ">=5.5 <5.7", + "webpack": "^5.54.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/agent": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.2.tgz", + "integrity": "sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/agent/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/git": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-6.0.1.tgz", + "integrity": "sha512-BBWMMxeQzalmKadyimwb2/VVQyJB01PH0HhVSNLHNBDZN/M/h/02P6f8fxedIiFhpMj11SO9Ep5tKTBE7zL2nw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/promise-spawn": "^8.0.0", + "ini": "^5.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^10.0.0", + "proc-log": "^5.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/git/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/git/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@npmcli/git/node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-3.0.0.tgz", + "integrity": "sha512-fkxoPuFGvxyrH+OQzyTkX2LUEamrF4jZSmxjAtPPHHGO0dqsQ8tTKjnIS8SAnPHdk2I03BDtSMR5K/4loKg79Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-bundled": "^4.0.0", + "npm-normalize-package-bin": "^4.0.0" + }, + "bin": { + "installed-package-contents": "bin/index.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/node-gyp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-4.0.0.tgz", + "integrity": "sha512-+t5DZ6mO/QFh78PByMq1fGSAub/agLJZDRfJRMeOSNCt8s9YVlTjmGpIPwPhvXTGUIJk+WszlT0rQa1W33yzNA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/package-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-6.1.0.tgz", + "integrity": "sha512-t6G+6ZInT4X+tqj2i+wlLIeCKnKOTuz9/VFYDtj+TGTur5q7sp/OYrQA19LdBbWfXDOi0Y4jtedV6xtB8zQ9ug==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^6.0.0", + "glob": "^10.2.2", + "hosted-git-info": "^8.0.0", + "json-parse-even-better-errors": "^4.0.0", + "normalize-package-data": "^7.0.0", + "proc-log": "^5.0.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/package-json/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@npmcli/package-json/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@npmcli/package-json/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@npmcli/promise-spawn": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-8.0.2.tgz", + "integrity": "sha512-/bNJhjc+o6qL+Dwz/bqfTQClkEO5nTQ1ZEcdCkAQjhkZMHIh22LPG7fNh1enJP1NKWDqYiiABnjFCY7E0zHYtQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "which": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/redact": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-3.0.0.tgz", + "integrity": "sha512-/1uFzjVcfzqrgCeGW7+SZ4hv0qLWmKXVzFahZGJ6QuJBj6Myt9s17+JL86i76NV9YSnJRcGXJYQbAU0rn1YTCQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/run-script": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-9.0.1.tgz", + "integrity": "sha512-q9C0uHrb6B6cm3qXVM32UmpqTKuFGbtP23O2K5sLvPMz2hilKd0ptqGXSpuunOuOmPQb/aT5F/kCXFc1P2gO/A==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/node-gyp": "^4.0.0", + "@npmcli/package-json": "^6.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "node-gyp": "^10.0.0", + "proc-log": "^5.0.0", + "which": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/run-script/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/run-script/node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz", + "integrity": "sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.0", + "@parcel/watcher-darwin-arm64": "2.5.0", + "@parcel/watcher-darwin-x64": "2.5.0", + "@parcel/watcher-freebsd-x64": "2.5.0", + "@parcel/watcher-linux-arm-glibc": "2.5.0", + "@parcel/watcher-linux-arm-musl": "2.5.0", + "@parcel/watcher-linux-arm64-glibc": "2.5.0", + "@parcel/watcher-linux-arm64-musl": "2.5.0", + "@parcel/watcher-linux-x64-glibc": "2.5.0", + "@parcel/watcher-linux-x64-musl": "2.5.0", + "@parcel/watcher-win32-arm64": "2.5.0", + "@parcel/watcher-win32-ia32": "2.5.0", + "@parcel/watcher-win32-x64": "2.5.0" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz", + "integrity": "sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz", + "integrity": "sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.0.tgz", + "integrity": "sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.0.tgz", + "integrity": "sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.0.tgz", + "integrity": "sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.0.tgz", + "integrity": "sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.0.tgz", + "integrity": "sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.0.tgz", + "integrity": "sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz", + "integrity": "sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz", + "integrity": "sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.0.tgz", + "integrity": "sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.0.tgz", + "integrity": "sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.0.tgz", + "integrity": "sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@parcel/watcher/node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.26.0.tgz", + "integrity": "sha512-gJNwtPDGEaOEgejbaseY6xMFu+CPltsc8/T+diUTTbOQLqD+bnrJq9ulH6WD69TqwqWmrfRAtUv30cCFZlbGTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.26.0.tgz", + "integrity": "sha512-YJa5Gy8mEZgz5JquFruhJODMq3lTHWLm1fOy+HIANquLzfIOzE9RA5ie3JjCdVb9r46qfAQY/l947V0zfGJ0OQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.26.0.tgz", + "integrity": "sha512-ErTASs8YKbqTBoPLp/kA1B1Um5YSom8QAc4rKhg7b9tyyVqDBlQxy7Bf2wW7yIlPGPg2UODDQcbkTlruPzDosw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.26.0.tgz", + "integrity": "sha512-wbgkYDHcdWW+NqP2mnf2NOuEbOLzDblalrOWcPyY6+BRbVhliavon15UploG7PpBRQ2bZJnbmh8o3yLoBvDIHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.26.0.tgz", + "integrity": "sha512-Y9vpjfp9CDkAG4q/uwuhZk96LP11fBz/bYdyg9oaHYhtGZp7NrbkQrj/66DYMMP2Yo/QPAsVHkV891KyO52fhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.26.0.tgz", + "integrity": "sha512-A/jvfCZ55EYPsqeaAt/yDAG4q5tt1ZboWMHEvKAH9Zl92DWvMIbnZe/f/eOXze65aJaaKbL+YeM0Hz4kLQvdwg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.26.0.tgz", + "integrity": "sha512-paHF1bMXKDuizaMODm2bBTjRiHxESWiIyIdMugKeLnjuS1TCS54MF5+Y5Dx8Ui/1RBPVRE09i5OUlaLnv8OGnA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.26.0.tgz", + "integrity": "sha512-cwxiHZU1GAs+TMxvgPfUDtVZjdBdTsQwVnNlzRXC5QzIJ6nhfB4I1ahKoe9yPmoaA/Vhf7m9dB1chGPpDRdGXg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.26.0.tgz", + "integrity": "sha512-4daeEUQutGRCW/9zEo8JtdAgtJ1q2g5oHaoQaZbMSKaIWKDQwQ3Yx0/3jJNmpzrsScIPtx/V+1AfibLisb3AMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.26.0.tgz", + "integrity": "sha512-eGkX7zzkNxvvS05ROzJ/cO/AKqNvR/7t1jA3VZDi2vRniLKwAWxUr85fH3NsvtxU5vnUUKFHKh8flIBdlo2b3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.26.0.tgz", + "integrity": "sha512-Odp/lgHbW/mAqw/pU21goo5ruWsytP7/HCC/liOt0zcGG0llYWKrd10k9Fj0pdj3prQ63N5yQLCLiE7HTX+MYw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.26.0.tgz", + "integrity": "sha512-MBR2ZhCTzUgVD0OJdTzNeF4+zsVogIR1U/FsyuFerwcqjZGvg2nYe24SAHp8O5sN8ZkRVbHwlYeHqcSQ8tcYew==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.26.0.tgz", + "integrity": "sha512-YYcg8MkbN17fMbRMZuxwmxWqsmQufh3ZJFxFGoHjrE7bv0X+T6l3glcdzd7IKLiwhT+PZOJCblpnNlz1/C3kGQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.26.0.tgz", + "integrity": "sha512-ZuwpfjCwjPkAOxpjAEjabg6LRSfL7cAJb6gSQGZYjGhadlzKKywDkCUnJ+KEfrNY1jH5EEoSIKLCb572jSiglA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.26.0.tgz", + "integrity": "sha512-+HJD2lFS86qkeF8kNu0kALtifMpPCZU80HvwztIKnYwym3KnA1os6nsX4BGSTLtS2QVAGG1P3guRgsYyMA0Yhg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.26.0.tgz", + "integrity": "sha512-WUQzVFWPSw2uJzX4j6YEbMAiLbs0BUysgysh8s817doAYhR5ybqTI1wtKARQKo6cGop3pHnrUJPFCsXdoFaimQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.26.0.tgz", + "integrity": "sha512-D4CxkazFKBfN1akAIY6ieyOqzoOoBV1OICxgUblWxff/pSjCA2khXlASUx7mK6W1oP4McqhgcCsu6QaLj3WMWg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.26.0.tgz", + "integrity": "sha512-2x8MO1rm4PGEP0xWbubJW5RtbNLk3puzAMaLQd3B3JHVw4KcHlmXcO+Wewx9zCoo7EUFiMlu/aZbCJ7VjMzAag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@schematics/angular": { + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-19.0.2.tgz", + "integrity": "sha512-KPNKJRcuJ9kWctcW+g7WzmCEHpjNnYbNVyiU/MvKdQX0uhGXnXE13YMVfgYIf/0KeHcVp5dkAwg5dkmm9PGNTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "19.0.2", + "@angular-devkit/schematics": "19.0.2", + "jsonc-parser": "3.3.1" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@sigstore/bundle": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-3.0.0.tgz", + "integrity": "sha512-XDUYX56iMPAn/cdgh/DTJxz5RWmqKV4pwvUAEKEWJl+HzKdCd/24wUa9JYNMlDSCb7SUHAdtksxYX779Nne/Zg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.2" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/core/-/core-2.0.0.tgz", + "integrity": "sha512-nYxaSb/MtlSI+JWcwTHQxyNmWeWrUXJJ/G4liLrGG7+tS4vAz6LF3xRXqLH6wPIVUoZQel2Fs4ddLx4NCpiIYg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/protobuf-specs": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.2.tgz", + "integrity": "sha512-c6B0ehIWxMI8wiS/bj6rHMPqeFvngFV7cDU/MY+B16P9Z3Mp9k8L93eYZ7BYzSickzuqAQqAq0V956b3Ju6mLw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-3.0.0.tgz", + "integrity": "sha512-UjhDMQOkyDoktpXoc5YPJpJK6IooF2gayAr5LvXI4EL7O0vd58okgfRcxuaH+YTdhvb5aa1Q9f+WJ0c2sVuYIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^3.0.0", + "@sigstore/core": "^2.0.0", + "@sigstore/protobuf-specs": "^0.3.2", + "make-fetch-happen": "^14.0.1", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/sign/node_modules/@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/sign/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sigstore/sign/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@sigstore/sign/node_modules/make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/sign/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sigstore/sign/node_modules/minipass-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.0.tgz", + "integrity": "sha512-2v6aXUXwLP1Epd/gc32HAMIWoczx+fZwEPRHm/VwtrJzRGwR1qGZXEYV3Zp8ZjjbwaZhMrM6uHV4KVkk+XCc2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/@sigstore/sign/node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@sigstore/sign/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@sigstore/sign/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sigstore/tuf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-3.0.0.tgz", + "integrity": "sha512-9Xxy/8U5OFJu7s+OsHzI96IX/OzjF/zj0BSSaWhgJgTqtlBhQIV2xdrQI5qxLD7+CWWDepadnXAxzaZ3u9cvRw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.2", + "tuf-js": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/verify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-2.0.0.tgz", + "integrity": "sha512-Ggtq2GsJuxFNUvQzLoXqRwS4ceRfLAJnrIHUDrzAD0GgnOhwujJkKkxM/s5Bako07c3WtAs/sZo5PJq7VHjeDg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^3.0.0", + "@sigstore/core": "^2.0.0", + "@sigstore/protobuf-specs": "^0.3.2" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tufjs/canonical-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", + "integrity": "sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-3.0.1.tgz", + "integrity": "sha512-UUYHISyhCU3ZgN8yaear3cGATHb3SMuKHsQ/nVbHXcmnBf+LzQ/cQfhNG+rfaSHgqGKNEm2cOCLVLELStUQ1JA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@tufjs/models/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@tufjs/models/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/bonjour": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz", + "integrity": "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect-history-api-fallback": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz", + "integrity": "sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express-serve-static-core": "*", + "@types/node": "*" + } + }, + "node_modules/@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.2.tgz", + "integrity": "sha512-vluaspfvWEtE4vcSDlKRNer52DvOGrB2xv6diXy6UKyKW0lqZiWHGNApSyxOv+8DE5Z27IzVvE7hNkxg7EXIcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/express/node_modules/@types/express-serve-static-core": { + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/http-proxy": { + "version": "1.17.15", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz", + "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/jasmine": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-5.1.5.tgz", + "integrity": "sha512-SaCZ3kM5NjOiJqMRYwHpLbTfUC2Dyk1KS3QanNFsUYPGTk70CWVK/J9ueun6zNhw/UkgV7xl8V4ZLQZNRbfnNw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/node-forge": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", + "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/qs": { + "version": "6.9.17", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.17.tgz", + "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/retry": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", + "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-index": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz", + "integrity": "sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/sockjs": { + "version": "0.3.36", + "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", + "integrity": "sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.5.13", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz", + "integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vitejs/plugin-basic-ssl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.1.0.tgz", + "integrity": "sha512-wO4Dk/rm8u7RNhOf95ZzcEmC9rYOncYgvq4z3duaJrCgjN8BxAnDVyndanfcJZ0O6XZzHz6Q0hTimxTg8Y9g/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.6.0" + }, + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/abbrev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/accepts/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/adjust-sourcemap-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-4.0.0.tgz", + "integrity": "sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "loader-utils": "^2.0.0", + "regex-parser": "^2.2.11" + }, + "engines": { + "node": ">=8.9" + } + }, + "node_modules/adjust-sourcemap-loader/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-html-community": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", + "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "license": "Apache-2.0", + "bin": { + "ansi-html": "bin/ansi-html" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/babel-loader": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", + "integrity": "sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-cache-dir": "^4.0.0", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0", + "webpack": ">=5" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.12", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz", + "integrity": "sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.3", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.10.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz", + "integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.2", + "core-js-compat": "^3.38.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz", + "integrity": "sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.3" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", + "dev": true, + "license": "MIT" + }, + "node_modules/beasties": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/beasties/-/beasties-0.1.0.tgz", + "integrity": "sha512-+Ssscd2gVG24qRNC+E2g88D+xsQW4xwakWtKAiGEQ3Pw54/FGdyo9RrfxhGhEv6ilFVbB7r3Lgx+QnAxnSpECw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "htmlparser2": "^9.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-media-query-parser": "^0.2.3" + } + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/bonjour-service": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.3.0.tgz", + "integrity": "sha512-3YuAUiSkWykd+2Azjgyxei8OWf8thdn8AITIog2M4UICzoqfjlqr64WIjEXZllf/W6vK1goqleSR6brGomxQqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "multicast-dns": "^7.2.5" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true, + "license": "ISC" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cacache/node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/cacache/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/cacache/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cacache/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001685", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001685.tgz", + "integrity": "sha512-e/kJN1EMyHQzgcMEEgoo+YTCO1NGCmIYHk5Qk8jT6AazWemS5QFKJ5ShCJlH3GZrNIdZofcNCEwZqbMjjKzmnA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/clone-deep/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true, + "license": "ISC" + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.5.tgz", + "integrity": "sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "compressible": "~2.0.18", + "debug": "2.6.9", + "negotiator": "~0.6.4", + "on-headers": "~1.0.2", + "safe-buffer": "5.2.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/connect-history-api-fallback": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", + "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/copy-webpack-plugin": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-12.0.2.tgz", + "integrity": "sha512-SNwdBeHyII+rWvee/bTnAYyO8vfVdcSTud4EIb6jcZ8inLeWucJE0DnxXQBjlQ5zlteuuvooGQy3LIyGxhvlOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.1", + "globby": "^14.0.0", + "normalize-path": "^3.0.0", + "schema-utils": "^4.2.0", + "serialize-javascript": "^6.0.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "node_modules/core-js-compat": { + "version": "3.39.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.39.0.tgz", + "integrity": "sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.24.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-loader": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", + "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.27.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/custom-event": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", + "dev": true, + "license": "MIT" + }, + "node_modules/date-format": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", + "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", + "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true, + "license": "MIT" + }, + "node_modules/di": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", + "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", + "dev": true, + "license": "MIT" + }, + "node_modules/dns-packet": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/dom-serialize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", + "integrity": "sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "custom-event": "~1.0.0", + "ent": "~2.2.0", + "extend": "^3.0.0", + "void-elements": "^2.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true, + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.67", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.67.tgz", + "integrity": "sha512-nz88NNBsD7kQSAGGJyp8hS6xSPtWwqNogA0mjtc2nUYeEf3nURK9qpV18TuBdDmEDgVWotS8Wkzf+V52dSQ/LQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/engine.io": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz", + "integrity": "sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.7.2", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/ent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.1.tgz", + "integrity": "sha512-QHuXVeZx9d+tIQAz/XztU0ZwZf2Agg9CcXcgE1rurqvdBeDBrpSwjl8/6XUqMg7tw2Y7uAdKb2sRv+bSEFqQ5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^1.4.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" + } + }, + "node_modules/esbuild-wasm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.24.0.tgz", + "integrity": "sha512-xhNn5tL1AhkPg4ft59yXT6FkwKXiPSYyz1IeinJHUJpjvOHOIPvdmFQc0pGdjxlKSbzZc2mNmtVOWAR1EF/JAg==", + "dev": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true, + "license": "MIT" + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/express": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.10", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/express/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-cache-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", + "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "common-path-prefix": "^3.0.0", + "pkg-dir": "^7.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", + "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.1.0.tgz", + "integrity": "sha512-FQoVQnqcdk4hVM4JN1eromaun4iuS34oStkdlLENLdpULsuQcTyXj8w7ayhuUfPwEYZ1ZOooOTT6fdA9Vmx/RA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", + "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.0.2.tgz", + "integrity": "sha512-sYKnA7eGln5ov8T8gnYlkSOxFJvywzEx9BueN6xo/GKO8PGiI6uK6xx+DIGe45T3bdVjLAQDQW1aicT8z8JwQg==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, + "node_modules/hpack.js/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/hpack.js/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/hpack.js/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/html-entities": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT" + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-parser-js": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-middleware": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.3.tgz", + "integrity": "sha512-usY0HG5nyDUwtqpiZdETNbmKtw3QQ1jwYFZ9wi5iHzX2BcILwQKtYDJPo7XHTsu5Z0B2Hj3W9NNnbd+AjFWjqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-proxy": "^1.17.15", + "debug": "^4.3.6", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.3", + "is-plain-object": "^5.0.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/hyperdyperid": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", + "integrity": "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.18" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/ignore-walk": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-7.0.0.tgz", + "integrity": "sha512-T4gbf83A4NH95zvhVYZc+qWocBBGlpzUXLPGurJggw/WIOwicfXJChLDP/iBZnN5WqROSu5Bm3hhle4z8a8YGQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/ignore-walk/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/ignore-walk/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/immutable": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", + "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ini": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-5.0.0.tgz", + "integrity": "sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", + "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-network-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", + "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isbinaryfile": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", + "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jasmine-core": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-5.4.0.tgz", + "integrity": "sha512-T4fio3W++llLd7LGSGsioriDHgWyhoL6YTu4k37uwJLF7DzOzspz7mNxRoM3cQdLWtL/ebazQpIf/yZGJx/gzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jiti": { + "version": "1.21.6", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", + "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-4.0.0.tgz", + "integrity": "sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "node_modules/karma": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", + "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@colors/colors": "1.5.0", + "body-parser": "^1.19.0", + "braces": "^3.0.2", + "chokidar": "^3.5.1", + "connect": "^3.7.0", + "di": "^0.0.1", + "dom-serialize": "^2.2.1", + "glob": "^7.1.7", + "graceful-fs": "^4.2.6", + "http-proxy": "^1.18.1", + "isbinaryfile": "^4.0.8", + "lodash": "^4.17.21", + "log4js": "^6.4.1", + "mime": "^2.5.2", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.5", + "qjobs": "^1.2.0", + "range-parser": "^1.2.1", + "rimraf": "^3.0.2", + "socket.io": "^4.7.2", + "source-map": "^0.6.1", + "tmp": "^0.2.1", + "ua-parser-js": "^0.7.30", + "yargs": "^16.1.1" + }, + "bin": { + "karma": "bin/karma" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/karma-chrome-launcher": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz", + "integrity": "sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "which": "^1.2.1" + } + }, + "node_modules/karma-coverage": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/karma-coverage/-/karma-coverage-2.2.1.tgz", + "integrity": "sha512-yj7hbequkQP2qOSb20GuNSIyE//PgJWHwC2IydLE6XRtsnaflv+/OSGNssPjobYUlhVVagy99TQpqUt3vAUG7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.0.5", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/karma-coverage/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/karma-coverage/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/karma-jasmine": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-5.1.0.tgz", + "integrity": "sha512-i/zQLFrfEpRyQoJF9fsCdTMOF5c2dK7C7OmsuKg2D0YSsuZSfQDiLuaiktbuio6F2wiCsZSnSnieIQ0ant/uzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "jasmine-core": "^4.1.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "karma": "^6.0.0" + } + }, + "node_modules/karma-jasmine-html-reporter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-2.1.0.tgz", + "integrity": "sha512-sPQE1+nlsn6Hwb5t+HHwyy0A1FNCVKuL1192b+XNauMYWThz2kweiBVW1DqloRpVvZIJkIoHVB7XRpK78n1xbQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "jasmine-core": "^4.0.0 || ^5.0.0", + "karma": "^6.0.0", + "karma-jasmine": "^5.0.0" + } + }, + "node_modules/karma-jasmine/node_modules/jasmine-core": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-4.6.1.tgz", + "integrity": "sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/karma-source-map-support": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz", + "integrity": "sha512-RsBECncGO17KAoJCYXjv+ckIz+Ii9NCi+9enk+rq6XC81ezYkb4/RHE6CTXdA7IOJqoF3wcaLfVG0CPmE5ca6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "source-map-support": "^0.5.5" + } + }, + "node_modules/karma/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/karma/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/karma/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/karma/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/karma/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/karma/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/karma/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/karma/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/karma/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/karma/node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "node_modules/karma/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/karma/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/karma/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/launch-editor": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.9.1.tgz", + "integrity": "sha512-Gcnl4Bd+hRO9P9icCP/RVVT2o8SFlPXofuCxvA2SaZuH45whSvf5p8x5oih5ftLiVhEI4sp5xDY+R+b3zJBh5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "shell-quote": "^1.8.1" + } + }, + "node_modules/less": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/less/-/less-4.2.0.tgz", + "integrity": "sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "copy-anything": "^2.0.1", + "parse-node-version": "^1.0.1", + "tslib": "^2.3.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "source-map": "~0.6.0" + } + }, + "node_modules/less-loader": { + "version": "12.2.0", + "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-12.2.0.tgz", + "integrity": "sha512-MYUxjSQSBUQmowc0l5nPieOYwMzGPUaTzB6inNW/bdPEG9zOL3eAAD1Qw5ZxSPk7we5dMojHwNODYMV1hq4EVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "less": "^3.5.0 || ^4.0.0", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/less/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/less/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/less/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/less/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/license-webpack-plugin": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-4.0.2.tgz", + "integrity": "sha512-771TFWFD70G1wLTC4oU2Cw4qvtmNrIw+wRvBtn+okgHl7slJVi7zfNcdmqDL72BojM30VNJ2UHylr1o77U37Jw==", + "dev": true, + "license": "ISC", + "dependencies": { + "webpack-sources": "^3.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + }, + "webpack-sources": { + "optional": true + } + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/listr2": { + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", + "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/listr2/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true, + "license": "MIT" + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lmdb": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/lmdb/-/lmdb-3.1.5.tgz", + "integrity": "sha512-46Mch5Drq+A93Ss3gtbg+Xuvf5BOgIuvhKDWoGa3HcPHI6BL2NCOkRdSx1D4VfzwrxhnsjbyIVsLRlQHu6URvw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "msgpackr": "^1.11.2", + "node-addon-api": "^6.1.0", + "node-gyp-build-optional-packages": "5.2.2", + "ordered-binary": "^1.5.3", + "weak-lru-cache": "^1.2.2" + }, + "bin": { + "download-lmdb-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@lmdb/lmdb-darwin-arm64": "3.1.5", + "@lmdb/lmdb-darwin-x64": "3.1.5", + "@lmdb/lmdb-linux-arm": "3.1.5", + "@lmdb/lmdb-linux-arm64": "3.1.5", + "@lmdb/lmdb-linux-x64": "3.1.5", + "@lmdb/lmdb-win32-x64": "3.1.5" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/loader-utils": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.3.1.tgz", + "integrity": "sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/log4js": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", + "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "date-format": "^4.0.14", + "debug": "^4.3.4", + "flatted": "^3.2.7", + "rfdc": "^1.3.0", + "streamroller": "^3.1.5" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-fetch-happen": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz", + "integrity": "sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/@npmcli/fs": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.1.tgz", + "integrity": "sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg==", + "dev": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/cacache": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.4.tgz", + "integrity": "sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/make-fetch-happen/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/make-fetch-happen/node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-fetch-happen/node_modules/proc-log": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", + "integrity": "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/ssri": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.6.tgz", + "integrity": "sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dev": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memfs": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.14.1.tgz", + "integrity": "sha512-Fq5CMEth+2iprLJ5mNizRcWuiwRZYjNkUD0zKk224jZunE9CRacTRDK8QLALbMBlNX2y3nY6lKZbesCwDwacig==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jsonjoy.com/json-pack": "^1.0.3", + "@jsonjoy.com/util": "^1.3.0", + "tree-dump": "^1.0.1", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">= 4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mini-css-extract-plugin": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", + "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.5.tgz", + "integrity": "sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/msgpackr": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.2.tgz", + "integrity": "sha512-F9UngXRlPyWCDEASDpTf6c9uNhGPTqnTeLVt7bN+bU1eajoR/8V9ys2BRaV5C/e5ihE6sJ9uPIKaYt6bFuO32g==", + "dev": true, + "license": "MIT", + "optional": true, + "optionalDependencies": { + "msgpackr-extract": "^3.0.2" + } + }, + "node_modules/msgpackr-extract": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz", + "integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build-optional-packages": "5.2.2" + }, + "bin": { + "download-msgpackr-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" + } + }, + "node_modules/multicast-dns": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", + "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", + "dev": true, + "license": "MIT", + "dependencies": { + "dns-packet": "^5.2.2", + "thunky": "^1.0.2" + }, + "bin": { + "multicast-dns": "cli.js" + } + }, + "node_modules/mute-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", + "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/needle": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/negotiator": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", + "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "dev": true, + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/node-gyp": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-10.2.0.tgz", + "integrity": "sha512-sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^4.1.0", + "semver": "^7.3.5", + "tar": "^6.2.1", + "which": "^4.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz", + "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.1" + }, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, + "node_modules/node-gyp/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/node-gyp/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/node-gyp/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/proc-log": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", + "integrity": "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/node-gyp/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true, + "license": "MIT" + }, + "node_modules/nopt": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz", + "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/normalize-package-data": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-7.0.0.tgz", + "integrity": "sha512-k6U0gKRIuNCTkwHGZqblCfLfBRh+w1vI6tBo+IeJwq2M8FUiOqhX7GH+GArQGScA7azd1WfyRCvxoXDO3hQDIA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^8.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-bundled": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-4.0.0.tgz", + "integrity": "sha512-IxaQZDMsqfQ2Lz37VvyyEtKLe8FsRZuysmedy/N06TU1RyVppYKXrO4xIhR0F+7ubIBox6Q7nir6fQI3ej39iA==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-normalize-package-bin": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-install-checks": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-7.1.1.tgz", + "integrity": "sha512-u6DCwbow5ynAX5BdiHQ9qvexme4U3qHW3MWe5NqH+NeBm0LbiH6zvGjNNew1fY+AZZUtVHbOPF3j7mJxbUzpXg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-normalize-package-bin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-4.0.0.tgz", + "integrity": "sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-package-arg": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-12.0.0.tgz", + "integrity": "sha512-ZTE0hbwSdTNL+Stx2zxSqdu2KZfNDcrtrLdIk7XGnQFYBWYDho/ORvXtn5XEePcL3tFpGjHCV3X3xrtDh7eZ+A==", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^6.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-packlist": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-9.0.0.tgz", + "integrity": "sha512-8qSayfmHJQTx3nJWYbbUmflpyarbLMBc6LCAjYsiGtXxDB68HaZpb8re6zeaLGxZzDuMdhsg70jryJe+RrItVQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "ignore-walk": "^7.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-pick-manifest": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-10.0.0.tgz", + "integrity": "sha512-r4fFa4FqYY8xaM7fHecQ9Z2nE9hgNfJR+EmoKv0+chvzWkBcORX3r0FpTByP+CbOVJDladMXnPQGVN8PBLGuTQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-install-checks": "^7.1.0", + "npm-normalize-package-bin": "^4.0.0", + "npm-package-arg": "^12.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-registry-fetch": { + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-18.0.2.tgz", + "integrity": "sha512-LeVMZBBVy+oQb5R6FDV9OlJCcWDU+al10oKpe+nsvcHnG24Z3uM3SvJYKfGJlfGjVU8v9liejCrUR/M5HO5NEQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/redact": "^3.0.0", + "jsonparse": "^1.3.1", + "make-fetch-happen": "^14.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minizlib": "^3.0.1", + "npm-package-arg": "^12.0.0", + "proc-log": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm-registry-fetch/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/npm-registry-fetch/node_modules/make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm-registry-fetch/node_modules/minipass-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.0.tgz", + "integrity": "sha512-2v6aXUXwLP1Epd/gc32HAMIWoczx+fZwEPRHm/VwtrJzRGwR1qGZXEYV3Zp8ZjjbwaZhMrM6uHV4KVkk+XCc2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/npm-registry-fetch/node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/npm-registry-fetch/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/npm-registry-fetch/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true, + "license": "MIT" + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ordered-binary": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ordered-binary/-/ordered-binary-1.5.3.tgz", + "integrity": "sha512-oGFr3T+pYdTGJ+YFEILMpS3es+GiIbs9h/XQrclBXUtd44ey7XwfsMzM31f64I1SQOawDoDr/D823kNCADI8TA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", + "integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-retry": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.1.tgz", + "integrity": "sha512-hEt02O4hUct5wtwg4H4KcWgDdm+l1bOaEy/hWzd8xtXB9BqxTWBBhb+2ImAtH4Cv4rPjV76xN3Zumqk3k3AhhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/retry": "0.12.2", + "is-network-error": "^1.0.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-retry/node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/pacote": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-20.0.0.tgz", + "integrity": "sha512-pRjC5UFwZCgx9kUFDVM9YEahv4guZ1nSLqwmWiLUnDbGsjs+U5w7z6Uc8HNR1a6x8qnu5y9xtGE6D1uAuYz+0A==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^6.0.0", + "@npmcli/installed-package-contents": "^3.0.0", + "@npmcli/package-json": "^6.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "@npmcli/run-script": "^9.0.0", + "cacache": "^19.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^12.0.0", + "npm-packlist": "^9.0.0", + "npm-pick-manifest": "^10.0.0", + "npm-registry-fetch": "^18.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "sigstore": "^3.0.0", + "ssri": "^12.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "bin/index.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-json/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse5": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^4.5.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-html-rewriting-stream": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-html-rewriting-stream/-/parse5-html-rewriting-stream-7.0.0.tgz", + "integrity": "sha512-mazCyGWkmCRWDI15Zp+UiCqMp/0dgEmkZRvhlsqqKYr4SsVm/TvnSpD9fCvqCA2zoWJcfRym846ejWBBHRiYEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^4.3.0", + "parse5": "^7.0.0", + "parse5-sax-parser": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-sax-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-sax-parser/-/parse5-sax-parser-7.0.0.tgz", + "integrity": "sha512-5A+v2SNsq8T6/mG3ahcz8ZtQ0OUFTatxPbeidoMB7tkJSGDY3tdfl4MHovtLQHkEn5CGxijNWRQHhRQ6IRpXKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/path-to-regexp": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/piscina": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.7.0.tgz", + "integrity": "sha512-b8hvkpp9zS0zsfa939b/jXbe64Z2gZv0Ha7FYPNUiDIB1y2AtxcOZdfP8xN8HFjUaqQiT9gRlfjAsoL8vdJ1Iw==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "@napi-rs/nice": "^1.0.1" + } + }, + "node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^6.3.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/postcss": { + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-loader": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-8.1.1.tgz", + "integrity": "sha512-0IeqyAsG6tYiDRCYKQJLAmgQr47DX6N7sFSWvQxt6AcupX8DIdmykuk/o/tx0Lze3ErGHJEp5OSRxrelC6+NdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cosmiconfig": "^9.0.0", + "jiti": "^1.20.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "postcss": "^7.0.0 || ^8.0.1", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", + "dev": true, + "license": "MIT" + }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.1.0.tgz", + "integrity": "sha512-rm0bdSv4jC3BDma3s9H19ZddW0aHX6EoqwDYU2IfZhRN+53QrufTRo2IdkAbRqLx4R2IYbZnbjKKxg4VN5oU9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^7.0.0", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", + "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", + "dev": true, + "license": "ISC", + "dependencies": { + "postcss-selector-parser": "^7.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-selector-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.0.0.tgz", + "integrity": "sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/proc-log": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", + "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-addr/node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/qjobs": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.9" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz", + "integrity": "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true, + "license": "MIT" + }, + "node_modules/regenerator-transform": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regex-parser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.3.0.tgz", + "integrity": "sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg==", + "dev": true, + "license": "MIT" + }, + "node_modules/regexpu-core": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", + "integrity": "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.2.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.12.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.0.2" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-url-loader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz", + "integrity": "sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "adjust-sourcemap-loader": "^4.0.0", + "convert-source-map": "^1.7.0", + "loader-utils": "^2.0.0", + "postcss": "^8.2.14", + "source-map": "0.6.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/resolve-url-loader/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/resolve-url-loader/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.26.0.tgz", + "integrity": "sha512-ilcl12hnWonG8f+NxU6BlgysVA0gvY2l8N0R84S1HcINbW20bvwuCngJkkInV6LXhwRpucsW5k1ovDwEdBVrNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.26.0", + "@rollup/rollup-android-arm64": "4.26.0", + "@rollup/rollup-darwin-arm64": "4.26.0", + "@rollup/rollup-darwin-x64": "4.26.0", + "@rollup/rollup-freebsd-arm64": "4.26.0", + "@rollup/rollup-freebsd-x64": "4.26.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.26.0", + "@rollup/rollup-linux-arm-musleabihf": "4.26.0", + "@rollup/rollup-linux-arm64-gnu": "4.26.0", + "@rollup/rollup-linux-arm64-musl": "4.26.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.26.0", + "@rollup/rollup-linux-riscv64-gnu": "4.26.0", + "@rollup/rollup-linux-s390x-gnu": "4.26.0", + "@rollup/rollup-linux-x64-gnu": "4.26.0", + "@rollup/rollup-linux-x64-musl": "4.26.0", + "@rollup/rollup-win32-arm64-msvc": "4.26.0", + "@rollup/rollup-win32-ia32-msvc": "4.26.0", + "@rollup/rollup-win32-x64-msvc": "4.26.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-applescript": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", + "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sass": { + "version": "1.80.7", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.80.7.tgz", + "integrity": "sha512-MVWvN0u5meytrSjsU7AWsbhoXi1sc58zADXFllfZzbsBT1GHjjar6JwBINYPRrkx/zqnQ6uqbQuHgE95O+C+eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.0", + "immutable": "^5.0.2", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, + "node_modules/sass-loader": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.3.tgz", + "integrity": "sha512-gosNorT1RCkuCMyihv6FBRR7BMV06oKRAs+l4UMp1mlcVg9rWN6KMmUj3igjQwmYys4mDP3etEYJgiHRbgHCHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "dev": true, + "license": "ISC", + "optional": true + }, + "node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/schema-utils/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", + "dev": true, + "license": "MIT" + }, + "node_modules/selfsigned": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", + "integrity": "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node-forge": "^1.3.0", + "node-forge": "^1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/send/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-index/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-index/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true, + "license": "ISC" + }, + "node_modules/serve-index/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/serve-index/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "license": "ISC" + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "license": "MIT", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", + "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sigstore": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-3.0.0.tgz", + "integrity": "sha512-PHMifhh3EN4loMcHCz6l3v/luzgT3za+9f8subGgeMNjbJjzH4Ij/YoX3Gvu+kaouJRIlVdTHHCREADYf+ZteA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^3.0.0", + "@sigstore/core": "^2.0.0", + "@sigstore/protobuf-specs": "^0.3.2", + "@sigstore/sign": "^3.0.0", + "@sigstore/tuf": "^3.0.0", + "@sigstore/verify": "^2.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socket.io": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "~4.3.4", + "ws": "~8.17.1" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/sockjs": { + "version": "0.3.24", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", + "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "faye-websocket": "^0.11.3", + "uuid": "^8.3.2", + "websocket-driver": "^0.7.4" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-loader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-5.0.0.tgz", + "integrity": "sha512-k2Dur7CbSLcAH73sBcIkV5xjPV4SzqO1NJ7+XaQl8if3VODDUj3FNchNGpqgJSKbvUfJuhVdv8K2Eu8/TNl2eA==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.3", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.72.1" + } + }, + "node_modules/source-map-loader/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/streamroller": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", + "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "date-format": "^4.0.14", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/terser": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.20", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser-webpack-plugin/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/thingies": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz", + "integrity": "sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==", + "dev": true, + "license": "Unlicense", + "engines": { + "node": ">=10.18" + }, + "peerDependencies": { + "tslib": "^2" + } + }, + "node_modules/thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tree-dump": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz", + "integrity": "sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tuf-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-3.0.1.tgz", + "integrity": "sha512-+68OP1ZzSF84rTckf3FA95vJ1Zlx/uaXyiiKyPd1pA4rZNkpEvDAKmsu1xUSmbF/chCRYgZ6UZkDwC7PmzmAyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/models": "3.0.1", + "debug": "^4.3.6", + "make-fetch-happen": "^14.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/tuf-js/node_modules/@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/tuf-js/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/tuf-js/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tuf-js/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/tuf-js/node_modules/make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/tuf-js/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tuf-js/node_modules/minipass-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.0.tgz", + "integrity": "sha512-2v6aXUXwLP1Epd/gc32HAMIWoczx+fZwEPRHm/VwtrJzRGwR1qGZXEYV3Zp8ZjjbwaZhMrM6uHV4KVkk+XCc2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/tuf-js/node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/tuf-js/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/tuf-js/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-assert": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/typed-assert/-/typed-assert-1.0.9.tgz", + "integrity": "sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==", + "dev": true, + "license": "MIT" + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ua-parser-js": { + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-IZ6acm6RhQHNibSt7+c09hhvsKy9WUr4DVbeq9U8o71qxyYtJpQeDxQnMrVqnIFMLcQjHO0I9wgfO2vIahht4w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz", + "integrity": "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-6.0.0.tgz", + "integrity": "sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/weak-lru-cache": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz", + "integrity": "sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/webpack": { + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-dev-middleware": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-7.4.2.tgz", + "integrity": "sha512-xOO8n6eggxnwYpy1NlzUKpvrjfJTvae5/D6WOK0S2LSo7vjmo5gCM1DbLUmFqrMTJP+W/0YZNctm7jasWvLuBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "colorette": "^2.0.10", + "memfs": "^4.6.0", + "mime-types": "^2.1.31", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } + } + }, + "node_modules/webpack-dev-server": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.1.0.tgz", + "integrity": "sha512-aQpaN81X6tXie1FoOB7xlMfCsN19pSvRAeYUHOdFWOlhpQ/LlbfTqYwwmEDFV0h8GGuqmCmKmT+pxcUV/Nt2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/bonjour": "^3.5.13", + "@types/connect-history-api-fallback": "^1.5.4", + "@types/express": "^4.17.21", + "@types/serve-index": "^1.9.4", + "@types/serve-static": "^1.15.5", + "@types/sockjs": "^0.3.36", + "@types/ws": "^8.5.10", + "ansi-html-community": "^0.0.8", + "bonjour-service": "^1.2.1", + "chokidar": "^3.6.0", + "colorette": "^2.0.10", + "compression": "^1.7.4", + "connect-history-api-fallback": "^2.0.0", + "express": "^4.19.2", + "graceful-fs": "^4.2.6", + "html-entities": "^2.4.0", + "http-proxy-middleware": "^2.0.3", + "ipaddr.js": "^2.1.0", + "launch-editor": "^2.6.1", + "open": "^10.0.3", + "p-retry": "^6.2.0", + "schema-utils": "^4.2.0", + "selfsigned": "^2.4.1", + "serve-index": "^1.9.1", + "sockjs": "^0.3.24", + "spdy": "^4.0.2", + "webpack-dev-middleware": "^7.4.2", + "ws": "^8.18.0" + }, + "bin": { + "webpack-dev-server": "bin/webpack-dev-server.js" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + }, + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-dev-server/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/webpack-dev-server/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/webpack-dev-server/node_modules/http-proxy-middleware": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", + "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/express": "^4.17.13" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } + } + }, + "node_modules/webpack-dev-server/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/webpack-dev-server/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/webpack-merge": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-6.0.1.tgz", + "integrity": "sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack-subresource-integrity": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-5.1.0.tgz", + "integrity": "sha512-sacXoX+xd8r4WKsy9MvH/q/vBtEHr86cpImXwyg74pFIpERKt6FmB8cXpeuh0ZLgclOlHI4Wcll7+R5L02xk9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "typed-assert": "^1.0.8" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "html-webpack-plugin": ">= 5.0.0-beta.1 < 6", + "webpack": "^5.12.0" + }, + "peerDependenciesMeta": { + "html-webpack-plugin": { + "optional": true + } + } + }, + "node_modules/webpack/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/webpack/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/webpack/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/webpack/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/webpack/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zone.js": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.0.tgz", + "integrity": "sha512-9oxn0IIjbCZkJ67L+LkhYWRyAy7axphb3VgE2MBDlOqnmHMPWGYMxJxBYFueFq/JGY2GMwS0rU+UCLunEmy5UA==", + "license": "MIT" + } + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/package.json b/samples/client/petstore/typescript-angular-v19-provided-in-root/package.json new file mode 100644 index 000000000000..bd7b869e8076 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/package.json @@ -0,0 +1,38 @@ +{ + "name": "typescript-angular-v19-unit-tests", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development", + "test": "ng test" + }, + "private": true, + "dependencies": { + "@angular/animations": "^19.0.0", + "@angular/common": "^19.0.0", + "@angular/compiler": "^19.0.0", + "@angular/core": "^19.0.0", + "@angular/forms": "^19.0.0", + "@angular/platform-browser": "^19.0.0", + "@angular/platform-browser-dynamic": "^19.0.0", + "@angular/router": "^19.0.0", + "rxjs": "~7.8.0", + "tslib": "^2.3.0", + "zone.js": "~0.15.0" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^19.0.2", + "@angular/cli": "^19.0.2", + "@angular/compiler-cli": "^19.0.0", + "@types/jasmine": "~5.1.0", + "jasmine-core": "~5.4.0", + "karma": "~6.4.0", + "karma-chrome-launcher": "~3.2.0", + "karma-coverage": "~2.2.0", + "karma-jasmine": "~5.1.0", + "karma-jasmine-html-reporter": "~2.1.0", + "typescript": "~5.6.2" + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.css b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.css new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.html b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.html new file mode 100644 index 000000000000..acf0ceceeaff --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.html @@ -0,0 +1 @@ +{{ pets|json }} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.spec.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.spec.ts new file mode 100644 index 000000000000..18272ecef2a0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.spec.ts @@ -0,0 +1,42 @@ +import {TestBed} from '@angular/core/testing'; +import {AppComponent} from './app.component'; +import {provideHttpClient} from '@angular/common/http'; +import {Pet, PetService} from '@swagger/typescript-angular-petstore'; +import {of} from 'rxjs'; + +describe('AppComponent', () => { + let petServiceMock: jasmine.SpyObj; + const pet: Pet = {name: 'name', photoUrls: []}; + + beforeEach(async () => { + + petServiceMock = jasmine.createSpyObj(['findPetsByStatus']); + petServiceMock.findPetsByStatus.and.returnValue(of([pet]) as any); + + await TestBed.configureTestingModule({ + imports: [AppComponent], + providers: [ + provideHttpClient(), + {provide: PetService, useValue: petServiceMock} + ] + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have the 'typescript-angular-v19-unit-tests' title`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('typescript-angular-v19-unit-tests'); + }); + + it('should find pets', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + expect(fixture.componentInstance.pets![0]).toEqual(pet) + }); +}); diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.ts new file mode 100644 index 000000000000..59c44f3f65cf --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.ts @@ -0,0 +1,18 @@ +import {Component} from '@angular/core'; +import {type Pet, PetService} from '@swagger/typescript-angular-petstore' +import {JsonPipe} from '@angular/common'; + +@Component({ + selector: 'app-root', + imports: [JsonPipe], + templateUrl: './app.component.html', + styleUrl: './app.component.css' +}) +export class AppComponent { + title = 'typescript-angular-v19-unit-tests'; + pets: Pet[] | undefined; + + constructor(petService: PetService) { + petService.findPetsByStatus(['available']).subscribe(pets => this.pets = pets); + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.config.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.config.ts new file mode 100644 index 000000000000..2796096d9b8e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.config.ts @@ -0,0 +1,15 @@ +import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; +import { provideRouter } from '@angular/router'; + +import { routes } from './app.routes'; +import {Configuration} from '@swagger/typescript-angular-petstore'; +import {provideHttpClient} from '@angular/common/http'; + +export const appConfig: ApplicationConfig = { + providers: [ + provideZoneChangeDetection({ eventCoalescing: true }), + provideRouter(routes), + provideHttpClient(), + Configuration + ] +}; diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.routes.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.routes.ts new file mode 100644 index 000000000000..dc39edb5f23a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.routes.ts @@ -0,0 +1,3 @@ +import { Routes } from '@angular/router'; + +export const routes: Routes = []; diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/index.html b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/index.html new file mode 100644 index 000000000000..dfc16b4fe051 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/index.html @@ -0,0 +1,12 @@ + + + + + TypescriptAngularV19UnitTests + + + + + + + diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/main.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/main.ts new file mode 100644 index 000000000000..35b00f346331 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/main.ts @@ -0,0 +1,6 @@ +import { bootstrapApplication } from '@angular/platform-browser'; +import { appConfig } from './app/app.config'; +import { AppComponent } from './app/app.component'; + +bootstrapApplication(AppComponent, appConfig) + .catch((err) => console.error(err)); diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/styles.css b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/styles.css new file mode 100644 index 000000000000..90d4ee0072ce --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/src/styles.css @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.app.json b/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.app.json new file mode 100644 index 000000000000..3775b37e3bbc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.app.json @@ -0,0 +1,15 @@ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "src/main.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.json b/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.json new file mode 100644 index 000000000000..72afd12ed3d7 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.json @@ -0,0 +1,30 @@ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ +{ + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist/out-tsc", + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "isolatedModules": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "moduleResolution": "bundler", + "importHelpers": true, + "target": "ES2022", + "module": "ES2022", + "paths": { + "@swagger/typescript-angular-petstore": ["./builds/default"] + } + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.spec.json b/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.spec.json new file mode 100644 index 000000000000..5fb748d9207a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.spec.json @@ -0,0 +1,15 @@ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} From 24cb797a58a389e94d9b35a9840775aa35053b41 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 4 Dec 2024 11:47:40 +0800 Subject: [PATCH 23/40] update link to join the Slack channel --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index e76ba1eaad5b..9b416e374d56 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -5,7 +5,7 @@ title: "FAQ: General" ## Do you have a chat room? -[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g) +[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-2uoef5v0g-XGwo8~2oJ3EoziDSO1CmdQ) ## What is the governance structure of the OpenAPI Generator project? From b3d172a44fc1e8e8a5f09aa68af54f46aeb42c2d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 4 Dec 2024 15:05:48 +0800 Subject: [PATCH 24/40] use elixir petstore spec for testing (#20236) --- bin/configs/elixir.yaml | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 2064 +++++++++++++++++ 2 files changed, 2065 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml diff --git a/bin/configs/elixir.yaml b/bin/configs/elixir.yaml index 917661865ddb..ca90bc3ea140 100644 --- a/bin/configs/elixir.yaml +++ b/bin/configs/elixir.yaml @@ -1,6 +1,6 @@ generatorName: elixir outputDir: samples/client/petstore/elixir -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/elixir additionalProperties: invokerPackage: OpenapiPetstore diff --git a/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml new file mode 100644 index 000000000000..e4957b4e19d1 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml @@ -0,0 +1,2064 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + - url: 'http://{server}.swagger.io:{port}/v2' + description: test server with variables + variables: + server: + description: target server + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + x-webclient-blocking: true + responses: + '200': + description: Successful operation + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + x-webclient-blocking: true + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + x-webclient-blocking: true + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + uniqueItems: true + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + x-webclient-blocking: true + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + x-webclient-blocking: false + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + - name: enum_query_model_array + in: query + schema: + type: array + items: + $ref: '#/components/schemas/EnumClass' + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/property/enum-int: + post: + tags: + - fake + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + responses: + '200': + description: Output enum (int) + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/BigDecimalMap: + get: + tags: + - fake + description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + operationId: fakeBigDecimalMap + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: object + properties: + someId: + type: number + someMap: + type: object + additionalProperties: + type: number + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/additionalProperties-reference: + post: + tags: + - fake + summary: test referenced additionalProperties + description: '' + operationId: testAdditionalPropertiesReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + 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: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request must reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/body-with-binary: + put: + tags: + - fake + description: >- + For this test, the body has to be a binary file. + operationId: testBodyWithBinary + responses: + '200': + description: Success + requestBody: + content: + image/png: + schema: + type: string + nullable: true + format: binary + description: image to upload + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + style: pipeDelimited + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: language + in: query + required: false + schema: + type: object + additionalProperties: + type: string + format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/http-signature-test: + get: + tags: + - fake + summary: test http signature authentication + operationId: fake-http-signature-test + parameters: + - name: query_1 + in: query + description: query parameter + required: optional + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: optional + schema: + type: string + security: + - http_signature_test: [] + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 200: + description: The instance started successfully +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_varaible + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + wrapped: true + items: + type: string + xml: + name: photoUrl + uniqueItems: true + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + minItems: 0 + maxItems: 3 + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + FreeFormObject: + type: object + description: A schema consisting only of additional properties + additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + example: 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + 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 + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + OuterObjectWithEnumProperty: + type: object + example: + value: 2 + required: + - value + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + AllOfWithSingleRef: + type: object + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + SingleRefType: + type: string + title: SingleRefType + enum: + - admin + - user From e131d52ad00a77b6e2394debb47289ab86cebce3 Mon Sep 17 00:00:00 2001 From: Fionn O'Connor Date: Wed, 4 Dec 2024 07:24:47 +0000 Subject: [PATCH 25/40] [kotlin-spring] Handle arrays of files correctly using MultipartFile (#20108) * [kotlin-spring] Fix no List being used for an array of files using multipart/form-data * [kotlin-spring] Use Spring's MultipartFile class for incoming Files instead of Spring's Resource class. * [kotlin-spring] Add test to ensure that return type for files is `org.springframework.core.io.Resource` * [kotlin-spring] Ensure Array is used for lists of files in generated Api class * Update samples * [kotlin-spring] Move conditional usage of MultipartFile to optionalDataType.mustache. Update samples * update samples --------- Co-authored-by: William Cheng --- .../kotlin-spring/apiDelegate.mustache | 3 +- .../kotlin-spring/optionalDataType.mustache | 2 +- .../spring/KotlinSpringServerCodegenTest.java | 311 +++++++----- .../3_0/kotlin/petstore-with-tags.yaml | 443 ++++++++++-------- .../kotlin/org/openapitools/api/PetApi.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../kotlin/org/openapitools/api/PetApi.kt | 2 +- .../org/openapitools/api/PetApiDelegate.kt | 3 +- .../org/openapitools/api/StoreApiDelegate.kt | 1 - .../org/openapitools/api/UserApiDelegate.kt | 1 - .../kotlin/org/openapitools/api/PetApi.kt | 2 +- .../org/openapitools/api/PetApiDelegate.kt | 3 +- .../org/openapitools/api/StoreApiDelegate.kt | 1 - .../org/openapitools/api/UserApiDelegate.kt | 1 - .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../api/MultipartMixedApiController.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../kotlin/org/openapitools/api/PetApi.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../org/openapitools/api/PetApiController.kt | 2 +- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- 37 files changed, 476 insertions(+), 347 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache index 47bd58a48188..82e39150609a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache @@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource {{#appendRequestToHandler}} import org.springframework.http.server.reactive.ServerHttpRequest {{/appendRequestToHandler}} @@ -33,7 +32,7 @@ interface {{classname}}Delegate { /** * @see {{classname}}#{{operationId}} */ - {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isFile}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{^-last}}, + {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{^-last}}, {{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} { {{>methodBody}} }{{/skipDefaultDelegateInterface}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/optionalDataType.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/optionalDataType.mustache index 7c026fa826fe..a6b059b8632a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/optionalDataType.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/optionalDataType.mustache @@ -1 +1 @@ -{{#required}}{{{dataType}}}{{/required}}{{^required}}{{#defaultValue}}{{{dataType}}}{{/defaultValue}}{{^defaultValue}}{{{dataType}}}?{{/defaultValue}}{{/required}} \ No newline at end of file +{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}org.springframework.web.multipart.MultipartFile{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}?{{/required}}{{/isArray}}{{/isFile}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index dc2a699c2b15..46fb7fae80e8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -92,14 +92,14 @@ public void testNoRequestMappingAnnotation_spring_cloud_default() throws IOExcep codegen.setLibrary("spring-cloud"); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13488_use_kotlinSpring_with_springCloud.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13488_use_kotlinSpring_with_springCloud.yaml")) + .config(codegen)) + .generate(); // Check that the @RequestMapping annotation is not generated in the Api file assertFileNotContains( - Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"), - "@RequestMapping(\"\\${api.base-path" + Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"), + "@RequestMapping(\"\\${api.base-path" ); } @@ -290,18 +290,18 @@ public void delegateWithTags() throws Exception { codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true); List files = new DefaultGenerator() - .opts( - new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue5497-use-tags-kotlin.yaml")) - .config(codegen) - ) - .generate(); + .opts( + new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue5497-use-tags-kotlin.yaml")) + .config(codegen) + ) + .generate(); Assertions.assertThat(files).contains( - new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt") + new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt") ); } @@ -315,51 +315,51 @@ public void delegateReactiveWithTags() throws Exception { codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true); List files = new DefaultGenerator() - .opts( - new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue7325-use-delegate-reactive-tags-kotlin.yaml")) - .config(codegen) - ) - .generate(); + .opts( + new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue7325-use-delegate-reactive-tags-kotlin.yaml")) + .config(codegen) + ) + .generate(); Assertions.assertThat(files).contains( - new File(output, "src/main/kotlin/org/openapitools/api/TestV1Api.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV2Api.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV3Api.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiController.kt"), - new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt") + new File(output, "src/main/kotlin/org/openapitools/api/TestV1Api.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV2Api.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV3Api.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiController.kt"), + new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt") ); assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"), - "suspend fun"); + "suspend fun"); assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"), - "exchange"); + "exchange"); assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), - "suspend fun"); + "suspend fun"); assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), - "ApiUtil"); + "ApiUtil"); assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2Api.kt"), - "import kotlinx.coroutines.flow.Flow", "ResponseEntity>"); + "import kotlinx.coroutines.flow.Flow", "ResponseEntity>"); assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2Api.kt"), - "exchange"); + "exchange"); assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"), - "import kotlinx.coroutines.flow.Flow", "ResponseEntity>"); + "import kotlinx.coroutines.flow.Flow", "ResponseEntity>"); assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"), - "suspend fun", "ApiUtil"); + "suspend fun", "ApiUtil"); assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3Api.kt"), - "import kotlinx.coroutines.flow.Flow", "requestBody: Flow"); + "import kotlinx.coroutines.flow.Flow", "requestBody: Flow"); assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3Api.kt"), - "exchange"); + "exchange"); assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt"), - "import kotlinx.coroutines.flow.Flow", "suspend fun", "requestBody: Flow"); + "import kotlinx.coroutines.flow.Flow", "suspend fun", "requestBody: Flow"); assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt"), - "ApiUtil"); + "ApiUtil"); } @Test @@ -400,7 +400,7 @@ public void doNotGenerateRequestParamForObjectQueryParam() throws IOException { String outputPath = output.getAbsolutePath().replace('\\', '/'); OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/objectQueryParam.yaml", null, new ParseOptions()).getOpenAPI(); + .readLocation("src/test/resources/3_0/objectQueryParam.yaml", null, new ParseOptions()).getOpenAPI(); KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); codegen.setOutputDir(output.getAbsolutePath()); @@ -430,7 +430,7 @@ public void doGenerateRequestParamForSimpleParam() throws IOException { String outputPath = output.getAbsolutePath().replace('\\', '/'); OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/issue_3248.yaml", null, new ParseOptions()).getOpenAPI(); + .readLocation("src/test/resources/3_0/issue_3248.yaml", null, new ParseOptions()).getOpenAPI(); KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); codegen.setOutputDir(output.getAbsolutePath()); @@ -467,7 +467,7 @@ public void generateFormatForDateAndDateTimeQueryParam() throws IOException { String outputPath = output.getAbsolutePath().replace('\\', '/'); OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/issue_2053.yaml", null, new ParseOptions()).getOpenAPI(); + .readLocation("src/test/resources/3_0/issue_2053.yaml", null, new ParseOptions()).getOpenAPI(); KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); codegen.setOutputDir(output.getAbsolutePath()); @@ -487,12 +487,12 @@ public void generateFormatForDateAndDateTimeQueryParam() throws IOException { generator.opts(input).generate(); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ElephantsApiController.kt"), - "@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE)" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ElephantsApiController.kt"), + "@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE)" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ZebrasApiController.kt"), - "@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ZebrasApiController.kt"), + "@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)" ); } @@ -507,13 +507,13 @@ public void beanQualifiers() throws Exception { codegen.additionalProperties().put(KotlinSpringServerCodegen.BEAN_QUALIFIERS, true); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/bean-qualifiers.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/bean-qualifiers.yaml")) + .config(codegen)) + .generate(); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"), - "@RestController(\"org.openapitools.api.PingApiController\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"), + "@RestController(\"org.openapitools.api.PingApiController\")" ); } @@ -529,13 +529,13 @@ public void skipDefaultInterface() throws Exception { codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/skip-default-interface.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/skip-default-interface.yaml")) + .config(codegen)) + .generate(); assertFileNotContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApi.kt"), - "return " + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApi.kt"), + "return " ); } @@ -551,13 +551,13 @@ public void cookieParameterGenerationApis() throws Exception { codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml")) + .config(codegen)) + .generate(); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApi.kt"), - "@CookieValue" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApi.kt"), + "@CookieValue" ); } @@ -571,13 +571,13 @@ public void cookieParameterGenerationControllers() throws Exception { codegen.setOutputDir(output.getAbsolutePath()); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml")) + .config(codegen)) + .generate(); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApiController.kt"), - "@CookieValue" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApiController.kt"), + "@CookieValue" ); } @@ -592,21 +592,21 @@ public void useSpringBoot3() throws Exception { codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_SPRING_BOOT3, true); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13578_use_springboot3_jakarta_extension.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13578_use_springboot3_jakarta_extension.yaml")) + .config(codegen)) + .generate(); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ApiUtil.kt"), - "import jakarta.servlet.http.HttpServletResponse" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ApiUtil.kt"), + "import jakarta.servlet.http.HttpServletResponse" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/Exceptions.kt"), - "import jakarta.validation.ConstraintViolationException" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/Exceptions.kt"), + "import jakarta.validation.ConstraintViolationException" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"), - "import jakarta.validation.Valid" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"), + "import jakarta.validation.Valid" ); } @@ -628,12 +628,12 @@ private static void testMultiLineOperationDescription(final boolean isInterfaceO KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); codegen.setOutputDir(output.getAbsolutePath()); codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY, - isInterfaceOnly); + isInterfaceOnly); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue4111-multiline-operation-description.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue4111-multiline-operation-description.yaml")) + .config(codegen)) + .generate(); final String pingApiFileName; if (isInterfaceOnly) { @@ -642,15 +642,15 @@ private static void testMultiLineOperationDescription(final boolean isInterfaceO pingApiFileName = "PingApiController.kt"; } assertFileContains( - Paths.get( - outputPath + "/src/main/kotlin/org/openapitools/api/" + pingApiFileName), - "description = \"\"\"# Multi-line descriptions\n" - + "\n" - + "This is an example of a multi-line description.\n" - + "\n" - + "It:\n" - + "- has multiple lines\n" - + "- uses Markdown (CommonMark) for rich text representation\"\"\"" + Paths.get( + outputPath + "/src/main/kotlin/org/openapitools/api/" + pingApiFileName), + "description = \"\"\"# Multi-line descriptions\n" + + "\n" + + "This is an example of a multi-line description.\n" + + "\n" + + "It:\n" + + "- has multiple lines\n" + + "- uses Markdown (CommonMark) for rich text representation\"\"\"" ); } @@ -664,25 +664,25 @@ public void useTargetOnInterfaceAnnotations() throws IOException { codegen.setOutputDir(output.getAbsolutePath()); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml")) + .config(codegen)) + .generate(); assertFileNotContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@Schema(example = \"null\", description = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@Schema(example = \"null\", description = \"\")" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@get:Schema(example = \"null\", description = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@get:Schema(example = \"null\", description = \"\")" ); assertFileNotContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@get:Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@get:Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")" ); } @@ -698,25 +698,25 @@ public void useTargetOnInterfaceAnnotationsWithSwagger1() throws IOException { codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, DocumentationProvider.SPRINGFOX.toCliOptValue()); new DefaultGenerator().opts(new ClientOptInput() - .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml")) - .config(codegen)) - .generate(); + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml")) + .config(codegen)) + .generate(); assertFileNotContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@ApiModelProperty(example = \"null\", value = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@ApiModelProperty(example = \"null\", value = \"\")" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@get:ApiModelProperty(example = \"null\", value = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@get:ApiModelProperty(example = \"null\", value = \"\")" ); assertFileNotContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@ApiModelProperty(example = \"null\", required = true, value = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@ApiModelProperty(example = \"null\", required = true, value = \"\")" ); assertFileContains( - Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), - "@get:ApiModelProperty(example = \"null\", required = true, value = \"\")" + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"), + "@get:ApiModelProperty(example = \"null\", required = true, value = \"\")" ); } @@ -726,7 +726,7 @@ public void useBeanValidationGenerateAnnotationsForRequestBody() throws IOExcept output.deleteOnExit(); OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_13932.yml", null, new ParseOptions()).getOpenAPI(); + .readLocation("src/test/resources/bugs/issue_13932.yml", null, new ParseOptions()).getOpenAPI(); KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); codegen.setOutputDir(output.getAbsolutePath()); codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY, "true"); @@ -735,19 +735,88 @@ public void useBeanValidationGenerateAnnotationsForRequestBody() throws IOExcept codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); + .openAPI(openAPI) + .config(codegen); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); assertFileContains( - Paths.get(files.get("AddApi.kt").getAbsolutePath()), - "@Min(2)" + Paths.get(files.get("AddApi.kt").getAbsolutePath()), + "@Min(2)" ); } + @Test + public void givenMultipartFormArray_whenGenerateDelegateAndService_thenParameterIsCreatedAsListOfMultipartFile() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/petstore-with-tags.yaml"); + final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setDelegatePattern(true); + codegen.setServiceInterface(true); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + Path delegateFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt"); + assertFileContains(delegateFile, "additionalMetadata: kotlin.String?"); + assertFileContains(delegateFile, "images: Array"); + + Path controllerFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApi.kt"); + assertFileContains(controllerFile, "images: Array"); + + + Path serviceFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiService.kt"); + assertFileContains(serviceFile, "images: Array"); + } + + @Test + public void givenOctetStreamResponseType_whenGenerateServer_thenReturnTypeIsResource() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/petstore-with-tags.yaml"); + final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt"); + + assertFileContains(outputFilepath, "): ResponseEntity"); + } + @Test public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreatedAsRequestPart() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -776,9 +845,9 @@ public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreate Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt"); assertFileContains(outputFilepath, - "@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?"); + "@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?"); assertFileContains(outputFilepath, - "@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.core.io.Resource?"); + "@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.web.multipart.MultipartFile"); } diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-tags.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-tags.yaml index 1f33f481042f..062ab023e2d0 100644 --- a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-tags.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-tags.yaml @@ -8,19 +8,19 @@ info: url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 servers: -- url: http://petstore.swagger.io/v2 + - url: http://petstore.swagger.io/v2 tags: -- name: pet - description: Everything about your Pets -- name: store - description: Access to Petstore orders -- name: user - description: Operations about user + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user paths: /pet: put: tags: - - pet tag + - pet tag summary: Update an existing pet operationId: updatePet requestBody: @@ -36,21 +36,21 @@ paths: responses: 400: description: Invalid ID supplied - content: {} + content: { } 404: description: Pet not found - content: {} + content: { } 405: description: Validation exception - content: {} + content: { } security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets x-codegen-request-body-name: body post: tags: - - pet tag + - pet tag summary: Add a new pet to the store operationId: addPet requestBody: @@ -66,35 +66,35 @@ paths: responses: 405: description: Invalid input - content: {} + content: { } security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets x-codegen-request-body-name: body /pet/findByStatus: get: tags: - - pet tag + - pet tag summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: true - style: form - explode: false - schema: - type: array - items: - type: string - default: available - enum: - - available - - pending - - sold + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + default: available + enum: + - available + - pending + - sold responses: 200: description: successful operation @@ -111,31 +111,31 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid status value - content: {} + content: { } security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets x-spring-paginated: true /pet/findByTags: get: tags: - - pet tag + - pet tag summary: Finds Pets by tags description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - - name: tags - in: query - description: Tags to filter by - required: true - style: form - explode: false - schema: - type: array - items: - type: string + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string responses: 200: description: successful operation @@ -152,28 +152,28 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid tag value - content: {} + content: { } deprecated: true security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets x-spring-paginated: true /pet/{petId}: get: tags: - - pet tag + - pet tag summary: Find pet by ID description: Returns a single pet operationId: getPetById parameters: - - name: petId - in: path - description: ID of pet to return - required: true - schema: - type: integer - format: int64 + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 responses: 200: description: successful operation @@ -186,25 +186,25 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid ID supplied - content: {} + content: { } 404: description: Pet not found - content: {} + content: { } security: - - api_key: [] + - api_key: [ ] post: tags: - - pet tag + - pet tag summary: Updates a pet in the store with form data operationId: updatePetWithForm parameters: - - name: petId - in: path - description: ID of pet that needs to be updated - required: true - schema: - type: integer - format: int64 + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 requestBody: content: application/x-www-form-urlencoded: @@ -219,50 +219,50 @@ paths: responses: 405: description: Invalid input - content: {} + content: { } security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets delete: tags: - - pet tag + - pet tag summary: Deletes a pet operationId: deletePet parameters: - - name: api_key - in: header - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 + - name: api_key + in: header + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 responses: 400: description: Invalid pet value - content: {} + content: { } security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets /pet/{petId}/uploadImage: post: tags: - - pet tag + - pet tag summary: uploads an image operationId: uploadFile parameters: - - name: petId - in: path - description: ID of pet to update - required: true - schema: - type: integer - format: int64 + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 requestBody: content: multipart/form-data: @@ -285,13 +285,80 @@ paths: schema: $ref: '#/components/schemas/ApiResponse' security: - - petstore_auth: - - write:pets - - read:pets + - petstore_auth: + - write:pets + - read:pets + /pet/{petId}/uploadMultipleImage: + post: + tags: + - pet tag + summary: uploads multiple images + operationId: uploadMultipleFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + type: string + description: Additional data to pass to server + required: false + images: + type: array + items: + type: string + description: image to upload + format: binary + required: true + responses: + 200: + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - write:pets + - read:pets + /pet/{petId}/getImage: + get: + tags: + - pet tag + summary: Get an image + operationId: getImage + parameters: + - name: petId + in: path + description: ID of pet to get image + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - petstore_auth: + - write:pets + - read:pets /store/inventory: get: tags: - - store tag + - store tag summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory @@ -306,11 +373,11 @@ paths: type: integer format: int32 security: - - api_key: [] + - api_key: [ ] /store/order: post: tags: - - store tag + - store tag summary: Place an order for a pet operationId: placeOrder requestBody: @@ -332,26 +399,26 @@ paths: $ref: '#/components/schemas/Order' 400: description: Invalid Order - content: {} + content: { } x-codegen-request-body-name: body /store/order/{orderId}: get: tags: - - store tag + - store tag summary: Find purchase order by ID description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions operationId: getOrderById parameters: - - name: orderId - in: path - description: ID of pet that needs to be fetched - required: true - schema: - maximum: 5 - minimum: 1 - type: integer - format: int64 + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + maximum: 5 + minimum: 1 + type: integer + format: int64 responses: 200: description: successful operation @@ -364,35 +431,35 @@ paths: $ref: '#/components/schemas/Order' 400: description: Invalid ID supplied - content: {} + content: { } 404: description: Order not found - content: {} + content: { } delete: tags: - - store tag + - store tag summary: Delete purchase order by ID description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - - name: orderId - in: path - description: ID of the order that needs to be deleted - required: true - schema: - type: string + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string responses: 400: description: Invalid ID supplied - content: {} + content: { } 404: description: Order not found - content: {} + content: { } /user: post: tags: - - user tag + - user tag summary: Create user description: This can only be done by the logged in user. operationId: createUser @@ -406,12 +473,12 @@ paths: responses: default: description: successful operation - content: {} + content: { } x-codegen-request-body-name: body /user/createWithArray: post: tags: - - user tag + - user tag summary: Creates list of users with given input array operationId: createUsersWithArrayInput requestBody: @@ -426,12 +493,12 @@ paths: responses: default: description: successful operation - content: {} + content: { } x-codegen-request-body-name: body /user/createWithList: post: tags: - - user tag + - user tag summary: Creates list of users with given input array operationId: createUsersWithListInput requestBody: @@ -446,27 +513,27 @@ paths: responses: default: description: successful operation - content: {} + content: { } x-codegen-request-body-name: body /user/login: get: tags: - - user tag + - user tag summary: Logs user into the system operationId: loginUser parameters: - - name: username - in: query - description: The user name for login - required: true - schema: - type: string - - name: password - in: query - description: The password for login in clear text - required: true - schema: - type: string + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string responses: 200: description: successful operation @@ -490,39 +557,39 @@ paths: type: string 400: description: Invalid username/password supplied - content: {} + content: { } /user/logout: get: tags: - - user tag + - user tag summary: Logs out current logged in user session operationId: logoutUser responses: default: description: successful operation - content: {} + content: { } options: tags: - - user tag + - user tag summary: logoutUserOptions operationId: logoutUserOptions responses: default: description: endpoint configuration response - content: {} + content: { } /user/{username}: get: tags: - - user tag + - user tag summary: Get user by user name operationId: getUserByName parameters: - - name: username - in: path - description: The name that needs to be fetched. Use user1 for testing. - required: true - schema: - type: string + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string responses: 200: description: successful operation @@ -535,23 +602,23 @@ paths: $ref: '#/components/schemas/User' 400: description: Invalid username supplied - content: {} + content: { } 404: description: User not found - content: {} + content: { } put: tags: - - user tag + - user tag summary: Updated user description: This can only be done by the logged in user. operationId: updateUser parameters: - - name: username - in: path - description: name that need to be deleted - required: true - schema: - type: string + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string requestBody: description: Updated user object content: @@ -562,31 +629,31 @@ paths: responses: 400: description: Invalid user supplied - content: {} + content: { } 404: description: User not found - content: {} + content: { } x-codegen-request-body-name: body delete: tags: - - user tag + - user tag summary: Delete user description: This can only be done by the logged in user. operationId: deleteUser parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string responses: 400: description: Invalid username supplied - content: {} + content: { } 404: description: User not found - content: {} + content: { } components: schemas: Order: @@ -609,9 +676,9 @@ components: type: string description: Order Status enum: - - placed - - approved - - delivered + - placed + - approved + - delivered complete: type: boolean default: false @@ -671,8 +738,8 @@ components: Pet: title: a Pet required: - - name - - photoUrls + - name + - photoUrls type: object properties: id: @@ -701,9 +768,9 @@ components: type: string description: pet status in the store enum: - - available - - pending - - sold + - available + - pending + - sold description: A pet for sale in the pet store xml: name: Pet diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt index 0ec25b5a5748..552f91204954 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -110,7 +110,7 @@ interface PetApi { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt index 81bd74f4213d..fc44c9d500ab 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -176,7 +176,7 @@ class PetApiController() { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt index 14f6f0ae6d88..41c0da8045e0 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -106,7 +106,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiService.kt index 04f76e4963ed..54df94484e45 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -99,5 +99,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 35dffecfac0f..a81dbcbdb0a5 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt index cd26fb897edc..95ae87a12c04 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -199,7 +199,7 @@ interface PetApi { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return getDelegate().uploadFile(petId, additionalMetadata, file) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt index 8ecb4c46bc51..8a8b79e04afd 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource import java.util.Optional @@ -69,6 +68,6 @@ interface PetApiDelegate { */ fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, - file: Resource?): ResponseEntity + file: org.springframework.web.multipart.MultipartFile?): ResponseEntity } diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt index 3bcb84444b9c..cde9ef1d2883 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource import java.util.Optional diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt index 4cdbf737cf5c..f6cd7e70b522 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource import java.util.Optional diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 708df6fda217..6f19103223ca 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -198,7 +198,7 @@ interface PetApi { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return getDelegate().uploadFile(petId, additionalMetadata, file) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt index 7a173551ccbe..ea2fd10a0062 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -151,7 +150,7 @@ interface PetApiDelegate { */ fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, - file: Resource?): ResponseEntity { + file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt index 49366c5d72ce..47f101468e91 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt index 818d5c84fdfd..def5e179e017 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest -import org.springframework.core.io.Resource import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt index c2410b3266ee..ad45a6ad8be2 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt index ee0e3bef83cc..bee779a69332 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -90,5 +90,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 452e4e400b7c..6b401e7ee880 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt index a2b304ac2f29..f9a8789ef3d0 100644 --- a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt @@ -46,7 +46,7 @@ class MultipartMixedApiController() { value = ["/multipart-mixed"], consumes = ["multipart/form-data"] ) - fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.core.io.Resource,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity { + fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.web.multipart.MultipartFile,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt index db8e1ef75c4f..8f13477bde2d 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -173,7 +173,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt index 4e368ce87c59..b61111bac52d 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -91,5 +91,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 263716758a7f..187e1f345153 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -35,7 +35,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt index 87da8582986c..c58fdf8d09bc 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -196,7 +196,7 @@ interface PetApi { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt index eab188e87bfa..c8dcb731d8ac 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiService.kt index ee0e3bef83cc..bee779a69332 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -90,5 +90,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 452e4e400b7c..6b401e7ee880 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt index c2410b3266ee..ad45a6ad8be2 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiService.kt index ee0e3bef83cc..bee779a69332 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -90,5 +90,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 452e4e400b7c..6b401e7ee880 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt index eab188e87bfa..c8dcb731d8ac 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiService.kt index ee0e3bef83cc..bee779a69332 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -90,5 +90,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 452e4e400b7c..6b401e7ee880 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt index 030db2ed8988..ee8089e3b344 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -105,7 +105,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity { return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index ee0e3bef83cc..bee779a69332 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -90,5 +90,5 @@ interface PetApiService { * @return successful operation (status code 200) * @see PetApi#uploadFile */ - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 452e4e400b7c..6b401e7ee880 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse { TODO("Implement me") } } From 4a6dbace73d2d9e7fef3538bd507ceca14bcece8 Mon Sep 17 00:00:00 2001 From: Nate Todd Date: Wed, 4 Dec 2024 02:25:24 -0500 Subject: [PATCH 26/40] [elixir] Update dialyzer spec (#20024) * Update evaluate_response spec to support returning a list of structs * Update elixir samples --- .../src/main/resources/elixir/request_builder.ex.mustache | 5 +++-- .../petstore/elixir/lib/openapi_petstore/request_builder.ex | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache index 9adcc14e005c..9ff0fba72d06 100644 --- a/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache @@ -160,10 +160,11 @@ defmodule {{moduleName}}.RequestBuilder do ### Returns - - `{:ok, struct}` or `{:ok, Tesla.Env.t()}` on success + - `{:ok, struct}`, {:ok, [struct]} or `{:ok, Tesla.Env.t()}` on success - `{:error, term}` on failure """ - @spec evaluate_response(Tesla.Env.result(), response_mapping) :: {:ok, struct()} | Tesla.Env.result() + @spec evaluate_response(Tesla.Env.result(), response_mapping) :: + {:ok, struct() | [struct()] | Tesla.Env.t()} | {:error, Tesla.Env.t() | any()} def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do resolve_mapping(env, mapping, nil) end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex b/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex index 96897d8db3b7..987ac303f500 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex @@ -162,10 +162,11 @@ defmodule OpenapiPetstore.RequestBuilder do ### Returns - - `{:ok, struct}` or `{:ok, Tesla.Env.t()}` on success + - `{:ok, struct}`, {:ok, [struct]} or `{:ok, Tesla.Env.t()}` on success - `{:error, term}` on failure """ - @spec evaluate_response(Tesla.Env.result(), response_mapping) :: {:ok, struct()} | Tesla.Env.result() + @spec evaluate_response(Tesla.Env.result(), response_mapping) :: + {:ok, struct() | [struct()] | Tesla.Env.t()} | {:error, Tesla.Env.t() | any()} def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do resolve_mapping(env, mapping, nil) end From 018362085496f78661b640ad394b3003c2fbdb7c Mon Sep 17 00:00:00 2001 From: Francesco Saverio <112965339+SaverioCode@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:06:45 +0100 Subject: [PATCH 27/40] [cpprestsdk] Implement Enum inside Objects (#19919) * Fix #19566 implemented the missing definition of declared methods inside openapi-generator/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache, have also be added two missing body of methods definitions * Regenerated cpp-restsdk client samples * Fixed shared_ptr creation * [cpprestsdk] Implement enum inside objects --- .../cpp-rest-sdk-client/model-header.mustache | 61 +++++++-- .../cpp-rest-sdk-client/model-source.mustache | 120 +++++++++++++++--- .../CppRestPetstoreClient/model/ApiResponse.h | 23 +++- .../CppRestPetstoreClient/model/Category.h | 17 ++- .../model/CreateUserOrPet_request.h | 1 + .../CppRestPetstoreClient/model/Order.h | 65 ++++++++-- .../include/CppRestPetstoreClient/model/Pet.h | 66 ++++++++-- .../model/SchemaWithSet.h | 18 ++- .../model/SchemaWithSet_vaccinationBook.h | 12 +- .../include/CppRestPetstoreClient/model/Tag.h | 17 ++- .../CppRestPetstoreClient/model/User.h | 54 ++++++-- .../CppRestPetstoreClient/model/Vaccine.h | 17 ++- .../client/src/model/ApiResponse.cpp | 31 ++++- .../cpp-restsdk/client/src/model/Category.cpp | 22 +++- .../cpp-restsdk/client/src/model/Order.cpp | 107 +++++++++++++--- .../cpp-restsdk/client/src/model/Pet.cpp | 114 ++++++++++++++--- .../client/src/model/SchemaWithSet.cpp | 25 +++- .../model/SchemaWithSet_vaccinationBook.cpp | 16 ++- .../cpp-restsdk/client/src/model/Tag.cpp | 22 +++- .../cpp-restsdk/client/src/model/User.cpp | 75 +++++++++-- .../cpp-restsdk/client/src/model/Vaccine.cpp | 22 +++- 21 files changed, 755 insertions(+), 150 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index e7374f4a1018..9536512f0f73 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -8,6 +8,9 @@ #ifndef {{modelHeaderGuardPrefix}}_{{classname}}_H_ #define {{modelHeaderGuardPrefix}}_{{classname}}_H_ +{{#hasEnums}} +#include +{{/hasEnums}} {{#oneOf}} {{#-first}} #include @@ -146,34 +149,64 @@ public: void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// {{classname}} members - {{#vars}} - {{^isInherited}} + {{! ENUM DEFINITIONS }} + {{#vars}}{{^isInherited}}{{#isEnum}} + enum class {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}} + { + {{#allowableValues}}{{#enumVars}}{{value}}, + {{/enumVars}}{{/allowableValues}} + }; /// /// {{description}} /// - {{#isContainer}}{{{dataType}}}& {{getter}}(); - {{/isContainer}}{{^isContainer}}{{{dataType}}} {{getter}}() const; - {{/isContainer}}bool {{nameInCamelCase}}IsSet() const; + {{/isEnum}}{{/isInherited}}{{/vars}}{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}} + {{! ENUM CONVERSIONS }} + {{{enumName}}} to{{{enumName}}}(const utility::string_t& value) const; + const utility::string_t from{{{enumName}}}(const {{{enumName}}} value) const; + {{#isArray}} + {{{datatypeWithEnum}}} to{{{enumName}}}(const {{{dataType}}}& value) const; + {{{dataType}}} from{{{enumName}}}(const {{{datatypeWithEnum}}}& value) const; + {{/isArray}}{{/isContainer}}{{^isContainer}} + {{{datatypeWithEnum}}} to{{{datatypeWithEnum}}}(const utility::string_t& value) const; + const utility::string_t from{{{datatypeWithEnum}}}(const {{{datatypeWithEnum}}} value) const; + {{/isContainer}}{{/isEnum}}{{/isInherited}}{{/vars}} + + {{! SETTER AND GETTERS }} + {{#vars}}{{^isInherited}} + /// + /// {{description}} + /// + {{#isContainer}}{{^isEnum}} + {{{dataType}}} {{getter}}() const; + {{/isEnum}}{{/isContainer}}{{^isContainer}}{{^isEnum}} + {{{dataType}}} {{getter}}() const; + {{/isEnum}}{{/isContainer}} + {{#isEnum}}{{^isMap}} + {{{datatypeWithEnum}}} {{getter}}() const; + {{/isMap}}{{#isMap}} + {{{dataType}}} {{getter}}() const; + {{/isMap}}{{/isEnum}} + bool {{nameInCamelCase}}IsSet() const; void unset{{name}}(); - {{#isPrimitiveType}} void {{setter}}({{{dataType}}} value); - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}} void {{setter}}(const {{{dataType}}}& value); - {{/isPrimitiveType}} - - {{/isInherited}} - {{/vars}} + {{/isEnum}}{{/isPrimitiveType}}{{#isEnum}} + void {{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value); + {{/isEnum}}{{/isInherited}}{{/vars}} protected: {{#vars}} - {{^isInherited}} + {{^isInherited}}{{^isEnum}} {{{dataType}}} m_{{name}}; - bool m_{{name}}IsSet; + {{/isEnum}}{{#isEnum}} + {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} m_{{name}}; + {{/isEnum}}bool m_{{name}}IsSet; {{/isInherited}} {{/vars}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index 49e9894da568..175c0401d247 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -175,7 +175,6 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value) } {{/isEnum}} - {{^isEnum}} {{classname}}::{{classname}}() @@ -183,6 +182,7 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value) {{#vars}} {{^isInherited}} {{^isContainer}} + {{^isEnum}} {{#isPrimitiveType}} m_{{name}} = {{{defaultValue}}}; {{/isPrimitiveType}} @@ -194,6 +194,7 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value) m_{{name}} = {{{defaultValue}}}; {{/isDateTime}} {{/isPrimitiveType}} + {{/isEnum}} {{/isContainer}} m_{{name}}IsSet = false; {{/isInherited}} @@ -212,15 +213,27 @@ void {{classname}}::validate() web::json::value {{classname}}::toJson() const { {{#parent}} - web::json::value val = this->{{{.}}}::toJson();{{/parent}} + web::json::value val = this->{{{.}}}::toJson(); + {{/parent}} {{^parent}} web::json::value val = web::json::value::object(); {{/parent}} {{#vars}}{{^isInherited}} if(m_{{name}}IsSet) - { + { + {{#isEnum}}{{#isContainer}}{{#isArray}} + {{{dataType}}} refVal = from{{{enumName}}}(m_{{name}}); + {{/isArray}}{{#isMap}} val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(m_{{name}}); - }{{/isInherited}}{{/vars}} + {{/isMap}}{{/isContainer}}{{^isContainer}} + utility::string_t refVal = from{{{datatypeWithEnum}}}(m_{{name}}); + {{/isContainer}}{{^isMap}}val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(refVal); + {{/isMap}}{{/isEnum}} + {{^isEnum}} + val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(m_{{name}}); + {{/isEnum}} + } + {{/isInherited}}{{/vars}} return val; } @@ -239,7 +252,16 @@ bool {{classname}}::fromJson(const web::json::value& val) { {{{dataType}}} refVal_{{setter}}; ok &= ModelBase::fromJson(fieldValue, refVal_{{setter}}); + {{^isEnum}} + {{setter}}(refVal_{{setter}}); + {{/isEnum}} + {{#isEnum}}{{#isContainer}}{{#isArray}} + {{setter}}(to{{{enumName}}}(refVal_{{setter}})); + {{/isArray}}{{#isMap}} {{setter}}(refVal_{{setter}}); + {{/isMap}}{{/isContainer}}{{^isContainer}} + {{setter}}(to{{{datatypeWithEnum}}}(refVal_{{setter}})); + {{/isContainer}}{{/isEnum}} } }{{/isInherited}}{{/vars}} return ok; @@ -255,7 +277,16 @@ void {{classname}}::toMultipart(std::shared_ptr multipart, co {{#vars}} if(m_{{name}}IsSet) { + {{^isEnum}} multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}})); + {{/isEnum}} + {{#isEnum}}{{#isContainer}}{{#isArray}} + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), from{{{enumName}}}(m_{{name}}))); + {{/isArray}}{{#isMap}} + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}})); + {{/isMap}}{{/isContainer}}{{^isContainer}} + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), from{{{datatypeWithEnum}}}(m_{{name}}))); + {{/isContainer}}{{/isEnum}} } {{/vars}} } @@ -274,33 +305,93 @@ bool {{classname}}::fromMultiPart(std::shared_ptr multipart, { {{{dataType}}} refVal_{{setter}}; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("{{baseName}}"))), refVal_{{setter}} ); + {{^isEnum}} + {{setter}}(refVal_{{setter}}); + {{/isEnum}} + {{#isEnum}}{{#isContainer}}{{#isArray}} + {{setter}}(to{{{enumName}}}(refVal_{{setter}})); + {{/isArray}}{{#isMap}} {{setter}}(refVal_{{setter}}); + {{/isMap}}{{/isContainer}}{{^isContainer}} + {{setter}}(to{{{datatypeWithEnum}}}(refVal_{{setter}})); + {{/isContainer}}{{/isEnum}} } {{/vars}} return ok; } -{{#vars}} -{{^isInherited}} +{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}} +{{classname}}::{{{enumName}}} {{classname}}::to{{{enumName}}}(const utility::string_t& value) const +{{/isContainer}}{{^isContainer}} +{{classname}}::{{{datatypeWithEnum}}} {{classname}}::to{{{datatypeWithEnum}}}(const {{dataType}}& value) const +{{/isContainer}} +{ + {{#allowableValues}}{{#enumVars}} + if (value == utility::conversions::to_string_t("{{value}}")) { + return {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}::{{value}}; + } + {{/enumVars}}{{/allowableValues}} + throw std::invalid_argument("Invalid value for conversion to {{{datatypeWithEnum}}}"); +} + {{#isContainer}} -{{{dataType}}}& {{classname}}::{{getter}}() +const utility::string_t {{classname}}::from{{{enumName}}}(const {{{enumName}}} value) const +{{/isContainer}}{{^isContainer}} +const {{dataType}} {{classname}}::from{{{datatypeWithEnum}}}(const {{{datatypeWithEnum}}} value) const +{{/isContainer}} +{ + switch(value) + { + {{#allowableValues}}{{#enumVars}} + case {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}::{{value}}: return utility::conversions::to_string_t("{{value}}"); + {{/enumVars}}{{/allowableValues}} + } +} + +{{#isContainer}}{{#isArray}} +{{{dataType}}} {{{classname}}}::from{{{enumName}}}(const {{{datatypeWithEnum}}}& value) const +{ + {{{dataType}}} ret; + for (auto it = value.begin(); it != value.end(); it++) { + ret.push_back(from{{{enumName}}}(*it)); + } + return ret; +} + +{{{baseType}}}<{{classname}}::{{{enumName}}}> {{{classname}}}::to{{{enumName}}}(const {{{dataType}}}& value) const +{ + {{{datatypeWithEnum}}} ret; + for (auto it = value.begin(); it != value.end(); it++) { + ret.push_back(to{{{enumName}}}(*it)); + } + return ret; +} +{{/isArray}}{{/isContainer}}{{/isEnum}}{{/isInherited}}{{/vars}} + +{{#vars}}{{^isInherited}}{{#isContainer}}{{^isEnum}} +{{{dataType}}} {{classname}}::{{getter}}() const { return m_{{name}}; } -{{/isContainer}} -{{^isContainer}} +{{/isEnum}}{{/isContainer}}{{^isContainer}}{{^isEnum}} {{{dataType}}} {{classname}}::{{getter}}() const { return m_{{name}}; } -{{/isContainer}} +{{/isEnum}}{{/isContainer}}{{#isEnum}} +{{^isMap}}{{#isArray}}{{{baseType}}}<{{/isArray}}{{{classname}}}::{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} {{classname}}::{{getter}}() const +{ + return m_{{name}}; +} +{{/isEnum}} {{#isPrimitiveType}} void {{classname}}::{{setter}}({{{dataType}}} value) -{{/isPrimitiveType}} -{{^isPrimitiveType}} +{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}} void {{classname}}::{{setter}}(const {{{dataType}}}& value) -{{/isPrimitiveType}} +{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}} +void {{classname}}::{{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value) +{{/isEnum}} { m_{{name}} = value; m_{{name}}IsSet = true; @@ -315,8 +406,7 @@ void {{classname}}::unset{{name}}() { m_{{name}}IsSet = false; } -{{/isInherited}} -{{/vars}} +{{/isInherited}}{{/vars}} {{/isEnum}} {{/oneOf}} {{#modelNamespaceDeclarations}} diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h index d834aa029315..a7b7c86819da 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h @@ -51,42 +51,57 @@ class ApiResponse void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// ApiResponse members + + + /// /// /// + int32_t getCode() const; + + bool codeIsSet() const; void unsetCode(); - void setCode(int32_t value); - + /// /// /// + utility::string_t getType() const; + + bool typeIsSet() const; void unsetType(); void setType(const utility::string_t& value); - + /// /// /// + utility::string_t getMessage() const; + + bool messageIsSet() const; void unsetMessage(); void setMessage(const utility::string_t& value); - + protected: + int32_t m_Code; bool m_CodeIsSet; + utility::string_t m_Type; bool m_TypeIsSet; + utility::string_t m_Message; bool m_MessageIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h index db081b706c9e..0e2cc2d13219 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h @@ -51,31 +51,42 @@ class Category void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// Category members + + + /// /// /// + int64_t getId() const; + + bool idIsSet() const; void unsetId(); - void setId(int64_t value); - + /// /// /// + utility::string_t getName() const; + + bool nameIsSet() const; void unsetName(); void setName(const utility::string_t& value); - + protected: + int64_t m_Id; bool m_IdIsSet; + utility::string_t m_Name; bool m_NameIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h index 3e7ce867663c..8be441eb96b4 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h @@ -18,6 +18,7 @@ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ +#include #include #include "CppRestPetstoreClient/ModelBase.h" diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h index a6e782644cc3..d3ee6a7de51c 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h @@ -18,6 +18,7 @@ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ +#include #include "CppRestPetstoreClient/ModelBase.h" @@ -51,75 +52,113 @@ class Order void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// Order members + + enum class StatusEnum + { + placed, + approved, + delivered, + + }; + /// + /// Order Status + /// + + StatusEnum toStatusEnum(const utility::string_t& value) const; + const utility::string_t fromStatusEnum(const StatusEnum value) const; + + + /// /// /// + int64_t getId() const; + + bool idIsSet() const; void unsetId(); - void setId(int64_t value); - + /// /// /// + int64_t getPetId() const; + + bool petIdIsSet() const; void unsetPetId(); - void setPetId(int64_t value); - + /// /// /// + int32_t getQuantity() const; + + bool quantityIsSet() const; void unsetQuantity(); - void setQuantity(int32_t value); - + /// /// /// + utility::datetime getShipDate() const; + + bool shipDateIsSet() const; void unsetShipDate(); void setShipDate(const utility::datetime& value); - + /// /// Order Status /// - utility::string_t getStatus() const; + + + StatusEnum getStatus() const; + bool statusIsSet() const; void unsetStatus(); - void setStatus(const utility::string_t& value); - + void setStatus(const StatusEnum value); + /// /// /// + bool isComplete() const; + + bool completeIsSet() const; void unsetComplete(); - void setComplete(bool value); - + protected: + int64_t m_Id; bool m_IdIsSet; + int64_t m_PetId; bool m_PetIdIsSet; + int32_t m_Quantity; bool m_QuantityIsSet; + utility::datetime m_ShipDate; bool m_ShipDateIsSet; - utility::string_t m_Status; + + StatusEnum m_Status; bool m_StatusIsSet; + bool m_Complete; bool m_CompleteIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h index 9c10a6ba0c0e..16305368b11d 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h @@ -18,6 +18,7 @@ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ +#include #include "CppRestPetstoreClient/ModelBase.h" @@ -56,76 +57,117 @@ class Pet void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// Pet members + + enum class StatusEnum + { + available, + pending, + sold, + + }; + /// + /// pet status in the store + /// + + StatusEnum toStatusEnum(const utility::string_t& value) const; + const utility::string_t fromStatusEnum(const StatusEnum value) const; + + + /// /// /// + int64_t getId() const; + + bool idIsSet() const; void unsetId(); - void setId(int64_t value); - + /// /// /// + std::shared_ptr getCategory() const; + + bool categoryIsSet() const; void unsetCategory(); void setCategory(const std::shared_ptr& value); - + /// /// /// + utility::string_t getName() const; + + bool nameIsSet() const; void unsetName(); void setName(const utility::string_t& value); - + /// /// /// - std::vector& getPhotoUrls(); + + std::vector getPhotoUrls() const; + + bool photoUrlsIsSet() const; void unsetPhotoUrls(); void setPhotoUrls(const std::vector& value); - + /// /// /// - std::vector>& getTags(); + + std::vector> getTags() const; + + bool tagsIsSet() const; void unsetTags(); void setTags(const std::vector>& value); - + /// /// pet status in the store /// - utility::string_t getStatus() const; + + + StatusEnum getStatus() const; + bool statusIsSet() const; void unsetStatus(); - void setStatus(const utility::string_t& value); - + void setStatus(const StatusEnum value); + protected: + int64_t m_Id; bool m_IdIsSet; + std::shared_ptr m_Category; bool m_CategoryIsSet; + utility::string_t m_Name; bool m_NameIsSet; + std::vector m_PhotoUrls; bool m_PhotoUrlsIsSet; + std::vector> m_Tags; bool m_TagsIsSet; - utility::string_t m_Status; + + StatusEnum m_Status; bool m_StatusIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h index 90d154a585fd..f5d24906d377 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h @@ -54,31 +54,43 @@ class SchemaWithSet void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// SchemaWithSet members + + + /// /// pedigree and other certificates /// - std::set& getCertificates(); + + std::set getCertificates() const; + + bool certificatesIsSet() const; void unsetCertificates(); void setCertificates(const std::set& value); - + /// /// /// + std::shared_ptr getVaccinationBook() const; + + bool vaccinationBookIsSet() const; void unsetVaccinationBook(); void setVaccinationBook(const std::shared_ptr& value); - + protected: + std::set m_Certificates; bool m_CertificatesIsSet; + std::shared_ptr m_VaccinationBook; bool m_VaccinationBookIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h index 7903480decb7..cb47dc3b963e 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h @@ -53,20 +53,28 @@ class SchemaWithSet_vaccinationBook void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// SchemaWithSet_vaccinationBook members + + + /// /// /// - std::set>& getVaccines(); + + std::set> getVaccines() const; + + bool vaccinesIsSet() const; void unsetVaccines(); void setVaccines(const std::set>& value); - + protected: + std::set> m_Vaccines; bool m_VaccinesIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h index 142c6a65e2e1..393e17fd49ab 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h @@ -51,31 +51,42 @@ class Tag void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// Tag members + + + /// /// /// + int64_t getId() const; + + bool idIsSet() const; void unsetId(); - void setId(int64_t value); - + /// /// /// + utility::string_t getName() const; + + bool nameIsSet() const; void unsetName(); void setName(const utility::string_t& value); - + protected: + int64_t m_Id; bool m_IdIsSet; + utility::string_t m_Name; bool m_NameIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h index 3ace72266a6a..e9e88086af52 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h @@ -51,97 +51,131 @@ class User void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// User members + + + /// /// /// + int64_t getId() const; + + bool idIsSet() const; void unsetId(); - void setId(int64_t value); - + /// /// /// + utility::string_t getUsername() const; + + bool usernameIsSet() const; void unsetUsername(); void setUsername(const utility::string_t& value); - + /// /// /// + utility::string_t getFirstName() const; + + bool firstNameIsSet() const; void unsetFirstName(); void setFirstName(const utility::string_t& value); - + /// /// /// + utility::string_t getLastName() const; + + bool lastNameIsSet() const; void unsetLastName(); void setLastName(const utility::string_t& value); - + /// /// /// + utility::string_t getEmail() const; + + bool emailIsSet() const; void unsetEmail(); void setEmail(const utility::string_t& value); - + /// /// /// + utility::string_t getPassword() const; + + bool passwordIsSet() const; void unsetPassword(); void setPassword(const utility::string_t& value); - + /// /// /// + utility::string_t getPhone() const; + + bool phoneIsSet() const; void unsetPhone(); void setPhone(const utility::string_t& value); - + /// /// User Status /// + int32_t getUserStatus() const; + + bool userStatusIsSet() const; void unsetUserStatus(); - void setUserStatus(int32_t value); - + protected: + int64_t m_Id; bool m_IdIsSet; + utility::string_t m_Username; bool m_UsernameIsSet; + utility::string_t m_FirstName; bool m_FirstNameIsSet; + utility::string_t m_LastName; bool m_LastNameIsSet; + utility::string_t m_Email; bool m_EmailIsSet; + utility::string_t m_Password; bool m_PasswordIsSet; + utility::string_t m_Phone; bool m_PhoneIsSet; + int32_t m_UserStatus; bool m_UserStatusIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h index 376153de4aa4..05db96a4df83 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h @@ -51,31 +51,42 @@ class Vaccine void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + ///////////////////////////////////////////// /// Vaccine members + + + /// /// vaccination date /// + std::shared_ptr getDate() const; + + bool dateIsSet() const; void unsetdate(); void setDate(const std::shared_ptr& value); - + /// /// true if a booster is still needed to complete the vaccination /// + bool isBoosterRequired() const; + + bool boosterRequiredIsSet() const; void unsetBoosterRequired(); - void setBoosterRequired(bool value); - + protected: + std::shared_ptr m_date; bool m_dateIsSet; + bool m_BoosterRequired; bool m_BoosterRequiredIsSet; }; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp index 8ae8377b4a88..5f925cc56072 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - ApiResponse::ApiResponse() { m_Code = 0; @@ -41,21 +40,26 @@ void ApiResponse::validate() web::json::value ApiResponse::toJson() const { - web::json::value val = web::json::value::object(); if(m_CodeIsSet) - { + { + val[utility::conversions::to_string_t(U("code"))] = ModelBase::toJson(m_Code); } + if(m_TypeIsSet) - { + { + val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type); } + if(m_MessageIsSet) - { + { + val[utility::conversions::to_string_t(U("message"))] = ModelBase::toJson(m_Message); } + return val; } @@ -72,6 +76,7 @@ bool ApiResponse::fromJson(const web::json::value& val) int32_t refVal_setCode; ok &= ModelBase::fromJson(fieldValue, refVal_setCode); setCode(refVal_setCode); + } } if(val.has_field(utility::conversions::to_string_t(U("type")))) @@ -82,6 +87,7 @@ bool ApiResponse::fromJson(const web::json::value& val) utility::string_t refVal_setType; ok &= ModelBase::fromJson(fieldValue, refVal_setType); setType(refVal_setType); + } } if(val.has_field(utility::conversions::to_string_t(U("message")))) @@ -92,6 +98,7 @@ bool ApiResponse::fromJson(const web::json::value& val) utility::string_t refVal_setMessage; ok &= ModelBase::fromJson(fieldValue, refVal_setMessage); setMessage(refVal_setMessage); + } } return ok; @@ -107,14 +114,17 @@ void ApiResponse::toMultipart(std::shared_ptr multipart, cons if(m_CodeIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code")), m_Code)); + } if(m_TypeIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type)); + } if(m_MessageIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("message")), m_Message)); + } } @@ -132,22 +142,28 @@ bool ApiResponse::fromMultiPart(std::shared_ptr multipart, co int32_t refVal_setCode; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode ); setCode(refVal_setCode); + } if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) { utility::string_t refVal_setType; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType ); setType(refVal_setType); + } if(multipart->hasContent(utility::conversions::to_string_t(U("message")))) { utility::string_t refVal_setMessage; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_setMessage ); setMessage(refVal_setMessage); + } return ok; } + + + int32_t ApiResponse::getCode() const { return m_Code; @@ -168,11 +184,13 @@ void ApiResponse::unsetCode() { m_CodeIsSet = false; } + utility::string_t ApiResponse::getType() const { return m_Type; } + void ApiResponse::setType(const utility::string_t& value) { m_Type = value; @@ -188,11 +206,13 @@ void ApiResponse::unsetType() { m_TypeIsSet = false; } + utility::string_t ApiResponse::getMessage() const { return m_Message; } + void ApiResponse::setMessage(const utility::string_t& value) { m_Message = value; @@ -208,6 +228,7 @@ void ApiResponse::unsetMessage() { m_MessageIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp index 6049e144a02e..461149854a3b 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - Category::Category() { m_Id = 0L; @@ -39,17 +38,20 @@ void Category::validate() web::json::value Category::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) - { + { + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } + if(m_NameIsSet) - { + { + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); } + return val; } @@ -66,6 +68,7 @@ bool Category::fromJson(const web::json::value& val) int64_t refVal_setId; ok &= ModelBase::fromJson(fieldValue, refVal_setId); setId(refVal_setId); + } } if(val.has_field(utility::conversions::to_string_t(U("name")))) @@ -76,6 +79,7 @@ bool Category::fromJson(const web::json::value& val) utility::string_t refVal_setName; ok &= ModelBase::fromJson(fieldValue, refVal_setName); setName(refVal_setName); + } } return ok; @@ -91,10 +95,12 @@ void Category::toMultipart(std::shared_ptr multipart, const u if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } if(m_NameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } } @@ -112,16 +118,21 @@ bool Category::fromMultiPart(std::shared_ptr multipart, const int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); + } if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) { utility::string_t refVal_setName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); setName(refVal_setName); + } return ok; } + + + int64_t Category::getId() const { return m_Id; @@ -142,11 +153,13 @@ void Category::unsetId() { m_IdIsSet = false; } + utility::string_t Category::getName() const { return m_Name; } + void Category::setName(const utility::string_t& value) { m_Name = value; @@ -162,6 +175,7 @@ void Category::unsetName() { m_NameIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp index 59d63744aa50..dacb34ed96e1 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - Order::Order() { m_Id = 0L; @@ -30,7 +29,6 @@ Order::Order() m_QuantityIsSet = false; m_ShipDate = utility::datetime(); m_ShipDateIsSet = false; - m_Status = utility::conversions::to_string_t(""); m_StatusIsSet = false; m_Complete = false; m_CompleteIsSet = false; @@ -47,33 +45,46 @@ void Order::validate() web::json::value Order::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) - { + { + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } + if(m_PetIdIsSet) - { + { + val[utility::conversions::to_string_t(U("petId"))] = ModelBase::toJson(m_PetId); } + if(m_QuantityIsSet) - { + { + val[utility::conversions::to_string_t(U("quantity"))] = ModelBase::toJson(m_Quantity); } + if(m_ShipDateIsSet) - { + { + val[utility::conversions::to_string_t(U("shipDate"))] = ModelBase::toJson(m_ShipDate); } + if(m_StatusIsSet) - { - val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status); + { + + utility::string_t refVal = fromStatusEnum(m_Status); + val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(refVal); + } + if(m_CompleteIsSet) - { + { + val[utility::conversions::to_string_t(U("complete"))] = ModelBase::toJson(m_Complete); } + return val; } @@ -90,6 +101,7 @@ bool Order::fromJson(const web::json::value& val) int64_t refVal_setId; ok &= ModelBase::fromJson(fieldValue, refVal_setId); setId(refVal_setId); + } } if(val.has_field(utility::conversions::to_string_t(U("petId")))) @@ -100,6 +112,7 @@ bool Order::fromJson(const web::json::value& val) int64_t refVal_setPetId; ok &= ModelBase::fromJson(fieldValue, refVal_setPetId); setPetId(refVal_setPetId); + } } if(val.has_field(utility::conversions::to_string_t(U("quantity")))) @@ -110,6 +123,7 @@ bool Order::fromJson(const web::json::value& val) int32_t refVal_setQuantity; ok &= ModelBase::fromJson(fieldValue, refVal_setQuantity); setQuantity(refVal_setQuantity); + } } if(val.has_field(utility::conversions::to_string_t(U("shipDate")))) @@ -120,6 +134,7 @@ bool Order::fromJson(const web::json::value& val) utility::datetime refVal_setShipDate; ok &= ModelBase::fromJson(fieldValue, refVal_setShipDate); setShipDate(refVal_setShipDate); + } } if(val.has_field(utility::conversions::to_string_t(U("status")))) @@ -129,7 +144,9 @@ bool Order::fromJson(const web::json::value& val) { utility::string_t refVal_setStatus; ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); - setStatus(refVal_setStatus); + + setStatus(toStatusEnum(refVal_setStatus)); + } } if(val.has_field(utility::conversions::to_string_t(U("complete")))) @@ -140,6 +157,7 @@ bool Order::fromJson(const web::json::value& val) bool refVal_setComplete; ok &= ModelBase::fromJson(fieldValue, refVal_setComplete); setComplete(refVal_setComplete); + } } return ok; @@ -155,26 +173,33 @@ void Order::toMultipart(std::shared_ptr multipart, const util if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } if(m_PetIdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("petId")), m_PetId)); + } if(m_QuantityIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("quantity")), m_Quantity)); + } if(m_ShipDateIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("shipDate")), m_ShipDate)); + } if(m_StatusIsSet) { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status)); + + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), fromStatusEnum(m_Status))); + } if(m_CompleteIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("complete")), m_Complete)); + } } @@ -192,40 +217,84 @@ bool Order::fromMultiPart(std::shared_ptr multipart, const ut int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); + } if(multipart->hasContent(utility::conversions::to_string_t(U("petId")))) { int64_t refVal_setPetId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_setPetId ); setPetId(refVal_setPetId); + } if(multipart->hasContent(utility::conversions::to_string_t(U("quantity")))) { int32_t refVal_setQuantity; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_setQuantity ); setQuantity(refVal_setQuantity); + } if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate")))) { utility::datetime refVal_setShipDate; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_setShipDate ); setShipDate(refVal_setShipDate); + } if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) { utility::string_t refVal_setStatus; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); - setStatus(refVal_setStatus); + + setStatus(toStatusEnum(refVal_setStatus)); + } if(multipart->hasContent(utility::conversions::to_string_t(U("complete")))) { bool refVal_setComplete; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_setComplete ); setComplete(refVal_setComplete); + } return ok; } + +Order::StatusEnum Order::toStatusEnum(const utility::string_t& value) const +{ + + if (value == utility::conversions::to_string_t("placed")) { + return StatusEnum::placed; + } + + if (value == utility::conversions::to_string_t("approved")) { + return StatusEnum::approved; + } + + if (value == utility::conversions::to_string_t("delivered")) { + return StatusEnum::delivered; + } + + throw std::invalid_argument("Invalid value for conversion to StatusEnum"); +} + + +const utility::string_t Order::fromStatusEnum(const StatusEnum value) const +{ + switch(value) + { + + case StatusEnum::placed: return utility::conversions::to_string_t("placed"); + + case StatusEnum::approved: return utility::conversions::to_string_t("approved"); + + case StatusEnum::delivered: return utility::conversions::to_string_t("delivered"); + + } +} + + + + int64_t Order::getId() const { return m_Id; @@ -246,6 +315,7 @@ void Order::unsetId() { m_IdIsSet = false; } + int64_t Order::getPetId() const { return m_PetId; @@ -266,6 +336,7 @@ void Order::unsetPetId() { m_PetIdIsSet = false; } + int32_t Order::getQuantity() const { return m_Quantity; @@ -286,11 +357,13 @@ void Order::unsetQuantity() { m_QuantityIsSet = false; } + utility::datetime Order::getShipDate() const { return m_ShipDate; } + void Order::setShipDate(const utility::datetime& value) { m_ShipDate = value; @@ -306,12 +379,14 @@ void Order::unsetShipDate() { m_ShipDateIsSet = false; } -utility::string_t Order::getStatus() const + +Order::StatusEnum Order::getStatus() const { return m_Status; } -void Order::setStatus(const utility::string_t& value) + +void Order::setStatus(const StatusEnum value) { m_Status = value; m_StatusIsSet = true; @@ -326,6 +401,7 @@ void Order::unsetStatus() { m_StatusIsSet = false; } + bool Order::isComplete() const { return m_Complete; @@ -346,6 +422,7 @@ void Order::unsetComplete() { m_CompleteIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp index 05ad2365df59..678c7f78bd0b 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - Pet::Pet() { m_Id = 0L; @@ -29,7 +28,6 @@ Pet::Pet() m_NameIsSet = false; m_PhotoUrlsIsSet = false; m_TagsIsSet = false; - m_Status = utility::conversions::to_string_t(""); m_StatusIsSet = false; } @@ -44,33 +42,46 @@ void Pet::validate() web::json::value Pet::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) - { + { + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } + if(m_CategoryIsSet) - { + { + val[utility::conversions::to_string_t(U("category"))] = ModelBase::toJson(m_Category); } + if(m_NameIsSet) - { + { + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); } + if(m_PhotoUrlsIsSet) - { + { + val[utility::conversions::to_string_t(U("photoUrls"))] = ModelBase::toJson(m_PhotoUrls); } + if(m_TagsIsSet) - { + { + val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags); } + if(m_StatusIsSet) - { - val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status); + { + + utility::string_t refVal = fromStatusEnum(m_Status); + val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(refVal); + } + return val; } @@ -87,6 +98,7 @@ bool Pet::fromJson(const web::json::value& val) int64_t refVal_setId; ok &= ModelBase::fromJson(fieldValue, refVal_setId); setId(refVal_setId); + } } if(val.has_field(utility::conversions::to_string_t(U("category")))) @@ -97,6 +109,7 @@ bool Pet::fromJson(const web::json::value& val) std::shared_ptr refVal_setCategory; ok &= ModelBase::fromJson(fieldValue, refVal_setCategory); setCategory(refVal_setCategory); + } } if(val.has_field(utility::conversions::to_string_t(U("name")))) @@ -107,6 +120,7 @@ bool Pet::fromJson(const web::json::value& val) utility::string_t refVal_setName; ok &= ModelBase::fromJson(fieldValue, refVal_setName); setName(refVal_setName); + } } if(val.has_field(utility::conversions::to_string_t(U("photoUrls")))) @@ -117,6 +131,7 @@ bool Pet::fromJson(const web::json::value& val) std::vector refVal_setPhotoUrls; ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrls); setPhotoUrls(refVal_setPhotoUrls); + } } if(val.has_field(utility::conversions::to_string_t(U("tags")))) @@ -127,6 +142,7 @@ bool Pet::fromJson(const web::json::value& val) std::vector> refVal_setTags; ok &= ModelBase::fromJson(fieldValue, refVal_setTags); setTags(refVal_setTags); + } } if(val.has_field(utility::conversions::to_string_t(U("status")))) @@ -136,7 +152,9 @@ bool Pet::fromJson(const web::json::value& val) { utility::string_t refVal_setStatus; ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); - setStatus(refVal_setStatus); + + setStatus(toStatusEnum(refVal_setStatus)); + } } return ok; @@ -152,26 +170,33 @@ void Pet::toMultipart(std::shared_ptr multipart, const utilit if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } if(m_CategoryIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("category")), m_Category)); + } if(m_NameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } if(m_PhotoUrlsIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photoUrls")), m_PhotoUrls)); + } if(m_TagsIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags)); + } if(m_StatusIsSet) { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status)); + + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), fromStatusEnum(m_Status))); + } } @@ -189,40 +214,84 @@ bool Pet::fromMultiPart(std::shared_ptr multipart, const util int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); + } if(multipart->hasContent(utility::conversions::to_string_t(U("category")))) { std::shared_ptr refVal_setCategory; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_setCategory ); setCategory(refVal_setCategory); + } if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) { utility::string_t refVal_setName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); setName(refVal_setName); + } if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls")))) { std::vector refVal_setPhotoUrls; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_setPhotoUrls ); setPhotoUrls(refVal_setPhotoUrls); + } if(multipart->hasContent(utility::conversions::to_string_t(U("tags")))) { std::vector> refVal_setTags; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags ); setTags(refVal_setTags); + } if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) { utility::string_t refVal_setStatus; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); - setStatus(refVal_setStatus); + + setStatus(toStatusEnum(refVal_setStatus)); + } return ok; } + +Pet::StatusEnum Pet::toStatusEnum(const utility::string_t& value) const +{ + + if (value == utility::conversions::to_string_t("available")) { + return StatusEnum::available; + } + + if (value == utility::conversions::to_string_t("pending")) { + return StatusEnum::pending; + } + + if (value == utility::conversions::to_string_t("sold")) { + return StatusEnum::sold; + } + + throw std::invalid_argument("Invalid value for conversion to StatusEnum"); +} + + +const utility::string_t Pet::fromStatusEnum(const StatusEnum value) const +{ + switch(value) + { + + case StatusEnum::available: return utility::conversions::to_string_t("available"); + + case StatusEnum::pending: return utility::conversions::to_string_t("pending"); + + case StatusEnum::sold: return utility::conversions::to_string_t("sold"); + + } +} + + + + int64_t Pet::getId() const { return m_Id; @@ -243,11 +312,13 @@ void Pet::unsetId() { m_IdIsSet = false; } + std::shared_ptr Pet::getCategory() const { return m_Category; } + void Pet::setCategory(const std::shared_ptr& value) { m_Category = value; @@ -263,11 +334,13 @@ void Pet::unsetCategory() { m_CategoryIsSet = false; } + utility::string_t Pet::getName() const { return m_Name; } + void Pet::setName(const utility::string_t& value) { m_Name = value; @@ -283,11 +356,13 @@ void Pet::unsetName() { m_NameIsSet = false; } -std::vector& Pet::getPhotoUrls() + +std::vector Pet::getPhotoUrls() const { return m_PhotoUrls; } + void Pet::setPhotoUrls(const std::vector& value) { m_PhotoUrls = value; @@ -303,11 +378,13 @@ void Pet::unsetPhotoUrls() { m_PhotoUrlsIsSet = false; } -std::vector>& Pet::getTags() + +std::vector> Pet::getTags() const { return m_Tags; } + void Pet::setTags(const std::vector>& value) { m_Tags = value; @@ -323,12 +400,14 @@ void Pet::unsetTags() { m_TagsIsSet = false; } -utility::string_t Pet::getStatus() const + +Pet::StatusEnum Pet::getStatus() const { return m_Status; } -void Pet::setStatus(const utility::string_t& value) + +void Pet::setStatus(const StatusEnum value) { m_Status = value; m_StatusIsSet = true; @@ -343,6 +422,7 @@ void Pet::unsetStatus() { m_StatusIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp index e39f34d53b80..ba45d8b5ca40 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - SchemaWithSet::SchemaWithSet() { m_CertificatesIsSet = false; @@ -37,17 +36,20 @@ void SchemaWithSet::validate() web::json::value SchemaWithSet::toJson() const { - web::json::value val = web::json::value::object(); if(m_CertificatesIsSet) - { + { + val[utility::conversions::to_string_t(U("certificates"))] = ModelBase::toJson(m_Certificates); } + if(m_VaccinationBookIsSet) - { + { + val[utility::conversions::to_string_t(U("vaccinationBook"))] = ModelBase::toJson(m_VaccinationBook); } + return val; } @@ -64,6 +66,7 @@ bool SchemaWithSet::fromJson(const web::json::value& val) std::set refVal_setCertificates; ok &= ModelBase::fromJson(fieldValue, refVal_setCertificates); setCertificates(refVal_setCertificates); + } } if(val.has_field(utility::conversions::to_string_t(U("vaccinationBook")))) @@ -74,6 +77,7 @@ bool SchemaWithSet::fromJson(const web::json::value& val) std::shared_ptr refVal_setVaccinationBook; ok &= ModelBase::fromJson(fieldValue, refVal_setVaccinationBook); setVaccinationBook(refVal_setVaccinationBook); + } } return ok; @@ -89,10 +93,12 @@ void SchemaWithSet::toMultipart(std::shared_ptr multipart, co if(m_CertificatesIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("certificates")), m_Certificates)); + } if(m_VaccinationBookIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccinationBook")), m_VaccinationBook)); + } } @@ -110,21 +116,27 @@ bool SchemaWithSet::fromMultiPart(std::shared_ptr multipart, std::set refVal_setCertificates; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("certificates"))), refVal_setCertificates ); setCertificates(refVal_setCertificates); + } if(multipart->hasContent(utility::conversions::to_string_t(U("vaccinationBook")))) { std::shared_ptr refVal_setVaccinationBook; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccinationBook"))), refVal_setVaccinationBook ); setVaccinationBook(refVal_setVaccinationBook); + } return ok; } -std::set& SchemaWithSet::getCertificates() + + + +std::set SchemaWithSet::getCertificates() const { return m_Certificates; } + void SchemaWithSet::setCertificates(const std::set& value) { m_Certificates = value; @@ -140,11 +152,13 @@ void SchemaWithSet::unsetCertificates() { m_CertificatesIsSet = false; } + std::shared_ptr SchemaWithSet::getVaccinationBook() const { return m_VaccinationBook; } + void SchemaWithSet::setVaccinationBook(const std::shared_ptr& value) { m_VaccinationBook = value; @@ -160,6 +174,7 @@ void SchemaWithSet::unsetVaccinationBook() { m_VaccinationBookIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp index 22390674b280..f27c681113b9 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - SchemaWithSet_vaccinationBook::SchemaWithSet_vaccinationBook() { m_VaccinesIsSet = false; @@ -36,13 +35,14 @@ void SchemaWithSet_vaccinationBook::validate() web::json::value SchemaWithSet_vaccinationBook::toJson() const { - web::json::value val = web::json::value::object(); if(m_VaccinesIsSet) - { + { + val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines); } + return val; } @@ -59,6 +59,7 @@ bool SchemaWithSet_vaccinationBook::fromJson(const web::json::value& val) std::set> refVal_setVaccines; ok &= ModelBase::fromJson(fieldValue, refVal_setVaccines); setVaccines(refVal_setVaccines); + } } return ok; @@ -74,6 +75,7 @@ void SchemaWithSet_vaccinationBook::toMultipart(std::shared_ptradd(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccines")), m_Vaccines)); + } } @@ -91,15 +93,20 @@ bool SchemaWithSet_vaccinationBook::fromMultiPart(std::shared_ptr> refVal_setVaccines; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines ); setVaccines(refVal_setVaccines); + } return ok; } -std::set>& SchemaWithSet_vaccinationBook::getVaccines() + + + +std::set> SchemaWithSet_vaccinationBook::getVaccines() const { return m_Vaccines; } + void SchemaWithSet_vaccinationBook::setVaccines(const std::set>& value) { m_Vaccines = value; @@ -115,6 +122,7 @@ void SchemaWithSet_vaccinationBook::unsetVaccines() { m_VaccinesIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp index 537264d5c124..3c4d3c1fb67a 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - Tag::Tag() { m_Id = 0L; @@ -39,17 +38,20 @@ void Tag::validate() web::json::value Tag::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) - { + { + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } + if(m_NameIsSet) - { + { + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); } + return val; } @@ -66,6 +68,7 @@ bool Tag::fromJson(const web::json::value& val) int64_t refVal_setId; ok &= ModelBase::fromJson(fieldValue, refVal_setId); setId(refVal_setId); + } } if(val.has_field(utility::conversions::to_string_t(U("name")))) @@ -76,6 +79,7 @@ bool Tag::fromJson(const web::json::value& val) utility::string_t refVal_setName; ok &= ModelBase::fromJson(fieldValue, refVal_setName); setName(refVal_setName); + } } return ok; @@ -91,10 +95,12 @@ void Tag::toMultipart(std::shared_ptr multipart, const utilit if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } if(m_NameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } } @@ -112,16 +118,21 @@ bool Tag::fromMultiPart(std::shared_ptr multipart, const util int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); + } if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) { utility::string_t refVal_setName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); setName(refVal_setName); + } return ok; } + + + int64_t Tag::getId() const { return m_Id; @@ -142,11 +153,13 @@ void Tag::unsetId() { m_IdIsSet = false; } + utility::string_t Tag::getName() const { return m_Name; } + void Tag::setName(const utility::string_t& value) { m_Name = value; @@ -162,6 +175,7 @@ void Tag::unsetName() { m_NameIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp index 5c76ee51a362..e9b53ec07df1 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - User::User() { m_Id = 0L; @@ -51,41 +50,56 @@ void User::validate() web::json::value User::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) - { + { + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } + if(m_UsernameIsSet) - { + { + val[utility::conversions::to_string_t(U("username"))] = ModelBase::toJson(m_Username); } + if(m_FirstNameIsSet) - { + { + val[utility::conversions::to_string_t(U("firstName"))] = ModelBase::toJson(m_FirstName); } + if(m_LastNameIsSet) - { + { + val[utility::conversions::to_string_t(U("lastName"))] = ModelBase::toJson(m_LastName); } + if(m_EmailIsSet) - { + { + val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email); } + if(m_PasswordIsSet) - { + { + val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password); } + if(m_PhoneIsSet) - { + { + val[utility::conversions::to_string_t(U("phone"))] = ModelBase::toJson(m_Phone); } + if(m_UserStatusIsSet) - { + { + val[utility::conversions::to_string_t(U("userStatus"))] = ModelBase::toJson(m_UserStatus); } + return val; } @@ -102,6 +116,7 @@ bool User::fromJson(const web::json::value& val) int64_t refVal_setId; ok &= ModelBase::fromJson(fieldValue, refVal_setId); setId(refVal_setId); + } } if(val.has_field(utility::conversions::to_string_t(U("username")))) @@ -112,6 +127,7 @@ bool User::fromJson(const web::json::value& val) utility::string_t refVal_setUsername; ok &= ModelBase::fromJson(fieldValue, refVal_setUsername); setUsername(refVal_setUsername); + } } if(val.has_field(utility::conversions::to_string_t(U("firstName")))) @@ -122,6 +138,7 @@ bool User::fromJson(const web::json::value& val) utility::string_t refVal_setFirstName; ok &= ModelBase::fromJson(fieldValue, refVal_setFirstName); setFirstName(refVal_setFirstName); + } } if(val.has_field(utility::conversions::to_string_t(U("lastName")))) @@ -132,6 +149,7 @@ bool User::fromJson(const web::json::value& val) utility::string_t refVal_setLastName; ok &= ModelBase::fromJson(fieldValue, refVal_setLastName); setLastName(refVal_setLastName); + } } if(val.has_field(utility::conversions::to_string_t(U("email")))) @@ -142,6 +160,7 @@ bool User::fromJson(const web::json::value& val) utility::string_t refVal_setEmail; ok &= ModelBase::fromJson(fieldValue, refVal_setEmail); setEmail(refVal_setEmail); + } } if(val.has_field(utility::conversions::to_string_t(U("password")))) @@ -152,6 +171,7 @@ bool User::fromJson(const web::json::value& val) utility::string_t refVal_setPassword; ok &= ModelBase::fromJson(fieldValue, refVal_setPassword); setPassword(refVal_setPassword); + } } if(val.has_field(utility::conversions::to_string_t(U("phone")))) @@ -162,6 +182,7 @@ bool User::fromJson(const web::json::value& val) utility::string_t refVal_setPhone; ok &= ModelBase::fromJson(fieldValue, refVal_setPhone); setPhone(refVal_setPhone); + } } if(val.has_field(utility::conversions::to_string_t(U("userStatus")))) @@ -172,6 +193,7 @@ bool User::fromJson(const web::json::value& val) int32_t refVal_setUserStatus; ok &= ModelBase::fromJson(fieldValue, refVal_setUserStatus); setUserStatus(refVal_setUserStatus); + } } return ok; @@ -187,34 +209,42 @@ void User::toMultipart(std::shared_ptr multipart, const utili if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } if(m_UsernameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("username")), m_Username)); + } if(m_FirstNameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("firstName")), m_FirstName)); + } if(m_LastNameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lastName")), m_LastName)); + } if(m_EmailIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email)); + } if(m_PasswordIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password)); + } if(m_PhoneIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("phone")), m_Phone)); + } if(m_UserStatusIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("userStatus")), m_UserStatus)); + } } @@ -232,52 +262,63 @@ bool User::fromMultiPart(std::shared_ptr multipart, const uti int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); + } if(multipart->hasContent(utility::conversions::to_string_t(U("username")))) { utility::string_t refVal_setUsername; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_setUsername ); setUsername(refVal_setUsername); + } if(multipart->hasContent(utility::conversions::to_string_t(U("firstName")))) { utility::string_t refVal_setFirstName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_setFirstName ); setFirstName(refVal_setFirstName); + } if(multipart->hasContent(utility::conversions::to_string_t(U("lastName")))) { utility::string_t refVal_setLastName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_setLastName ); setLastName(refVal_setLastName); + } if(multipart->hasContent(utility::conversions::to_string_t(U("email")))) { utility::string_t refVal_setEmail; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail ); setEmail(refVal_setEmail); + } if(multipart->hasContent(utility::conversions::to_string_t(U("password")))) { utility::string_t refVal_setPassword; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword ); setPassword(refVal_setPassword); + } if(multipart->hasContent(utility::conversions::to_string_t(U("phone")))) { utility::string_t refVal_setPhone; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_setPhone ); setPhone(refVal_setPhone); + } if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus")))) { int32_t refVal_setUserStatus; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_setUserStatus ); setUserStatus(refVal_setUserStatus); + } return ok; } + + + int64_t User::getId() const { return m_Id; @@ -298,11 +339,13 @@ void User::unsetId() { m_IdIsSet = false; } + utility::string_t User::getUsername() const { return m_Username; } + void User::setUsername(const utility::string_t& value) { m_Username = value; @@ -318,11 +361,13 @@ void User::unsetUsername() { m_UsernameIsSet = false; } + utility::string_t User::getFirstName() const { return m_FirstName; } + void User::setFirstName(const utility::string_t& value) { m_FirstName = value; @@ -338,11 +383,13 @@ void User::unsetFirstName() { m_FirstNameIsSet = false; } + utility::string_t User::getLastName() const { return m_LastName; } + void User::setLastName(const utility::string_t& value) { m_LastName = value; @@ -358,11 +405,13 @@ void User::unsetLastName() { m_LastNameIsSet = false; } + utility::string_t User::getEmail() const { return m_Email; } + void User::setEmail(const utility::string_t& value) { m_Email = value; @@ -378,11 +427,13 @@ void User::unsetEmail() { m_EmailIsSet = false; } + utility::string_t User::getPassword() const { return m_Password; } + void User::setPassword(const utility::string_t& value) { m_Password = value; @@ -398,11 +449,13 @@ void User::unsetPassword() { m_PasswordIsSet = false; } + utility::string_t User::getPhone() const { return m_Phone; } + void User::setPhone(const utility::string_t& value) { m_Phone = value; @@ -418,6 +471,7 @@ void User::unsetPhone() { m_PhoneIsSet = false; } + int32_t User::getUserStatus() const { return m_UserStatus; @@ -438,6 +492,7 @@ void User::unsetUserStatus() { m_UserStatusIsSet = false; } + } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp index c13bc2ecb854..6e8ec9282ed2 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp @@ -19,7 +19,6 @@ namespace client { namespace model { - Vaccine::Vaccine() { m_dateIsSet = false; @@ -38,17 +37,20 @@ void Vaccine::validate() web::json::value Vaccine::toJson() const { - web::json::value val = web::json::value::object(); if(m_dateIsSet) - { + { + val[utility::conversions::to_string_t(U("date"))] = ModelBase::toJson(m_date); } + if(m_BoosterRequiredIsSet) - { + { + val[utility::conversions::to_string_t(U("boosterRequired"))] = ModelBase::toJson(m_BoosterRequired); } + return val; } @@ -65,6 +67,7 @@ bool Vaccine::fromJson(const web::json::value& val) std::shared_ptr refVal_setDate; ok &= ModelBase::fromJson(fieldValue, refVal_setDate); setDate(refVal_setDate); + } } if(val.has_field(utility::conversions::to_string_t(U("boosterRequired")))) @@ -75,6 +78,7 @@ bool Vaccine::fromJson(const web::json::value& val) bool refVal_setBoosterRequired; ok &= ModelBase::fromJson(fieldValue, refVal_setBoosterRequired); setBoosterRequired(refVal_setBoosterRequired); + } } return ok; @@ -90,10 +94,12 @@ void Vaccine::toMultipart(std::shared_ptr multipart, const ut if(m_dateIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("date")), m_date)); + } if(m_BoosterRequiredIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boosterRequired")), m_BoosterRequired)); + } } @@ -111,21 +117,27 @@ bool Vaccine::fromMultiPart(std::shared_ptr multipart, const std::shared_ptr refVal_setDate; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("date"))), refVal_setDate ); setDate(refVal_setDate); + } if(multipart->hasContent(utility::conversions::to_string_t(U("boosterRequired")))) { bool refVal_setBoosterRequired; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boosterRequired"))), refVal_setBoosterRequired ); setBoosterRequired(refVal_setBoosterRequired); + } return ok; } + + + std::shared_ptr Vaccine::getDate() const { return m_date; } + void Vaccine::setDate(const std::shared_ptr& value) { m_date = value; @@ -141,6 +153,7 @@ void Vaccine::unsetdate() { m_dateIsSet = false; } + bool Vaccine::isBoosterRequired() const { return m_BoosterRequired; @@ -161,6 +174,7 @@ void Vaccine::unsetBoosterRequired() { m_BoosterRequiredIsSet = false; } + } } } From 71ccc88037216d973b0df12d4b6c618ae00b355b Mon Sep 17 00:00:00 2001 From: Jorge Fernandez Date: Wed, 4 Dec 2024 15:41:37 +0100 Subject: [PATCH 28/40] [Kotlin] fix #20231, OkHttp client can handle a field with a list of files (#20232) * feat(issue-20231): Kotlin okhttp client handles correctly fields that are optional with multiple files. * docs(issue-20231): add docstrings * feat(issue-20231): Remove unnecessary test spec --- .../infrastructure/ApiClient.kt.mustache | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- .../client/infrastructure/ApiClient.kt | 69 +++++++++++++++---- 22 files changed, 1188 insertions(+), 330 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 17cb97938a3e..2b8dcc1c5b6d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -113,6 +113,48 @@ import com.squareup.moshi.adapter return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -124,21 +166,18 @@ import com.squareup.moshi.adapter // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0d01897277b7..158ee6350bd4 100644 --- a/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index da34b2d7dbc1..42330f0a049e 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index ed25f9ba5714..e72665e55484 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a5b241d61f76..502a01ba2b9a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -86,6 +86,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -97,21 +139,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 231f7095a726..e4c296b20e9f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -87,6 +87,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -98,21 +140,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f4e7fe47c2a3..b1cf2c6828c2 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f4e7fe47c2a3..b1cf2c6828c2 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f4e7fe47c2a3..b1cf2c6828c2 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f95614d6cce9..92580a974dd7 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4377c3474386..87f80e81ab0f 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f4e7fe47c2a3..b1cf2c6828c2 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f4e7fe47c2a3..b1cf2c6828c2 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0b86ad198477..3ec87d33987a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 05962e48ff39..238f6dcca900 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,6 +85,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -96,21 +138,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f4e7fe47c2a3..b1cf2c6828c2 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -84,6 +84,48 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } + /** + * Adds a File to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param file The file that will be added as the field value + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") + val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + file.asRequestBody(fileMediaType) + ) + } + + /** + * Adds any type to a MultipartBody.Builder + * Defined a helper in the requestBody method to not duplicate code + * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. + * + * @param name The field name to add in the request + * @param headers The headers that are in the PartConfig + * @param obj The field name to add in the request + * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on + * @see requestBody + */ + protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { + if (obj == null) return + val partHeaders = headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(obj).toRequestBody(null) + ) + } + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -95,21 +137,18 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - if (part.body is File) { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - part.body.asRequestBody(fileMediaType) - ) - } else { - val partHeaders = part.headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(part.body).toRequestBody(null) - ) + when (part.body) { + is File -> addPartToMultiPart(name, part.headers, part.body) + is List<*> -> { + part.body.forEach { + if (it is File) { + addPartToMultiPart(name, part.headers, it) + } else { + addPartToMultiPart(name, part.headers, it) + } + } + } + else -> addPartToMultiPart(name, part.headers, part.body) } } }.build() From 8a07557865b1b20d6fbe393d63514d968a534e45 Mon Sep 17 00:00:00 2001 From: Thibaud Sowa Date: Wed, 4 Dec 2024 21:52:08 +0100 Subject: [PATCH 29/40] fix(typescript-angular): fix new angular dependency cli option usage (#20247) Co-authored-by: Thibaud SOWA --- ...ar-v19-with-angular-dependency-params.yaml | 12 + ...-root.yaml => typescript-angular-v19.yaml} | 3 +- docs/generators/typescript-angular.md | 2 +- .../TypeScriptAngularClientCodegen.java | 26 +- ...ypeScriptAngularClientOptionsProvider.java | 4 +- .../TypeScriptAngularClientCodegenTest.java | 46 ++ .../builds/default/.gitignore | 0 .../builds/default/.openapi-generator-ignore | 0 .../builds/default/.openapi-generator/FILES | 3 + .../builds/default/.openapi-generator/VERSION | 0 .../builds/default/README.md | 236 ++++++ .../builds/default/api.module.ts | 0 .../builds/default/api/api.ts | 0 .../builds/default/api/pet.service.ts | 0 .../builds/default/api/store.service.ts | 0 .../builds/default/api/user.service.ts | 0 .../builds/default/configuration.ts | 0 .../builds/default/encoder.ts | 0 .../builds/default/git_push.sh | 0 .../builds/default/index.ts | 0 .../builds/default/model/apiResponse.ts | 0 .../builds/default/model/category.ts | 0 .../builds/default/model/models.ts | 0 .../builds/default/model/order.ts | 0 .../builds/default/model/pet.ts | 0 .../builds/default/model/tag.ts | 0 .../builds/default/model/user.ts | 0 .../builds/default/ng-package.json | 6 + .../builds/default/package.json | 33 + .../builds/default/param.ts | 0 .../builds/default/tsconfig.json | 27 + .../builds/default/variables.ts | 0 .../.gitignore | 0 .../angular.json | 0 .../builds/default/.gitignore | 4 + .../builds/default/.openapi-generator-ignore | 23 + .../builds/default/.openapi-generator/FILES | 23 + .../builds/default/.openapi-generator/VERSION | 1 + .../builds/default/README.md | 20 +- .../builds/default/api.module.ts | 30 + .../builds/default/api/api.ts | 7 + .../builds/default/api/pet.service.ts | 781 ++++++++++++++++++ .../builds/default/api/store.service.ts | 367 ++++++++ .../builds/default/api/user.service.ts | 706 ++++++++++++++++ .../builds/default/configuration.ts | 186 +++++ .../builds/default/encoder.ts | 20 + .../builds/default/git_push.sh | 57 ++ .../builds/default/index.ts | 6 + .../builds/default/model/apiResponse.ts | 20 + .../builds/default/model/category.ts | 19 + .../builds/default/model/models.ts | 6 + .../builds/default/model/order.ts | 35 + .../builds/default/model/pet.ts | 38 + .../builds/default/model/tag.ts | 19 + .../builds/default/model/user.ts | 28 + .../builds/default/ng-package.json | 6 + .../builds/default/package.json | 33 + .../builds/default/param.ts | 69 ++ .../builds/default/tsconfig.json | 27 + .../builds/default/variables.ts | 9 + .../package-lock.json | 0 .../package.json | 0 .../src/app/app.component.css | 0 .../src/app/app.component.html | 0 .../src/app/app.component.spec.ts | 0 .../src/app/app.component.ts | 0 .../src/app/app.config.ts | 0 .../src/app/app.routes.ts | 0 .../src/index.html | 0 .../src/main.ts | 0 .../src/styles.css | 0 .../tsconfig.app.json | 0 .../tsconfig.json | 0 .../tsconfig.spec.json | 0 74 files changed, 2911 insertions(+), 27 deletions(-) create mode 100644 bin/configs/typescript-angular-v19-with-angular-dependency-params.yaml rename bin/configs/{typescript-angular-v19-provided-in-root.yaml => typescript-angular-v19.yaml} (69%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/.gitignore (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/.openapi-generator-ignore (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/.openapi-generator/FILES (86%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/.openapi-generator/VERSION (100%) create mode 100644 samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/README.md rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/api.module.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/api/api.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/api/pet.service.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/api/store.service.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/api/user.service.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/configuration.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/encoder.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/git_push.sh (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/index.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/apiResponse.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/category.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/models.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/order.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/pet.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/tag.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/model/user.ts (100%) create mode 100644 samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/ng-package.json create mode 100644 samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/package.json rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/param.ts (100%) create mode 100644 samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19-with-angular-dependency-params}/builds/default/variables.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/.gitignore (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/angular.json (100%) create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/VERSION rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/builds/default/README.md (92%) create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/index.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/ng-package.json create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/package.json create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/param.ts create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v19/builds/default/variables.ts rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/package-lock.json (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/package.json (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/app/app.component.css (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/app/app.component.html (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/app/app.component.spec.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/app/app.component.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/app/app.config.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/app/app.routes.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/index.html (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/main.ts (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/src/styles.css (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/tsconfig.app.json (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/tsconfig.json (100%) rename samples/client/petstore/{typescript-angular-v19-provided-in-root => typescript-angular-v19}/tsconfig.spec.json (100%) diff --git a/bin/configs/typescript-angular-v19-with-angular-dependency-params.yaml b/bin/configs/typescript-angular-v19-with-angular-dependency-params.yaml new file mode 100644 index 000000000000..539f7f29e3a6 --- /dev/null +++ b/bin/configs/typescript-angular-v19-with-angular-dependency-params.yaml @@ -0,0 +1,12 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 19.0.1 + npmName: sample-angular-19-0-0-with-angular-dependency-params + supportsES6: true + tsVersion: 5.6.3 + zonejsVersion: 0.15.0 + ngPackagrVersion: 19.0.1 + rxjsVersion: 6.5.3 diff --git a/bin/configs/typescript-angular-v19-provided-in-root.yaml b/bin/configs/typescript-angular-v19.yaml similarity index 69% rename from bin/configs/typescript-angular-v19-provided-in-root.yaml rename to bin/configs/typescript-angular-v19.yaml index 17025ad1df9a..c20fe69ee5b9 100644 --- a/bin/configs/typescript-angular-v19-provided-in-root.yaml +++ b/bin/configs/typescript-angular-v19.yaml @@ -1,7 +1,8 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default +outputDir: samples/client/petstore/typescript-angular-v19/builds/default inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 19.0.0 + npmName: sample-angular-19-0-0 supportsES6: true diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 8e3e41c6f9df..59a2f4dd9488 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| -|zoneJsVersion|The version of zone.js compatible with Angular (see ngVersion option).| |null| +|zonejsVersion|The version of zone.js compatible with Angular (see ngVersion option).| |null| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index af8865e78e0a..b701f304ac23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -81,7 +81,7 @@ public static enum PROVIDED_IN_LEVEL {none, root, any, platform} public static final String TS_VERSION = "tsVersion"; public static final String RXJS_VERSION = "rxjsVersion"; public static final String NGPACKAGR_VERSION = "ngPackagrVersion"; - public static final String ZONEJS_VERSION = "zoneJsVersion"; + public static final String ZONEJS_VERSION = "zonejsVersion"; protected String ngVersion = "19.0.0"; @Getter @Setter @@ -321,21 +321,21 @@ private void addNpmPackageGeneration(SemVer ngVersion) { .map(Map.Entry::getValue) .orElseThrow(() -> new IllegalArgumentException("Invalid ngVersion. Only Angular v9+ is supported.")); - additionalProperties.put(TS_VERSION, additionalProperties.containsKey(TS_VERSION) - ? additionalProperties.containsKey(TS_VERSION) - : angularDependencies.getTsVersion()); + if (!additionalProperties.containsKey(TS_VERSION)) { + additionalProperties.put(TS_VERSION, angularDependencies.getTsVersion()); + } - additionalProperties.put(RXJS_VERSION, additionalProperties.containsKey(RXJS_VERSION) - ? additionalProperties.containsKey(RXJS_VERSION) - : angularDependencies.getRxjsVersion()); + if (!additionalProperties.containsKey(RXJS_VERSION)) { + additionalProperties.put(RXJS_VERSION, angularDependencies.getRxjsVersion()); + } - additionalProperties.put(NGPACKAGR_VERSION, additionalProperties.containsKey(NGPACKAGR_VERSION) - ? additionalProperties.containsKey(NGPACKAGR_VERSION) - : angularDependencies.getNgPackagrVersion()); + if (!additionalProperties.containsKey(NGPACKAGR_VERSION)) { + additionalProperties.put(NGPACKAGR_VERSION, angularDependencies.getNgPackagrVersion()); + } - additionalProperties.put("zonejsVersion", additionalProperties.containsKey(ZONEJS_VERSION) - ? additionalProperties.containsKey(ZONEJS_VERSION) - : angularDependencies.getZonejsVersion()); + if (!additionalProperties.containsKey(ZONEJS_VERSION)) { + additionalProperties.put(ZONEJS_VERSION, angularDependencies.getZonejsVersion()); + } if (angularDependencies.getTsickleVersion() != null) { additionalProperties.put("tsickleVersion", angularDependencies.getTsickleVersion()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 3d3a8dc34a01..334cb15200ab 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -25,7 +25,7 @@ public class TypeScriptAngularClientOptionsProvider implements TypeScriptSharedClientOptionsProvider { public static final String STRING_ENUMS_VALUE = "false"; private static final String NPM_REPOSITORY = "https://registry.npmjs.org"; - public static final String NG_VERSION = "12"; + public static final String NG_VERSION = "19"; public static final String FILE_NAMING_VALUE = "camelCase"; public static final String API_MODULE_PREFIX = ""; public static final String CONFIGURATION_PREFIX = ""; @@ -37,7 +37,7 @@ public class TypeScriptAngularClientOptionsProvider implements TypeScriptSharedC public static final String MODEL_FILE_SUFFIX = ""; public static final String TS_VERSION = ""; public static final String RXJS_VERSION = ""; - public static final String NGPACKAGR_VERSION = " "; + public static final String NGPACKAGR_VERSION = ""; public static final String ZONEJS_VERSION = ""; @Override diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index dca939d13542..9d07488018b0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -21,6 +21,8 @@ import java.util.HashMap; import java.util.Map; +import static org.assertj.core.api.Assertions.assertThat; + @Test(groups = {TypeScriptGroups.TYPESCRIPT, TypeScriptGroups.TYPESCRIPT_ANGULAR}) public class TypeScriptAngularClientCodegenTest { @@ -344,4 +346,48 @@ public void testModelNameMappings() throws Exception { "files?: Array;" // ensure it's an array of SystemFile (not Any) ); } + + @Test + public void testAngularDependenciesFromCliOptions() { + // GIVEN + OpenAPI openAPI = TestUtils.createOpenAPI(); + + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); + codegen.additionalProperties().put("tsVersion", "12"); + codegen.additionalProperties().put("rxjsVersion", "23"); + codegen.additionalProperties().put("ngPackagrVersion", "34"); + codegen.additionalProperties().put("zonejsVersion", "45"); + + // WHEN + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + + // THEN + assertThat(codegen.additionalProperties()).containsEntry("tsVersion", "12"); + assertThat(codegen.additionalProperties()).containsEntry("rxjsVersion", "23"); + assertThat(codegen.additionalProperties()).containsEntry("ngPackagrVersion", "34"); + assertThat(codegen.additionalProperties()).containsEntry("zonejsVersion", "45"); + } + + @Test + public void testAngularDependenciesFromConfigFile() { + // GIVEN + OpenAPI openAPI = TestUtils.createOpenAPI(); + + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); + // We fix ngVersion to do not update this test on every new angular release. + codegen.additionalProperties().put("ngVersion", "19.0.0"); + + // WHEN + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + + // THEN + assertThat(codegen.additionalProperties()).containsEntry("tsVersion", ">=5.5.0 <5.7.0"); + assertThat(codegen.additionalProperties()).containsEntry("rxjsVersion", "7.4.0"); + assertThat(codegen.additionalProperties()).containsEntry("ngPackagrVersion", "19.0.0"); + assertThat(codegen.additionalProperties()).containsEntry("zonejsVersion", "0.15.0"); + } } diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.gitignore similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.gitignore rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.gitignore diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator-ignore rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator-ignore diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator/FILES similarity index 86% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator/FILES index 6e213a61aa6e..572424259e50 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator/FILES @@ -16,5 +16,8 @@ model/order.ts model/pet.ts model/tag.ts model/user.ts +ng-package.json +package.json param.ts +tsconfig.json variables.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/.openapi-generator/VERSION rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/.openapi-generator/VERSION diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/README.md b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/README.md new file mode 100644 index 000000000000..67f609707e30 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/README.md @@ -0,0 +1,236 @@ +# sample-angular-19-0-0-with-angular-dependency-params@1.0.0 + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +The version of the OpenAPI document: 1.0.0 + +## Building + +To install the required dependencies and to build the typescript sources run: + +```console +npm install +npm run build +``` + +## Publishing + +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) + +## Consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +```console +npm install sample-angular-19-0-0-with-angular-dependency-params@1.0.0 --save +``` + +_without publishing (not recommended):_ + +```console +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: + +```console +npm link +``` + +In your project: + +```console +npm link sample-angular-19-0-0-with-angular-dependency-params +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue for a solution / workaround. +Published packages are not effected by this issue. + +### General usage + +In your Angular project: + +```typescript +// without configuring providers +import { ApiModule } from 'sample-angular-19-0-0-with-angular-dependency-params'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +```typescript +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from 'sample-angular-19-0-0-with-angular-dependency-params'; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +```typescript +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from 'sample-angular-19-0-0-with-angular-dependency-params'; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +```typescript +import { DefaultApi } from 'sample-angular-19-0-0-with-angular-dependency-params'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +### Using multiple OpenAPI files / APIs / ApiModules + +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: + +```typescript +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + +### Set service base path + +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +```typescript +import { BASE_PATH } from 'sample-angular-19-0-0-with-angular-dependency-params'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` + +or + +```typescript +import { BASE_PATH } from 'sample-angular-19-0-0-with-angular-dependency-params'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +### Using @angular/cli + +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +```typescript +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: + +```typescript +import { BASE_PATH } from 'sample-angular-19-0-0-with-angular-dependency-params'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: + +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api.module.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api.module.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api.module.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/api.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/api.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/api.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/pet.service.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/pet.service.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/pet.service.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/user.service.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/user.service.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/user.service.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/encoder.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/encoder.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/encoder.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/git_push.sh similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/git_push.sh diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/index.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/index.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/index.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/apiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/apiResponse.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/apiResponse.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/category.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/category.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/category.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/models.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/models.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/models.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/order.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/order.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/pet.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/pet.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/tag.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/tag.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/tag.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/user.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/user.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/user.ts diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/ng-package.json b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/ng-package.json new file mode 100644 index 000000000000..3b17900dc9c3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/package.json b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/package.json new file mode 100644 index 000000000000..958b69fd631f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/package.json @@ -0,0 +1,33 @@ +{ + "name": "sample-angular-19-0-0-with-angular-dependency-params", + "version": "1.0.0", + "description": "OpenAPI client for sample-angular-19-0-0-with-angular-dependency-params", + "author": "OpenAPI-Generator Contributors", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^19.0.1", + "rxjs": "^6.5.3" + }, + "devDependencies": { + "@angular/common": "^19.0.1", + "@angular/compiler": "^19.0.1", + "@angular/compiler-cli": "^19.0.1", + "@angular/core": "^19.0.1", + "@angular/platform-browser": "^19.0.1", + "ng-packagr": "^19.0.1", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.5.3", + "typescript": "5.6.3", + "zone.js": "^0.15.0" + }} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/param.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/param.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/param.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/param.ts diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json new file mode 100644 index 000000000000..85f130ae01ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "target": "es6", + "module": "es6", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/variables.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/variables.ts rename to samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/variables.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/.gitignore b/samples/client/petstore/typescript-angular-v19/.gitignore similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/.gitignore rename to samples/client/petstore/typescript-angular-v19/.gitignore diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/angular.json b/samples/client/petstore/typescript-angular-v19/angular.json similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/angular.json rename to samples/client/petstore/typescript-angular-v19/angular.json diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v19/builds/default/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..572424259e50 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +ng-package.json +package.json +param.ts +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/VERSION new file mode 100644 index 000000000000..884119126398 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v19/builds/default/README.md similarity index 92% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md rename to samples/client/petstore/typescript-angular-v19/builds/default/README.md index 6653fc45df74..5a836f509281 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v19/builds/default/README.md @@ -1,4 +1,4 @@ -# @ +# sample-angular-19-0-0@1.0.0 This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -24,7 +24,7 @@ Navigate to the folder of your consuming project and run one of next commands. _published:_ ```console -npm install @ --save +npm install sample-angular-19-0-0@1.0.0 --save ``` _without publishing (not recommended):_ @@ -46,7 +46,7 @@ npm link In your project: ```console -npm link +npm link sample-angular-19-0-0 ``` __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. @@ -59,7 +59,7 @@ In your Angular project: ```typescript // without configuring providers -import { ApiModule } from ''; +import { ApiModule } from 'sample-angular-19-0-0'; import { HttpClientModule } from '@angular/common/http'; @NgModule({ @@ -78,7 +78,7 @@ export class AppModule {} ```typescript // configuring providers -import { ApiModule, Configuration, ConfigurationParameters } from ''; +import { ApiModule, Configuration, ConfigurationParameters } from 'sample-angular-19-0-0'; export function apiConfigFactory (): Configuration { const params: ConfigurationParameters = { @@ -98,7 +98,7 @@ export class AppModule {} ```typescript // configuring providers with an authentication service that manages your access tokens -import { ApiModule, Configuration } from ''; +import { ApiModule, Configuration } from 'sample-angular-19-0-0'; @NgModule({ imports: [ ApiModule ], @@ -122,7 +122,7 @@ export class AppModule {} ``` ```typescript -import { DefaultApi } from ''; +import { DefaultApi } from 'sample-angular-19-0-0'; export class AppComponent { constructor(private apiGateway: DefaultApi) { } @@ -162,7 +162,7 @@ export class AppModule { If different than the generated base path, during app bootstrap, you can provide the base path to your service. ```typescript -import { BASE_PATH } from ''; +import { BASE_PATH } from 'sample-angular-19-0-0'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, @@ -172,7 +172,7 @@ bootstrap(AppComponent, [ or ```typescript -import { BASE_PATH } from ''; +import { BASE_PATH } from 'sample-angular-19-0-0'; @NgModule({ imports: [], @@ -197,7 +197,7 @@ export const environment = { In the src/app/app.module.ts: ```typescript -import { BASE_PATH } from ''; +import { BASE_PATH } from 'sample-angular-19-0-0'; import { environment } from '../environments/environment'; @NgModule({ diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api.module.ts new file mode 100644 index 000000000000..58d341fbd2e5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts new file mode 100644 index 000000000000..e4c401a2a64f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts @@ -0,0 +1,781 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiResponse } from '../model/apiResponse'; +// @ts-ignore +import { Pet } from '../model/pet'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pet, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + [...status].join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/findByStatus`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + [...tags].join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/findByTags`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pet, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts new file mode 100644 index 000000000000..b3ab6eb55b04 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts @@ -0,0 +1,367 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { Order } from '../model/order'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/inventory`; + return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: order, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts new file mode 100644 index 000000000000..316ece2e354d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts @@ -0,0 +1,706 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { User } from '../model/user'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUser(user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithArrayInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/createWithArray`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithListInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/createWithList`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/login`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/logout`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts new file mode 100644 index 000000000000..4ad26d0bdcb9 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts @@ -0,0 +1,186 @@ +import { HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.encodeParam) { + this.encodeParam = configurationParameters.encodeParam; + } + else { + this.encodeParam = param => this.defaultEncodeParam(param); + } + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v19/builds/default/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/index.ts b/samples/client/petstore/typescript-angular-v19/builds/default/index.ts new file mode 100644 index 000000000000..104dd3d21e35 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/index.ts @@ -0,0 +1,6 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './param'; diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/apiResponse.ts new file mode 100644 index 000000000000..113ad7e11782 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/apiResponse.ts @@ -0,0 +1,20 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/category.ts new file mode 100644 index 000000000000..c070dd83996c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/category.ts @@ -0,0 +1,19 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts new file mode 100644 index 000000000000..5d9a0e440787 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts @@ -0,0 +1,35 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts new file mode 100644 index 000000000000..b6971b3e5143 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts @@ -0,0 +1,38 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + * @deprecated + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/tag.ts new file mode 100644 index 000000000000..92a76d13dbb9 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/tag.ts @@ -0,0 +1,19 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/user.ts new file mode 100644 index 000000000000..ac591c5d45ad --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/user.ts @@ -0,0 +1,28 @@ +/** + * OpenAPI Petstore + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/ng-package.json b/samples/client/petstore/typescript-angular-v19/builds/default/ng-package.json new file mode 100644 index 000000000000..3b17900dc9c3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/package.json b/samples/client/petstore/typescript-angular-v19/builds/default/package.json new file mode 100644 index 000000000000..24645d6e839c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/package.json @@ -0,0 +1,33 @@ +{ + "name": "sample-angular-19-0-0", + "version": "1.0.0", + "description": "OpenAPI client for sample-angular-19-0-0", + "author": "OpenAPI-Generator Contributors", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^19.0.0", + "rxjs": "^7.4.0" + }, + "devDependencies": { + "@angular/common": "^19.0.0", + "@angular/compiler": "^19.0.0", + "@angular/compiler-cli": "^19.0.0", + "@angular/core": "^19.0.0", + "@angular/platform-browser": "^19.0.0", + "ng-packagr": "^19.0.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^7.4.0", + "typescript": ">=5.5.0 <5.7.0", + "zone.js": "^0.15.0" + }} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/param.ts b/samples/client/petstore/typescript-angular-v19/builds/default/param.ts new file mode 100644 index 000000000000..78a2d20a6433 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json b/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json new file mode 100644 index 000000000000..85f130ae01ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "target": "es6", + "module": "es6", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v19/builds/default/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v19/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/package-lock.json b/samples/client/petstore/typescript-angular-v19/package-lock.json similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/package-lock.json rename to samples/client/petstore/typescript-angular-v19/package-lock.json diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/package.json b/samples/client/petstore/typescript-angular-v19/package.json similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/package.json rename to samples/client/petstore/typescript-angular-v19/package.json diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.css b/samples/client/petstore/typescript-angular-v19/src/app/app.component.css similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.css rename to samples/client/petstore/typescript-angular-v19/src/app/app.component.css diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.html b/samples/client/petstore/typescript-angular-v19/src/app/app.component.html similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.html rename to samples/client/petstore/typescript-angular-v19/src/app/app.component.html diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.spec.ts b/samples/client/petstore/typescript-angular-v19/src/app/app.component.spec.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.spec.ts rename to samples/client/petstore/typescript-angular-v19/src/app/app.component.spec.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.ts b/samples/client/petstore/typescript-angular-v19/src/app/app.component.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.component.ts rename to samples/client/petstore/typescript-angular-v19/src/app/app.component.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.config.ts b/samples/client/petstore/typescript-angular-v19/src/app/app.config.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.config.ts rename to samples/client/petstore/typescript-angular-v19/src/app/app.config.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.routes.ts b/samples/client/petstore/typescript-angular-v19/src/app/app.routes.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/app/app.routes.ts rename to samples/client/petstore/typescript-angular-v19/src/app/app.routes.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/index.html b/samples/client/petstore/typescript-angular-v19/src/index.html similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/index.html rename to samples/client/petstore/typescript-angular-v19/src/index.html diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/main.ts b/samples/client/petstore/typescript-angular-v19/src/main.ts similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/main.ts rename to samples/client/petstore/typescript-angular-v19/src/main.ts diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/src/styles.css b/samples/client/petstore/typescript-angular-v19/src/styles.css similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/src/styles.css rename to samples/client/petstore/typescript-angular-v19/src/styles.css diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.app.json b/samples/client/petstore/typescript-angular-v19/tsconfig.app.json similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.app.json rename to samples/client/petstore/typescript-angular-v19/tsconfig.app.json diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.json b/samples/client/petstore/typescript-angular-v19/tsconfig.json similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.json rename to samples/client/petstore/typescript-angular-v19/tsconfig.json diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.spec.json b/samples/client/petstore/typescript-angular-v19/tsconfig.spec.json similarity index 100% rename from samples/client/petstore/typescript-angular-v19-provided-in-root/tsconfig.spec.json rename to samples/client/petstore/typescript-angular-v19/tsconfig.spec.json From 05d4aa9f62f6dc9aa5a89ecdc68d17dd4857c29f Mon Sep 17 00:00:00 2001 From: Kirill Romanov Date: Thu, 5 Dec 2024 06:51:10 +0300 Subject: [PATCH 30/40] [kotlin][client] support text/plain in okhttp (#20250) * refactor: simplify application/octet-stream check * feat: support text/plain in kotlin okhttp client * refactor: remove redundant always-false condition content is ByteArray is checked earlier --- .../codegen/languages/KotlinClientCodegen.java | 4 +++- .../jvm-okhttp/infrastructure/ApiClient.kt.mustache | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++---- 23 files changed, 135 insertions(+), 89 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 67f41edc715a..b37294c2a9d3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -962,7 +962,9 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List = mutableMapOf() {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val apiKeyPrefix: MutableMap = mutableMapOf() @@ -209,10 +210,10 @@ import com.squareup.moshi.adapter .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } {{#moshi}} @@ -298,7 +299,8 @@ import com.squareup.moshi.adapter }}{{#kotlinx_serialization}}Serializer.kotlinxSerializationJson.decodeFromString(bodyContent){{/kotlinx_serialization}} } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 158ee6350bd4..b76315bd9e88 100644 --- a/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" public val apiKey: MutableMap = mutableMapOf() public val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 42330f0a049e..1911b1d4788b 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { @@ -242,7 +243,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e72665e55484..44095e73f25d 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { @@ -242,7 +243,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 502a01ba2b9a..70539f9c8521 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -43,6 +43,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -171,10 +172,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { @@ -248,7 +249,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.kotlinxSerializationJson.decodeFromString(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e4c296b20e9f..5a8f81566cf1 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -172,10 +173,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { @@ -245,7 +246,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b1cf2c6828c2..0867fa0c3175 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b1cf2c6828c2..0867fa0c3175 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b1cf2c6828c2..0867fa0c3175 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 92580a974dd7..e59fa0b5a488 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 87f80e81ab0f..ad481e08ba5a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b1cf2c6828c2..0867fa0c3175 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b1cf2c6828c2..0867fa0c3175 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 3ec87d33987a..83cf91d89282 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 238f6dcca900..09a59bf60d78 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -42,6 +42,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -170,10 +171,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.kotlinxSerializationJson.decodeFromString(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b1cf2c6828c2..0867fa0c3175 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -41,6 +41,7 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded" protected const val XmlMediaType: String = "application/xml" protected const val OctetMediaType: String = "application/octet-stream" + protected const val TextMediaType: String = "text/plain" val apiKey: MutableMap = mutableMapOf() val apiKeyPrefix: MutableMap = mutableMapOf() @@ -169,10 +170,10 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - mediaType == OctetMediaType && content is ByteArray -> - content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) + mediaType == TextMediaType && content is String -> + content.toRequestBody(TextMediaType.toMediaTypeOrNull()) // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, text body, byte body and File body.") } @OptIn(ExperimentalStdlibApi::class) @@ -243,7 +244,8 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie Serializer.moshi.adapter().fromJson(bodyContent) } mediaType == OctetMediaType -> body.bytes() as? T - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + mediaType == TextMediaType -> body.string() as? T + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body, text body and byte body.") } } From f406f789781143967d0066065961fcc4904eab56 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 5 Dec 2024 12:07:14 +0800 Subject: [PATCH 31/40] [cpprestsdk] Better code format (#20237) * remove blank lines * fix summary, add line break bwtween vars * update --- .../cpp-rest-sdk-client/model-header.mustache | 70 +++++++++++---- .../cpp-rest-sdk-client/model-source.mustache | 75 +++++++++++----- .../CppRestPetstoreClient/model/ApiResponse.h | 34 ++------ .../CppRestPetstoreClient/model/Category.h | 23 +---- .../CppRestPetstoreClient/model/Order.h | 65 +++----------- .../include/CppRestPetstoreClient/model/Pet.h | 68 +++------------ .../model/SchemaWithSet.h | 21 +---- .../model/SchemaWithSet_vaccinationBook.h | 13 +-- .../include/CppRestPetstoreClient/model/Tag.h | 23 +---- .../CppRestPetstoreClient/model/User.h | 85 ++++--------------- .../CppRestPetstoreClient/model/Vaccine.h | 20 +---- .../client/src/model/ApiResponse.cpp | 16 ---- .../cpp-restsdk/client/src/model/Category.cpp | 12 --- .../src/model/CreateUserOrPet_request.cpp | 2 - .../cpp-restsdk/client/src/model/Order.cpp | 31 ------- .../cpp-restsdk/client/src/model/Pet.cpp | 31 ------- .../client/src/model/SchemaWithSet.cpp | 12 --- .../model/SchemaWithSet_vaccinationBook.cpp | 8 -- .../cpp-restsdk/client/src/model/Tag.cpp | 12 --- .../cpp-restsdk/client/src/model/User.cpp | 36 -------- .../cpp-restsdk/client/src/model/Vaccine.cpp | 12 --- 21 files changed, 177 insertions(+), 492 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index 9536512f0f73..a8d71b425ff4 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -128,9 +128,11 @@ public: {{/isEnum}} {{^isEnum}} +{{#description}} /// /// {{description}} /// +{{/description}} class {{declspec}} {{classname}} : public {{{parent}}}{{^parent}}ModelBase{{/parent}} { @@ -154,16 +156,26 @@ public: /// {{classname}} members {{! ENUM DEFINITIONS }} - {{#vars}}{{^isInherited}}{{#isEnum}} + {{#vars}} + {{^isInherited}} + {{#isEnum}} enum class {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}} { {{#allowableValues}}{{#enumVars}}{{value}}, {{/enumVars}}{{/allowableValues}} }; + {{#description}} /// /// {{description}} /// - {{/isEnum}}{{/isInherited}}{{/vars}}{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}} + {{/description}} + {{/isEnum}} + {{/isInherited}} + {{/vars}} + {{#vars}} + {{^isInherited}} + {{#isEnum}} + {{#isContainer}} {{! ENUM CONVERSIONS }} {{{enumName}}} to{{{enumName}}}(const utility::string_t& value) const; const utility::string_t from{{{enumName}}}(const {{{enumName}}} value) const; @@ -173,41 +185,67 @@ public: {{/isArray}}{{/isContainer}}{{^isContainer}} {{{datatypeWithEnum}}} to{{{datatypeWithEnum}}}(const utility::string_t& value) const; const utility::string_t from{{{datatypeWithEnum}}}(const {{{datatypeWithEnum}}} value) const; - {{/isContainer}}{{/isEnum}}{{/isInherited}}{{/vars}} + {{/isContainer}} + + {{/isEnum}} + {{/isInherited}} + {{/vars}} {{! SETTER AND GETTERS }} - {{#vars}}{{^isInherited}} + {{#vars}} + {{^isInherited}} + {{#description}} /// /// {{description}} /// - {{#isContainer}}{{^isEnum}} + {{/description}} + {{#isContainer}} + {{^isEnum}} {{{dataType}}} {{getter}}() const; - {{/isEnum}}{{/isContainer}}{{^isContainer}}{{^isEnum}} + {{/isEnum}} + {{/isContainer}} + {{^isContainer}} + {{^isEnum}} {{{dataType}}} {{getter}}() const; - {{/isEnum}}{{/isContainer}} - {{#isEnum}}{{^isMap}} + {{/isEnum}} + {{/isContainer}} + {{#isEnum}} + {{^isMap}} {{{datatypeWithEnum}}} {{getter}}() const; - {{/isMap}}{{#isMap}} + {{/isMap}} + {{#isMap}} {{{dataType}}} {{getter}}() const; - {{/isMap}}{{/isEnum}} + {{/isMap}} + {{/isEnum}} bool {{nameInCamelCase}}IsSet() const; void unset{{name}}(); {{#isPrimitiveType}} void {{setter}}({{{dataType}}} value); - {{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{^isEnum}} void {{setter}}(const {{{dataType}}}& value); - {{/isEnum}}{{/isPrimitiveType}}{{#isEnum}} + {{/isEnum}} + {{/isPrimitiveType}} + {{#isEnum}} void {{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value); - {{/isEnum}}{{/isInherited}}{{/vars}} + {{/isEnum}} + {{/isInherited}} + + {{/vars}} protected: {{#vars}} - {{^isInherited}}{{^isEnum}} + {{^isInherited}} + {{^isEnum}} {{{dataType}}} m_{{name}}; - {{/isEnum}}{{#isEnum}} + {{/isEnum}} + {{#isEnum}} {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} m_{{name}}; - {{/isEnum}}bool m_{{name}}IsSet; + {{/isEnum}} + bool m_{{name}}IsSet; {{/isInherited}} + {{/vars}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index 175c0401d247..fcb6637804fa 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -6,7 +6,8 @@ {{#modelNamespaceDeclarations}} namespace {{this}} { {{/modelNamespaceDeclarations}} -{{#oneOf}}{{#-first}} +{{#oneOf}} +{{#-first}} void {{classname}}::validate() { @@ -54,7 +55,8 @@ template bool {{classname}}::fromJson<{{.}}>(const web::json::value& json); template bool {{classname}}::fromMultiPart<{{.}}>(std::shared_ptr multipart, const utility::string_t& namePrefix); {{/oneOf}} -{{/-first}}{{/oneOf}} +{{/-first}} +{{/oneOf}} {{^oneOf}} {{#isEnum}} @@ -218,7 +220,8 @@ web::json::value {{classname}}::toJson() const {{^parent}} web::json::value val = web::json::value::object(); {{/parent}} - {{#vars}}{{^isInherited}} + {{#vars}} + {{^isInherited}} if(m_{{name}}IsSet) { {{#isEnum}}{{#isContainer}}{{#isArray}} @@ -233,7 +236,8 @@ web::json::value {{classname}}::toJson() const val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(m_{{name}}); {{/isEnum}} } - {{/isInherited}}{{/vars}} + {{/isInherited}} + {{/vars}} return val; } @@ -244,7 +248,8 @@ bool {{classname}}::fromJson(const web::json::value& val) {{#parent}} ok &= this->{{{.}}}::fromJson(val); {{/parent}} - {{#vars}}{{^isInherited}} + {{#vars}} + {{^isInherited}} if(val.has_field(utility::conversions::to_string_t(U("{{baseName}}")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("{{baseName}}"))); @@ -263,7 +268,9 @@ bool {{classname}}::fromJson(const web::json::value& val) {{setter}}(to{{{datatypeWithEnum}}}(refVal_{{setter}})); {{/isContainer}}{{/isEnum}} } - }{{/isInherited}}{{/vars}} + } + {{/isInherited}} + {{/vars}} return ok; } @@ -280,13 +287,18 @@ void {{classname}}::toMultipart(std::shared_ptr multipart, co {{^isEnum}} multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}})); {{/isEnum}} - {{#isEnum}}{{#isContainer}}{{#isArray}} + {{#isEnum}} + {{#isContainer}} + {{#isArray}} multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), from{{{enumName}}}(m_{{name}}))); {{/isArray}}{{#isMap}} multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}})); - {{/isMap}}{{/isContainer}}{{^isContainer}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), from{{{datatypeWithEnum}}}(m_{{name}}))); - {{/isContainer}}{{/isEnum}} + {{/isContainer}} + {{/isEnum}} } {{/vars}} } @@ -308,21 +320,31 @@ bool {{classname}}::fromMultiPart(std::shared_ptr multipart, {{^isEnum}} {{setter}}(refVal_{{setter}}); {{/isEnum}} - {{#isEnum}}{{#isContainer}}{{#isArray}} + {{#isEnum}} + {{#isContainer}} + {{#isArray}} {{setter}}(to{{{enumName}}}(refVal_{{setter}})); - {{/isArray}}{{#isMap}} + {{/isArray}} + {{#isMap}} {{setter}}(refVal_{{setter}}); - {{/isMap}}{{/isContainer}}{{^isContainer}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} {{setter}}(to{{{datatypeWithEnum}}}(refVal_{{setter}})); - {{/isContainer}}{{/isEnum}} + {{/isContainer}} + {{/isEnum}} } {{/vars}} return ok; } -{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}} +{{#vars}} +{{^isInherited}} +{{#isEnum}} +{{#isContainer}} {{classname}}::{{{enumName}}} {{classname}}::to{{{enumName}}}(const utility::string_t& value) const -{{/isContainer}}{{^isContainer}} +{{/isContainer}} +{{^isContainer}} {{classname}}::{{{datatypeWithEnum}}} {{classname}}::to{{{datatypeWithEnum}}}(const {{dataType}}& value) const {{/isContainer}} { @@ -348,7 +370,8 @@ const {{dataType}} {{classname}}::from{{{datatypeWithEnum}}}(const {{{datatypeWi } } -{{#isContainer}}{{#isArray}} +{{#isContainer}} +{{#isArray}} {{{dataType}}} {{{classname}}}::from{{{enumName}}}(const {{{datatypeWithEnum}}}& value) const { {{{dataType}}} ret; @@ -366,19 +389,31 @@ const {{dataType}} {{classname}}::from{{{datatypeWithEnum}}}(const {{{datatypeWi } return ret; } -{{/isArray}}{{/isContainer}}{{/isEnum}}{{/isInherited}}{{/vars}} +{{/isArray}} +{{/isContainer}} +{{/isEnum}} +{{/isInherited}} +{{/vars}} -{{#vars}}{{^isInherited}}{{#isContainer}}{{^isEnum}} +{{#vars}} +{{^isInherited}} +{{#isContainer}} +{{^isEnum}} {{{dataType}}} {{classname}}::{{getter}}() const { return m_{{name}}; } -{{/isEnum}}{{/isContainer}}{{^isContainer}}{{^isEnum}} +{{/isEnum}} +{{/isContainer}} +{{^isContainer}} +{{^isEnum}} {{{dataType}}} {{classname}}::{{getter}}() const { return m_{{name}}; } -{{/isEnum}}{{/isContainer}}{{#isEnum}} +{{/isEnum}} +{{/isContainer}} +{{#isEnum}} {{^isMap}}{{#isArray}}{{{baseType}}}<{{/isArray}}{{{classname}}}::{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} {{classname}}::{{getter}}() const { return m_{{name}}; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h index a7b7c86819da..3d00f9bdc40a 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h @@ -55,55 +55,33 @@ class ApiResponse ///////////////////////////////////////////// /// ApiResponse members - - - /// - /// - /// - int32_t getCode() const; - - bool codeIsSet() const; void unsetCode(); void setCode(int32_t value); - - /// - /// - /// - + utility::string_t getType() const; - - bool typeIsSet() const; void unsetType(); - void setType(const utility::string_t& value); - - /// - /// - /// - + utility::string_t getMessage() const; - - bool messageIsSet() const; void unsetMessage(); - void setMessage(const utility::string_t& value); - + protected: - int32_t m_Code; bool m_CodeIsSet; - + utility::string_t m_Type; bool m_TypeIsSet; - + utility::string_t m_Message; bool m_MessageIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h index 0e2cc2d13219..da763f6b2b41 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h @@ -55,40 +55,25 @@ class Category ///////////////////////////////////////////// /// Category members - - - /// - /// - /// - int64_t getId() const; - - bool idIsSet() const; void unsetId(); void setId(int64_t value); - - /// - /// - /// - + utility::string_t getName() const; - - bool nameIsSet() const; void unsetName(); - void setName(const utility::string_t& value); - + protected: - int64_t m_Id; bool m_IdIsSet; - + utility::string_t m_Name; bool m_NameIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h index d3ee6a7de51c..8cc343c35852 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h @@ -56,7 +56,6 @@ class Order ///////////////////////////////////////////// /// Order members - enum class StatusEnum { placed, @@ -67,100 +66,64 @@ class Order /// /// Order Status /// - + StatusEnum toStatusEnum(const utility::string_t& value) const; const utility::string_t fromStatusEnum(const StatusEnum value) const; - - - /// - /// - /// - + int64_t getId() const; - - bool idIsSet() const; void unsetId(); void setId(int64_t value); - - /// - /// - /// - + int64_t getPetId() const; - - bool petIdIsSet() const; void unsetPetId(); void setPetId(int64_t value); - - /// - /// - /// - + int32_t getQuantity() const; - - bool quantityIsSet() const; void unsetQuantity(); void setQuantity(int32_t value); - - /// - /// - /// - + utility::datetime getShipDate() const; - - bool shipDateIsSet() const; void unsetShipDate(); - void setShipDate(const utility::datetime& value); - + /// /// Order Status /// - - StatusEnum getStatus() const; - bool statusIsSet() const; void unsetStatus(); - void setStatus(const StatusEnum value); - - /// - /// - /// - + bool isComplete() const; - - bool completeIsSet() const; void unsetComplete(); void setComplete(bool value); - + protected: - int64_t m_Id; bool m_IdIsSet; - + int64_t m_PetId; bool m_PetIdIsSet; - + int32_t m_Quantity; bool m_QuantityIsSet; - + utility::datetime m_ShipDate; bool m_ShipDateIsSet; - + StatusEnum m_Status; bool m_StatusIsSet; - + bool m_Complete; bool m_CompleteIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h index 16305368b11d..441a839c4d6d 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h @@ -61,7 +61,6 @@ class Pet ///////////////////////////////////////////// /// Pet members - enum class StatusEnum { available, @@ -72,103 +71,64 @@ class Pet /// /// pet status in the store /// - + StatusEnum toStatusEnum(const utility::string_t& value) const; const utility::string_t fromStatusEnum(const StatusEnum value) const; - - - /// - /// - /// - + int64_t getId() const; - - bool idIsSet() const; void unsetId(); void setId(int64_t value); - - /// - /// - /// - + std::shared_ptr getCategory() const; - - bool categoryIsSet() const; void unsetCategory(); - void setCategory(const std::shared_ptr& value); - - /// - /// - /// - + utility::string_t getName() const; - - bool nameIsSet() const; void unsetName(); - void setName(const utility::string_t& value); - - /// - /// - /// - + std::vector getPhotoUrls() const; - - bool photoUrlsIsSet() const; void unsetPhotoUrls(); - void setPhotoUrls(const std::vector& value); - - /// - /// - /// - + std::vector> getTags() const; - - bool tagsIsSet() const; void unsetTags(); - void setTags(const std::vector>& value); - + /// /// pet status in the store /// - - StatusEnum getStatus() const; - bool statusIsSet() const; void unsetStatus(); - void setStatus(const StatusEnum value); - + protected: - int64_t m_Id; bool m_IdIsSet; - + std::shared_ptr m_Category; bool m_CategoryIsSet; - + utility::string_t m_Name; bool m_NameIsSet; - + std::vector m_PhotoUrls; bool m_PhotoUrlsIsSet; - + std::vector> m_Tags; bool m_TagsIsSet; - + StatusEnum m_Status; bool m_StatusIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h index f5d24906d377..ae03e3c5b82e 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h @@ -58,41 +58,28 @@ class SchemaWithSet ///////////////////////////////////////////// /// SchemaWithSet members - - /// /// pedigree and other certificates /// - std::set getCertificates() const; - - bool certificatesIsSet() const; void unsetCertificates(); - void setCertificates(const std::set& value); - - /// - /// - /// - + std::shared_ptr getVaccinationBook() const; - - bool vaccinationBookIsSet() const; void unsetVaccinationBook(); - void setVaccinationBook(const std::shared_ptr& value); - + protected: - std::set m_Certificates; bool m_CertificatesIsSet; - + std::shared_ptr m_VaccinationBook; bool m_VaccinationBookIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h index cb47dc3b963e..d69a038285f0 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h @@ -57,26 +57,17 @@ class SchemaWithSet_vaccinationBook ///////////////////////////////////////////// /// SchemaWithSet_vaccinationBook members - - - /// - /// - /// - std::set> getVaccines() const; - - bool vaccinesIsSet() const; void unsetVaccines(); - void setVaccines(const std::set>& value); - + protected: - std::set> m_Vaccines; bool m_VaccinesIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h index 393e17fd49ab..08436c290f0c 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h @@ -55,40 +55,25 @@ class Tag ///////////////////////////////////////////// /// Tag members - - - /// - /// - /// - int64_t getId() const; - - bool idIsSet() const; void unsetId(); void setId(int64_t value); - - /// - /// - /// - + utility::string_t getName() const; - - bool nameIsSet() const; void unsetName(); - void setName(const utility::string_t& value); - + protected: - int64_t m_Id; bool m_IdIsSet; - + utility::string_t m_Name; bool m_NameIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h index e9e88086af52..c9c9d0aca212 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h @@ -55,129 +55,76 @@ class User ///////////////////////////////////////////// /// User members - - - /// - /// - /// - int64_t getId() const; - - bool idIsSet() const; void unsetId(); void setId(int64_t value); - - /// - /// - /// - + utility::string_t getUsername() const; - - bool usernameIsSet() const; void unsetUsername(); - void setUsername(const utility::string_t& value); - - /// - /// - /// - + utility::string_t getFirstName() const; - - bool firstNameIsSet() const; void unsetFirstName(); - void setFirstName(const utility::string_t& value); - - /// - /// - /// - + utility::string_t getLastName() const; - - bool lastNameIsSet() const; void unsetLastName(); - void setLastName(const utility::string_t& value); - - /// - /// - /// - + utility::string_t getEmail() const; - - bool emailIsSet() const; void unsetEmail(); - void setEmail(const utility::string_t& value); - - /// - /// - /// - + utility::string_t getPassword() const; - - bool passwordIsSet() const; void unsetPassword(); - void setPassword(const utility::string_t& value); - - /// - /// - /// - + utility::string_t getPhone() const; - - bool phoneIsSet() const; void unsetPhone(); - void setPhone(const utility::string_t& value); - + /// /// User Status /// - int32_t getUserStatus() const; - - bool userStatusIsSet() const; void unsetUserStatus(); void setUserStatus(int32_t value); - + protected: - int64_t m_Id; bool m_IdIsSet; - + utility::string_t m_Username; bool m_UsernameIsSet; - + utility::string_t m_FirstName; bool m_FirstNameIsSet; - + utility::string_t m_LastName; bool m_LastNameIsSet; - + utility::string_t m_Email; bool m_EmailIsSet; - + utility::string_t m_Password; bool m_PasswordIsSet; - + utility::string_t m_Phone; bool m_PhoneIsSet; - + int32_t m_UserStatus; bool m_UserStatusIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h index 05db96a4df83..3ecbdd391362 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h @@ -30,9 +30,6 @@ namespace model { -/// -/// -/// class Vaccine : public ModelBase { @@ -55,40 +52,31 @@ class Vaccine ///////////////////////////////////////////// /// Vaccine members - - /// /// vaccination date /// - std::shared_ptr getDate() const; - - bool dateIsSet() const; void unsetdate(); - void setDate(const std::shared_ptr& value); - + /// /// true if a booster is still needed to complete the vaccination /// - bool isBoosterRequired() const; - - bool boosterRequiredIsSet() const; void unsetBoosterRequired(); void setBoosterRequired(bool value); - + protected: - std::shared_ptr m_date; bool m_dateIsSet; - + bool m_BoosterRequired; bool m_BoosterRequiredIsSet; + }; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp index 5f925cc56072..b8ee8d85a769 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/ApiResponse.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - ApiResponse::ApiResponse() { m_Code = 0; @@ -41,25 +40,21 @@ void ApiResponse::validate() web::json::value ApiResponse::toJson() const { web::json::value val = web::json::value::object(); - if(m_CodeIsSet) { val[utility::conversions::to_string_t(U("code"))] = ModelBase::toJson(m_Code); } - if(m_TypeIsSet) { val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type); } - if(m_MessageIsSet) { val[utility::conversions::to_string_t(U("message"))] = ModelBase::toJson(m_Message); } - return val; } @@ -67,7 +62,6 @@ web::json::value ApiResponse::toJson() const bool ApiResponse::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("code")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("code"))); @@ -114,17 +108,14 @@ void ApiResponse::toMultipart(std::shared_ptr multipart, cons if(m_CodeIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code")), m_Code)); - } if(m_TypeIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type)); - } if(m_MessageIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("message")), m_Message)); - } } @@ -142,28 +133,23 @@ bool ApiResponse::fromMultiPart(std::shared_ptr multipart, co int32_t refVal_setCode; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode ); setCode(refVal_setCode); - } if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) { utility::string_t refVal_setType; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType ); setType(refVal_setType); - } if(multipart->hasContent(utility::conversions::to_string_t(U("message")))) { utility::string_t refVal_setMessage; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_setMessage ); setMessage(refVal_setMessage); - } return ok; } - - int32_t ApiResponse::getCode() const { return m_Code; @@ -184,7 +170,6 @@ void ApiResponse::unsetCode() { m_CodeIsSet = false; } - utility::string_t ApiResponse::getType() const { return m_Type; @@ -206,7 +191,6 @@ void ApiResponse::unsetType() { m_TypeIsSet = false; } - utility::string_t ApiResponse::getMessage() const { return m_Message; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp index 461149854a3b..8ff12bb22e7d 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Category.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - Category::Category() { m_Id = 0L; @@ -39,19 +38,16 @@ void Category::validate() web::json::value Category::toJson() const { web::json::value val = web::json::value::object(); - if(m_IdIsSet) { val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } - if(m_NameIsSet) { val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); } - return val; } @@ -59,7 +55,6 @@ web::json::value Category::toJson() const bool Category::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("id")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); @@ -95,12 +90,10 @@ void Category::toMultipart(std::shared_ptr multipart, const u if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); - } if(m_NameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); - } } @@ -118,21 +111,17 @@ bool Category::fromMultiPart(std::shared_ptr multipart, const int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); - } if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) { utility::string_t refVal_setName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); setName(refVal_setName); - } return ok; } - - int64_t Category::getId() const { return m_Id; @@ -153,7 +142,6 @@ void Category::unsetId() { m_IdIsSet = false; } - utility::string_t Category::getName() const { return m_Name; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp index 2fba8a89d486..033775c5c6f7 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - void CreateUserOrPet_request::validate() { // TODO: implement validation @@ -65,7 +64,6 @@ template bool CreateUserOrPet_request::fromMultiPart(std::shared_ptr(const web::json::value& json); template bool CreateUserOrPet_request::fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix); - } } } diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp index dacb34ed96e1..4e9becf6b9d2 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Order.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - Order::Order() { m_Id = 0L; @@ -46,31 +45,26 @@ void Order::validate() web::json::value Order::toJson() const { web::json::value val = web::json::value::object(); - if(m_IdIsSet) { val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } - if(m_PetIdIsSet) { val[utility::conversions::to_string_t(U("petId"))] = ModelBase::toJson(m_PetId); } - if(m_QuantityIsSet) { val[utility::conversions::to_string_t(U("quantity"))] = ModelBase::toJson(m_Quantity); } - if(m_ShipDateIsSet) { val[utility::conversions::to_string_t(U("shipDate"))] = ModelBase::toJson(m_ShipDate); } - if(m_StatusIsSet) { @@ -78,13 +72,11 @@ web::json::value Order::toJson() const val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(refVal); } - if(m_CompleteIsSet) { val[utility::conversions::to_string_t(U("complete"))] = ModelBase::toJson(m_Complete); } - return val; } @@ -92,7 +84,6 @@ web::json::value Order::toJson() const bool Order::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("id")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); @@ -173,33 +164,26 @@ void Order::toMultipart(std::shared_ptr multipart, const util if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); - } if(m_PetIdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("petId")), m_PetId)); - } if(m_QuantityIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("quantity")), m_Quantity)); - } if(m_ShipDateIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("shipDate")), m_ShipDate)); - } if(m_StatusIsSet) { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), fromStatusEnum(m_Status))); - } if(m_CompleteIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("complete")), m_Complete)); - } } @@ -217,48 +201,40 @@ bool Order::fromMultiPart(std::shared_ptr multipart, const ut int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); - } if(multipart->hasContent(utility::conversions::to_string_t(U("petId")))) { int64_t refVal_setPetId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_setPetId ); setPetId(refVal_setPetId); - } if(multipart->hasContent(utility::conversions::to_string_t(U("quantity")))) { int32_t refVal_setQuantity; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_setQuantity ); setQuantity(refVal_setQuantity); - } if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate")))) { utility::datetime refVal_setShipDate; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_setShipDate ); setShipDate(refVal_setShipDate); - } if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) { utility::string_t refVal_setStatus; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); - setStatus(toStatusEnum(refVal_setStatus)); - } if(multipart->hasContent(utility::conversions::to_string_t(U("complete")))) { bool refVal_setComplete; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_setComplete ); setComplete(refVal_setComplete); - } return ok; } - Order::StatusEnum Order::toStatusEnum(const utility::string_t& value) const { @@ -293,8 +269,6 @@ const utility::string_t Order::fromStatusEnum(const StatusEnum value) const } - - int64_t Order::getId() const { return m_Id; @@ -315,7 +289,6 @@ void Order::unsetId() { m_IdIsSet = false; } - int64_t Order::getPetId() const { return m_PetId; @@ -336,7 +309,6 @@ void Order::unsetPetId() { m_PetIdIsSet = false; } - int32_t Order::getQuantity() const { return m_Quantity; @@ -357,7 +329,6 @@ void Order::unsetQuantity() { m_QuantityIsSet = false; } - utility::datetime Order::getShipDate() const { return m_ShipDate; @@ -379,7 +350,6 @@ void Order::unsetShipDate() { m_ShipDateIsSet = false; } - Order::StatusEnum Order::getStatus() const { return m_Status; @@ -401,7 +371,6 @@ void Order::unsetStatus() { m_StatusIsSet = false; } - bool Order::isComplete() const { return m_Complete; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp index 678c7f78bd0b..4b786ebb7b95 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - Pet::Pet() { m_Id = 0L; @@ -43,37 +42,31 @@ void Pet::validate() web::json::value Pet::toJson() const { web::json::value val = web::json::value::object(); - if(m_IdIsSet) { val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } - if(m_CategoryIsSet) { val[utility::conversions::to_string_t(U("category"))] = ModelBase::toJson(m_Category); } - if(m_NameIsSet) { val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); } - if(m_PhotoUrlsIsSet) { val[utility::conversions::to_string_t(U("photoUrls"))] = ModelBase::toJson(m_PhotoUrls); } - if(m_TagsIsSet) { val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags); } - if(m_StatusIsSet) { @@ -81,7 +74,6 @@ web::json::value Pet::toJson() const val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(refVal); } - return val; } @@ -89,7 +81,6 @@ web::json::value Pet::toJson() const bool Pet::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("id")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); @@ -170,33 +161,26 @@ void Pet::toMultipart(std::shared_ptr multipart, const utilit if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); - } if(m_CategoryIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("category")), m_Category)); - } if(m_NameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); - } if(m_PhotoUrlsIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photoUrls")), m_PhotoUrls)); - } if(m_TagsIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags)); - } if(m_StatusIsSet) { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), fromStatusEnum(m_Status))); - } } @@ -214,48 +198,40 @@ bool Pet::fromMultiPart(std::shared_ptr multipart, const util int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); - } if(multipart->hasContent(utility::conversions::to_string_t(U("category")))) { std::shared_ptr refVal_setCategory; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_setCategory ); setCategory(refVal_setCategory); - } if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) { utility::string_t refVal_setName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); setName(refVal_setName); - } if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls")))) { std::vector refVal_setPhotoUrls; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_setPhotoUrls ); setPhotoUrls(refVal_setPhotoUrls); - } if(multipart->hasContent(utility::conversions::to_string_t(U("tags")))) { std::vector> refVal_setTags; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags ); setTags(refVal_setTags); - } if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) { utility::string_t refVal_setStatus; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); - setStatus(toStatusEnum(refVal_setStatus)); - } return ok; } - Pet::StatusEnum Pet::toStatusEnum(const utility::string_t& value) const { @@ -290,8 +266,6 @@ const utility::string_t Pet::fromStatusEnum(const StatusEnum value) const } - - int64_t Pet::getId() const { return m_Id; @@ -312,7 +286,6 @@ void Pet::unsetId() { m_IdIsSet = false; } - std::shared_ptr Pet::getCategory() const { return m_Category; @@ -334,7 +307,6 @@ void Pet::unsetCategory() { m_CategoryIsSet = false; } - utility::string_t Pet::getName() const { return m_Name; @@ -356,7 +328,6 @@ void Pet::unsetName() { m_NameIsSet = false; } - std::vector Pet::getPhotoUrls() const { return m_PhotoUrls; @@ -378,7 +349,6 @@ void Pet::unsetPhotoUrls() { m_PhotoUrlsIsSet = false; } - std::vector> Pet::getTags() const { return m_Tags; @@ -400,7 +370,6 @@ void Pet::unsetTags() { m_TagsIsSet = false; } - Pet::StatusEnum Pet::getStatus() const { return m_Status; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp index ba45d8b5ca40..5e50e1d6ba2b 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - SchemaWithSet::SchemaWithSet() { m_CertificatesIsSet = false; @@ -37,19 +36,16 @@ void SchemaWithSet::validate() web::json::value SchemaWithSet::toJson() const { web::json::value val = web::json::value::object(); - if(m_CertificatesIsSet) { val[utility::conversions::to_string_t(U("certificates"))] = ModelBase::toJson(m_Certificates); } - if(m_VaccinationBookIsSet) { val[utility::conversions::to_string_t(U("vaccinationBook"))] = ModelBase::toJson(m_VaccinationBook); } - return val; } @@ -57,7 +53,6 @@ web::json::value SchemaWithSet::toJson() const bool SchemaWithSet::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("certificates")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("certificates"))); @@ -93,12 +88,10 @@ void SchemaWithSet::toMultipart(std::shared_ptr multipart, co if(m_CertificatesIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("certificates")), m_Certificates)); - } if(m_VaccinationBookIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccinationBook")), m_VaccinationBook)); - } } @@ -116,21 +109,17 @@ bool SchemaWithSet::fromMultiPart(std::shared_ptr multipart, std::set refVal_setCertificates; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("certificates"))), refVal_setCertificates ); setCertificates(refVal_setCertificates); - } if(multipart->hasContent(utility::conversions::to_string_t(U("vaccinationBook")))) { std::shared_ptr refVal_setVaccinationBook; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccinationBook"))), refVal_setVaccinationBook ); setVaccinationBook(refVal_setVaccinationBook); - } return ok; } - - std::set SchemaWithSet::getCertificates() const { return m_Certificates; @@ -152,7 +141,6 @@ void SchemaWithSet::unsetCertificates() { m_CertificatesIsSet = false; } - std::shared_ptr SchemaWithSet::getVaccinationBook() const { return m_VaccinationBook; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp index f27c681113b9..754db70ed42d 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - SchemaWithSet_vaccinationBook::SchemaWithSet_vaccinationBook() { m_VaccinesIsSet = false; @@ -36,13 +35,11 @@ void SchemaWithSet_vaccinationBook::validate() web::json::value SchemaWithSet_vaccinationBook::toJson() const { web::json::value val = web::json::value::object(); - if(m_VaccinesIsSet) { val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines); } - return val; } @@ -50,7 +47,6 @@ web::json::value SchemaWithSet_vaccinationBook::toJson() const bool SchemaWithSet_vaccinationBook::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("vaccines")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vaccines"))); @@ -75,7 +71,6 @@ void SchemaWithSet_vaccinationBook::toMultipart(std::shared_ptradd(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccines")), m_Vaccines)); - } } @@ -93,14 +88,11 @@ bool SchemaWithSet_vaccinationBook::fromMultiPart(std::shared_ptr> refVal_setVaccines; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines ); setVaccines(refVal_setVaccines); - } return ok; } - - std::set> SchemaWithSet_vaccinationBook::getVaccines() const { return m_Vaccines; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp index 3c4d3c1fb67a..bc36904b52d4 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Tag.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - Tag::Tag() { m_Id = 0L; @@ -39,19 +38,16 @@ void Tag::validate() web::json::value Tag::toJson() const { web::json::value val = web::json::value::object(); - if(m_IdIsSet) { val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } - if(m_NameIsSet) { val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); } - return val; } @@ -59,7 +55,6 @@ web::json::value Tag::toJson() const bool Tag::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("id")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); @@ -95,12 +90,10 @@ void Tag::toMultipart(std::shared_ptr multipart, const utilit if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); - } if(m_NameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); - } } @@ -118,21 +111,17 @@ bool Tag::fromMultiPart(std::shared_ptr multipart, const util int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); - } if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) { utility::string_t refVal_setName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); setName(refVal_setName); - } return ok; } - - int64_t Tag::getId() const { return m_Id; @@ -153,7 +142,6 @@ void Tag::unsetId() { m_IdIsSet = false; } - utility::string_t Tag::getName() const { return m_Name; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp index e9b53ec07df1..bd1c959d53f1 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/User.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - User::User() { m_Id = 0L; @@ -51,55 +50,46 @@ void User::validate() web::json::value User::toJson() const { web::json::value val = web::json::value::object(); - if(m_IdIsSet) { val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); } - if(m_UsernameIsSet) { val[utility::conversions::to_string_t(U("username"))] = ModelBase::toJson(m_Username); } - if(m_FirstNameIsSet) { val[utility::conversions::to_string_t(U("firstName"))] = ModelBase::toJson(m_FirstName); } - if(m_LastNameIsSet) { val[utility::conversions::to_string_t(U("lastName"))] = ModelBase::toJson(m_LastName); } - if(m_EmailIsSet) { val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email); } - if(m_PasswordIsSet) { val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password); } - if(m_PhoneIsSet) { val[utility::conversions::to_string_t(U("phone"))] = ModelBase::toJson(m_Phone); } - if(m_UserStatusIsSet) { val[utility::conversions::to_string_t(U("userStatus"))] = ModelBase::toJson(m_UserStatus); } - return val; } @@ -107,7 +97,6 @@ web::json::value User::toJson() const bool User::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("id")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); @@ -209,42 +198,34 @@ void User::toMultipart(std::shared_ptr multipart, const utili if(m_IdIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); - } if(m_UsernameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("username")), m_Username)); - } if(m_FirstNameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("firstName")), m_FirstName)); - } if(m_LastNameIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lastName")), m_LastName)); - } if(m_EmailIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email)); - } if(m_PasswordIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password)); - } if(m_PhoneIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("phone")), m_Phone)); - } if(m_UserStatusIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("userStatus")), m_UserStatus)); - } } @@ -262,63 +243,53 @@ bool User::fromMultiPart(std::shared_ptr multipart, const uti int64_t refVal_setId; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); setId(refVal_setId); - } if(multipart->hasContent(utility::conversions::to_string_t(U("username")))) { utility::string_t refVal_setUsername; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_setUsername ); setUsername(refVal_setUsername); - } if(multipart->hasContent(utility::conversions::to_string_t(U("firstName")))) { utility::string_t refVal_setFirstName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_setFirstName ); setFirstName(refVal_setFirstName); - } if(multipart->hasContent(utility::conversions::to_string_t(U("lastName")))) { utility::string_t refVal_setLastName; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_setLastName ); setLastName(refVal_setLastName); - } if(multipart->hasContent(utility::conversions::to_string_t(U("email")))) { utility::string_t refVal_setEmail; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail ); setEmail(refVal_setEmail); - } if(multipart->hasContent(utility::conversions::to_string_t(U("password")))) { utility::string_t refVal_setPassword; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword ); setPassword(refVal_setPassword); - } if(multipart->hasContent(utility::conversions::to_string_t(U("phone")))) { utility::string_t refVal_setPhone; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_setPhone ); setPhone(refVal_setPhone); - } if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus")))) { int32_t refVal_setUserStatus; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_setUserStatus ); setUserStatus(refVal_setUserStatus); - } return ok; } - - int64_t User::getId() const { return m_Id; @@ -339,7 +310,6 @@ void User::unsetId() { m_IdIsSet = false; } - utility::string_t User::getUsername() const { return m_Username; @@ -361,7 +331,6 @@ void User::unsetUsername() { m_UsernameIsSet = false; } - utility::string_t User::getFirstName() const { return m_FirstName; @@ -383,7 +352,6 @@ void User::unsetFirstName() { m_FirstNameIsSet = false; } - utility::string_t User::getLastName() const { return m_LastName; @@ -405,7 +373,6 @@ void User::unsetLastName() { m_LastNameIsSet = false; } - utility::string_t User::getEmail() const { return m_Email; @@ -427,7 +394,6 @@ void User::unsetEmail() { m_EmailIsSet = false; } - utility::string_t User::getPassword() const { return m_Password; @@ -449,7 +415,6 @@ void User::unsetPassword() { m_PasswordIsSet = false; } - utility::string_t User::getPhone() const { return m_Phone; @@ -471,7 +436,6 @@ void User::unsetPhone() { m_PhoneIsSet = false; } - int32_t User::getUserStatus() const { return m_UserStatus; diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp index 6e8ec9282ed2..a833d63dcd22 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp @@ -18,7 +18,6 @@ namespace openapitools { namespace client { namespace model { - Vaccine::Vaccine() { m_dateIsSet = false; @@ -38,19 +37,16 @@ void Vaccine::validate() web::json::value Vaccine::toJson() const { web::json::value val = web::json::value::object(); - if(m_dateIsSet) { val[utility::conversions::to_string_t(U("date"))] = ModelBase::toJson(m_date); } - if(m_BoosterRequiredIsSet) { val[utility::conversions::to_string_t(U("boosterRequired"))] = ModelBase::toJson(m_BoosterRequired); } - return val; } @@ -58,7 +54,6 @@ web::json::value Vaccine::toJson() const bool Vaccine::fromJson(const web::json::value& val) { bool ok = true; - if(val.has_field(utility::conversions::to_string_t(U("date")))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("date"))); @@ -94,12 +89,10 @@ void Vaccine::toMultipart(std::shared_ptr multipart, const ut if(m_dateIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("date")), m_date)); - } if(m_BoosterRequiredIsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boosterRequired")), m_BoosterRequired)); - } } @@ -117,21 +110,17 @@ bool Vaccine::fromMultiPart(std::shared_ptr multipart, const std::shared_ptr refVal_setDate; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("date"))), refVal_setDate ); setDate(refVal_setDate); - } if(multipart->hasContent(utility::conversions::to_string_t(U("boosterRequired")))) { bool refVal_setBoosterRequired; ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boosterRequired"))), refVal_setBoosterRequired ); setBoosterRequired(refVal_setBoosterRequired); - } return ok; } - - std::shared_ptr Vaccine::getDate() const { return m_date; @@ -153,7 +142,6 @@ void Vaccine::unsetdate() { m_dateIsSet = false; } - bool Vaccine::isBoosterRequired() const { return m_BoosterRequired; From b2507777e6f54a4ed72327bb92850bd475fa1a6d Mon Sep 17 00:00:00 2001 From: Jean-Pierre Portier <141755467+JPPortier@users.noreply.github.com> Date: Thu, 5 Dec 2024 05:16:17 +0100 Subject: [PATCH 32/40] fix (DefaultGenerator): Handle "$ref" parameter reference to identify parameter ID (#20239) (#20240) --- .../main/java/org/openapitools/codegen/DefaultGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index e5366475d554..0e377c2bd656 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -1619,7 +1619,7 @@ private void processOperation(String resourcePath, String httpMethod, Operation } private static String generateParameterId(Parameter parameter) { - return parameter.getName() + ":" + parameter.getIn(); + return null == parameter.get$ref() ? parameter.getName() + ":" + parameter.getIn() : parameter.get$ref() ; } private OperationsMap processOperations(CodegenConfig config, String tag, List ops, List allModels) { From 6ba311e85c7999bfef676e49eaeb331ce8b13d02 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 5 Dec 2024 12:59:26 +0800 Subject: [PATCH 33/40] add a test for generateParameterId (#20256) --- .../codegen/java/JavaClientCodegenTest.java | 26 ++++++++++++- .../src/test/resources/3_1/issue_20239.yaml | 38 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/3_1/issue_20239.yaml diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 8fd833696822..71191d9f7194 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -3210,4 +3210,28 @@ public void testDuplicatedOperationId() { ); } -} + @Test + public void testGenerateParameterId() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setValidateSpec(false) + .setGeneratorName("java") + .setAdditionalProperties(Map.of( + CodegenConstants.API_PACKAGE, "xyz.abcdef.api" + )) + .setInputSpec("src/test/resources/3_1/issue_20239.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + TestUtils.assertFileContains( + output.resolve("src/main/java/xyz/abcdef/api/ATagApi.java"), + " getCall(String pathParameter, Integer queryParameter, final ApiCallback _callback)" + ); + + TestUtils.assertFileNotContains( + output.resolve("src/main/java/xyz/abcdef/api/ATagApi.java"), + " getCall(Integer queryParameter, final ApiCallback _callback)" + ); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_1/issue_20239.yaml b/modules/openapi-generator/src/test/resources/3_1/issue_20239.yaml new file mode 100644 index 000000000000..8082304c1f67 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_1/issue_20239.yaml @@ -0,0 +1,38 @@ +openapi: 3.1.0 +info: + title: API Overview + version: "v1" + description: description + +tags: + - name: aTag + +paths: + "/path/{path_parameter}": + parameters: + - $ref: "#/components/parameters/path_parameter" + get: + tags: + - aTag + operationId: get + parameters: + - $ref: "#/components/parameters/query_parameter" + responses: + "200": + description: no body +components: + parameters: + path_parameter: + name: path_parameter + in: path + required: true + schema: + type: string + + query_parameter: + name: query_parameter + in: query + schema: + type: integer + minimum: 0 + default: 0 From 8035da8639565fd711e70878a307a1fd5c2fa875 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 5 Dec 2024 17:04:42 +0800 Subject: [PATCH 34/40] =?UTF-8?q?Revert=20"[Kotlin]=20fix=20#20231,=20=20O?= =?UTF-8?q?kHttp=20client=20can=20handle=20a=20field=20with=20a=20list=20o?= =?UTF-8?q?f=E2=80=A6"=20(#20257)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 71ccc88037216d973b0df12d4b6c618ae00b355b. --- .../infrastructure/ApiClient.kt.mustache | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- .../client/infrastructure/ApiClient.kt | 69 ++++--------------- 22 files changed, 330 insertions(+), 1188 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index bc0027e74050..296a4489ebc8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -114,48 +114,6 @@ import com.squareup.moshi.adapter return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -167,18 +125,21 @@ import com.squareup.moshi.adapter // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b76315bd9e88..ebe19a239040 100644 --- a/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ public open class ApiClient(public val baseUrl: String, public val client: Call. // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 1911b1d4788b..97cbbafeffc5 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 44095e73f25d..78393b4e1f0f 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 70539f9c8521..0fefe31762b4 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -87,48 +87,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -140,18 +98,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 5a8f81566cf1..1665b2b38edc 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -88,48 +88,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -141,18 +99,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0867fa0c3175..abfd0da3bad6 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0867fa0c3175..abfd0da3bad6 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0867fa0c3175..abfd0da3bad6 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e59fa0b5a488..0b323c1c6a8a 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index ad481e08ba5a..0e872a9db2fd 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ internal open class ApiClient(val baseUrl: String, val client: Call.Factory = de // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0867fa0c3175..abfd0da3bad6 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0867fa0c3175..abfd0da3bad6 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 83cf91d89282..b80c63097678 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 09a59bf60d78..721cd7955d91 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -86,48 +86,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -139,18 +97,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0867fa0c3175..abfd0da3bad6 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,48 +85,6 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie return contentType ?: "application/octet-stream" } - /** - * Adds a File to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is a File - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param file The file that will be added as the field value - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, file: File) { - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${file.name}\"") - val fileMediaType = guessContentTypeFromFile(file).toMediaTypeOrNull() - addPart( - partHeaders.toHeaders(), - file.asRequestBody(fileMediaType) - ) - } - - /** - * Adds any type to a MultipartBody.Builder - * Defined a helper in the requestBody method to not duplicate code - * It will be used when the content is a FormDataMediaType and the body of the PartConfig is not a File. - * - * @param name The field name to add in the request - * @param headers The headers that are in the PartConfig - * @param obj The field name to add in the request - * @return The method returns Unit but the new Part is added to the Builder that the extension function is applying on - * @see requestBody - */ - protected fun MultipartBody.Builder.addPartToMultiPart(name: String, headers: Map, obj: T?) { - if (obj == null) return - val partHeaders = headers.toMutableMap() + - ("Content-Disposition" to "form-data; name=\"$name\"") - addPart( - partHeaders.toHeaders(), - parameterToString(obj).toRequestBody(null) - ) - } - protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { content is ByteArray -> content.toRequestBody((mediaType ?: guessContentTypeFromByteArray(content)).toMediaTypeOrNull()) @@ -138,18 +96,21 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie // content's type *must* be Map> @Suppress("UNCHECKED_CAST") (content as Map>).forEach { (name, part) -> - when (part.body) { - is File -> addPartToMultiPart(name, part.headers, part.body) - is List<*> -> { - part.body.forEach { - if (it is File) { - addPartToMultiPart(name, part.headers, it) - } else { - addPartToMultiPart(name, part.headers, it) - } - } - } - else -> addPartToMultiPart(name, part.headers, part.body) + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) + ) + } else { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") + addPart( + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) + ) } } }.build() From f603f04bc458bb89d5037c621e2c98c2217cb74c Mon Sep 17 00:00:00 2001 From: Jan Holy Date: Thu, 5 Dec 2024 11:01:02 +0100 Subject: [PATCH 35/40] [Kotlin] fix 20228 - spring-kotlin insert override modifier to interface if it is needed (#20246) --- .../kotlin-spring/interfaceOptVar.mustache | 2 +- .../kotlin-spring/interfaceReqVar.mustache | 2 +- .../spring/KotlinSpringServerCodegenTest.java | 30 +++++++++++++ .../src/test/resources/bugs/issue_20228.yaml | 42 +++++++++++++++++++ 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/bugs/issue_20228.yaml diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache index f8d228d17101..3fa63ad64876 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache @@ -2,4 +2,4 @@ @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache index 710ae9c450ca..8f0fb71ba319 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache @@ -2,4 +2,4 @@ @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index 46fb7fae80e8..f579e5933448 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -851,6 +851,36 @@ public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreate } + @Test + public void overridePropertyFunction() throws IOException { + + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, true); + + ClientOptInput input = new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/bugs/issue_20228.yaml")) + .config(codegen); + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFileContains( + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Pony.kt"), + "override val nameOpt", "override val nameReq" + ); + } + @Test public void generateSerializableModel() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_20228.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_20228.yaml new file mode 100644 index 000000000000..db3b7d7c5c24 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_20228.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.3 +paths: + /api/kotlin-test: + post: + description: Example get + responses: + '200': + description: The request sent by the client was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/Unicorn' +components: + schemas: + Animal: + type: "object" + properties: + nameOpt: + type: "string" + nameReq: + type: "string" + discriminator: + propertyName: animalType + mapping: + pegasi: "#/components/schemas/Pony" + Pony: + allOf: + - $ref: "#/components/schemas/Animal" + - type: "object" + discriminator: + propertyName: ponyType + mapping: + pegasi: "#/components/schemas/Pegasi" + unicorn: "#/components/schemas/Unicorn" + Pegasi: + allOf: + - $ref: "#/components/schemas/Pony" + - type: "object" + Unicorn: + allOf: + - $ref: "#/components/schemas/Pony" + - type: "object" \ No newline at end of file From 387fd9986ca6d15e78ca2a8beb1099b1beb5d95b Mon Sep 17 00:00:00 2001 From: Daniel Owens <110904448+danowensdev@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:44:08 +0100 Subject: [PATCH 36/40] [typescript-fetch] fix API signature return type for empty 20x responses (#20249) * typescript-fetch: fix promise return type for optional responses * Remove unnecessary change --- .../src/main/resources/typescript-fetch/apis.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 53276d5bf061..6c50de8a5a68 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -70,10 +70,10 @@ export interface {{classname}}Interface { {{/isDeprecated}} */ {{^useSingleRequestParameter}} - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/returnType}}{{^returnType}}void{{/returnType}}>; {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} - {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/returnType}}{{^returnType}}void{{/returnType}}>; {{/useSingleRequestParameter}} {{/operation}} From 52b5b8fb760bba566739f85a3ce1174a442e2aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Fern=C3=A1ndez?= Date: Thu, 5 Dec 2024 14:32:34 -0300 Subject: [PATCH 37/40] Fix a few issues with the C generator (part 2) (#20227) * [C] Don't convert post body strings to JSON If the body provided for the api request is a just a string itself, don't try to convert it to JSON, simply submit the string. * [C] Implement BearerToken authentication * [C] Handle nullable fields correctly * [C] Fix implementation of FromString for enums * [C] Update the test schemas to cover the changes * Update samples * Fix the updated samples * [C] Add the new samples folder to the CI workflow --- .../workflows/samples-c-libcurl-client.yaml | 3 + bin/configs/c-bearer-auth.yaml | 4 + .../resources/C-libcurl/api-body.mustache | 7 + .../resources/C-libcurl/apiClient.c.mustache | 25 + .../resources/C-libcurl/apiClient.h.mustache | 3 + .../resources/C-libcurl/model-body.mustache | 22 +- .../src/test/resources/2_0/c/petstore.yaml | 51 + .../src/test/resources/3_0/c/bearer_auth.yaml | 58 + .../c/bearerAuth/.openapi-generator-ignore | 23 + .../c/bearerAuth/.openapi-generator/FILES | 22 + .../c/bearerAuth/.openapi-generator/VERSION | 1 + .../client/others/c/bearerAuth/CMakeLists.txt | 168 + .../client/others/c/bearerAuth/Packing.cmake | 24 + samples/client/others/c/bearerAuth/README.md | 90 + .../others/c/bearerAuth/api/DefaultAPI.c | 204 ++ .../others/c/bearerAuth/api/DefaultAPI.h | 34 + .../others/c/bearerAuth/docs/DefaultAPI.md | 104 + .../others/c/bearerAuth/external/cJSON.c | 2932 +++++++++++++++++ .../others/c/bearerAuth/external/cJSON.h | 277 ++ .../c/bearerAuth/external/cJSON.licence | 19 + .../others/c/bearerAuth/include/apiClient.h | 62 + .../others/c/bearerAuth/include/binary.h | 18 + .../c/bearerAuth/include/keyValuePair.h | 17 + .../client/others/c/bearerAuth/include/list.h | 42 + .../others/c/bearerAuth/libcurl.licence | 11 + .../others/c/bearerAuth/model/any_type.h | 5 + .../client/others/c/bearerAuth/model/object.c | 51 + .../client/others/c/bearerAuth/model/object.h | 27 + .../others/c/bearerAuth/src/apiClient.c | 509 +++ .../client/others/c/bearerAuth/src/apiKey.c | 20 + .../client/others/c/bearerAuth/src/binary.c | 58 + samples/client/others/c/bearerAuth/src/list.c | 200 ++ .../others/c/bearerAuth/uncrustify-rules.cfg | 210 ++ .../.openapi-generator/FILES | 3 + .../c-useJsonUnformatted/CMakeLists.txt | 2 + .../petstore/c-useJsonUnformatted/README.md | 3 + .../c-useJsonUnformatted/api/PetAPI.c | 135 + .../c-useJsonUnformatted/api/PetAPI.h | 13 + .../c-useJsonUnformatted/docs/PetAPI.md | 61 + .../petstore/c-useJsonUnformatted/docs/bit.md | 9 + .../c-useJsonUnformatted/model/api_response.c | 9 + .../petstore/c-useJsonUnformatted/model/bit.c | 41 + .../petstore/c-useJsonUnformatted/model/bit.h | 32 + .../c-useJsonUnformatted/model/category.c | 6 + .../c-useJsonUnformatted/model/mapped_model.c | 6 + .../model/model_with_set_propertes.c | 6 + .../c-useJsonUnformatted/model/order.c | 18 + .../petstore/c-useJsonUnformatted/model/pet.c | 18 + .../c-useJsonUnformatted/model/preference.c | 12 +- .../petstore/c-useJsonUnformatted/model/tag.c | 6 + .../c-useJsonUnformatted/model/user.c | 30 + .../c-useJsonUnformatted/unit-test/test_bit.c | 56 + .../petstore/c/.openapi-generator/FILES | 3 + samples/client/petstore/c/README.md | 3 + samples/client/petstore/c/api/PetAPI.c | 135 + samples/client/petstore/c/api/PetAPI.h | 13 + samples/client/petstore/c/docs/PetAPI.md | 61 + samples/client/petstore/c/docs/bit.md | 9 + .../client/petstore/c/model/api_response.c | 9 + samples/client/petstore/c/model/bit.c | 41 + samples/client/petstore/c/model/bit.h | 32 + samples/client/petstore/c/model/category.c | 6 + .../client/petstore/c/model/mapped_model.c | 6 + .../c/model/model_with_set_propertes.c | 6 + samples/client/petstore/c/model/order.c | 18 + samples/client/petstore/c/model/pet.c | 18 + samples/client/petstore/c/model/preference.c | 12 +- samples/client/petstore/c/model/tag.c | 6 + samples/client/petstore/c/model/user.c | 30 + .../client/petstore/c/unit-test/test_bit.c | 56 + 70 files changed, 6200 insertions(+), 31 deletions(-) create mode 100644 bin/configs/c-bearer-auth.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/c/bearer_auth.yaml create mode 100644 samples/client/others/c/bearerAuth/.openapi-generator-ignore create mode 100644 samples/client/others/c/bearerAuth/.openapi-generator/FILES create mode 100644 samples/client/others/c/bearerAuth/.openapi-generator/VERSION create mode 100644 samples/client/others/c/bearerAuth/CMakeLists.txt create mode 100644 samples/client/others/c/bearerAuth/Packing.cmake create mode 100644 samples/client/others/c/bearerAuth/README.md create mode 100644 samples/client/others/c/bearerAuth/api/DefaultAPI.c create mode 100644 samples/client/others/c/bearerAuth/api/DefaultAPI.h create mode 100644 samples/client/others/c/bearerAuth/docs/DefaultAPI.md create mode 100644 samples/client/others/c/bearerAuth/external/cJSON.c create mode 100644 samples/client/others/c/bearerAuth/external/cJSON.h create mode 100644 samples/client/others/c/bearerAuth/external/cJSON.licence create mode 100644 samples/client/others/c/bearerAuth/include/apiClient.h create mode 100644 samples/client/others/c/bearerAuth/include/binary.h create mode 100644 samples/client/others/c/bearerAuth/include/keyValuePair.h create mode 100644 samples/client/others/c/bearerAuth/include/list.h create mode 100644 samples/client/others/c/bearerAuth/libcurl.licence create mode 100644 samples/client/others/c/bearerAuth/model/any_type.h create mode 100644 samples/client/others/c/bearerAuth/model/object.c create mode 100644 samples/client/others/c/bearerAuth/model/object.h create mode 100644 samples/client/others/c/bearerAuth/src/apiClient.c create mode 100644 samples/client/others/c/bearerAuth/src/apiKey.c create mode 100644 samples/client/others/c/bearerAuth/src/binary.c create mode 100644 samples/client/others/c/bearerAuth/src/list.c create mode 100644 samples/client/others/c/bearerAuth/uncrustify-rules.cfg create mode 100644 samples/client/petstore/c-useJsonUnformatted/docs/bit.md create mode 100644 samples/client/petstore/c-useJsonUnformatted/model/bit.c create mode 100644 samples/client/petstore/c-useJsonUnformatted/model/bit.h create mode 100644 samples/client/petstore/c-useJsonUnformatted/unit-test/test_bit.c create mode 100644 samples/client/petstore/c/docs/bit.md create mode 100644 samples/client/petstore/c/model/bit.c create mode 100644 samples/client/petstore/c/model/bit.h create mode 100644 samples/client/petstore/c/unit-test/test_bit.c diff --git a/.github/workflows/samples-c-libcurl-client.yaml b/.github/workflows/samples-c-libcurl-client.yaml index f2a024a85ba6..922459f8d14e 100644 --- a/.github/workflows/samples-c-libcurl-client.yaml +++ b/.github/workflows/samples-c-libcurl-client.yaml @@ -5,10 +5,12 @@ on: paths: - 'samples/client/petstore/c/**' - 'samples/client/petstore/c-useJsonUnformatted/**' + - 'samples/client/others/c/bearerAuth/**' pull_request: paths: - 'samples/client/petstore/c/**' - 'samples/client/petstore/c-useJsonUnformatted/**' + - 'samples/client/others/c/bearerAuth/**' jobs: build: @@ -20,6 +22,7 @@ jobs: sample: - 'samples/client/petstore/c/' - 'samples/client/petstore/c-useJsonUnformatted/' + - 'samples/client/others/c/bearerAuth/' steps: - uses: actions/checkout@v4 diff --git a/bin/configs/c-bearer-auth.yaml b/bin/configs/c-bearer-auth.yaml new file mode 100644 index 000000000000..8556eb16298c --- /dev/null +++ b/bin/configs/c-bearer-auth.yaml @@ -0,0 +1,4 @@ +generatorName: c +outputDir: samples/client/others/c/bearerAuth +inputSpec: modules/openapi-generator/src/test/resources/3_0/c/bearer_auth.yaml +templateDir: modules/openapi-generator/src/main/resources/C-libcurl diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 191a408cbd1e..f7c9c391ce36 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -324,6 +324,10 @@ end: } {{/isArray}} {{^isArray}} + {{#isString}} + localVarBodyParameters = strdup({{paramName}}); + {{/isString}} + {{^isString}} cJSON *localVarSingleItemJSON_{{paramName}} = NULL; if ({{paramName}} != NULL) { @@ -331,6 +335,7 @@ end: localVarSingleItemJSON_{{paramName}} = {{dataType}}_convertToJSON({{paramName}}); localVarBodyParameters = {{{cJSONPrint}}}(localVarSingleItemJSON_{{paramName}}); } + {{/isString}} {{/isArray}} {{/bodyParam}} {{#produces}} @@ -458,10 +463,12 @@ end: free(localVarBodyParameters); {{/isArray}} {{^isArray}} + {{^isString}} if (localVarSingleItemJSON_{{paramName}}) { cJSON_Delete(localVarSingleItemJSON_{{paramName}}); localVarSingleItemJSON_{{paramName}} = NULL; } + {{/isString}} free(localVarBodyParameters); {{/isArray}} {{/bodyParams}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache index 0d1bf5b06593..bf9e700c5306 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache @@ -22,6 +22,9 @@ apiClient_t *apiClient_create() { apiClient->username = NULL; apiClient->password = NULL; {{/isBasicBasic}} + {{#isBasicBearer}} + apiClient->accessToken = NULL; + {{/isBasicBearer}} {{#isOAuth}} apiClient->accessToken = NULL; {{/isOAuth}} @@ -69,6 +72,9 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath apiClient->username = NULL; apiClient->password = NULL; {{/isBasicBasic}} + {{#isBasicBearer}} + apiClient->accessToken = NULL; + {{/isBasicBearer}} {{#isOAuth}} apiClient->accessToken = NULL; {{/isOAuth}} @@ -108,6 +114,11 @@ void apiClient_free(apiClient_t *apiClient) { free(apiClient->password); } {{/isBasicBasic}} + {{#isBasicBearer}} + if(apiClient->accessToken) { + free(apiClient->accessToken); + } + {{/isBasicBearer}} {{#isOAuth}} if(apiClient->accessToken) { free(apiClient->accessToken); @@ -467,6 +478,20 @@ void apiClient_invoke(apiClient_t *apiClient, } } {{/isApiKey}} + {{#isBasicBearer}} + // this would only be generated for bearer token authentication + if(apiClient->accessToken != NULL) + { + int authHeaderSize; + char *authHeader = NULL; + + authHeaderSize = snprintf(NULL, 0, "Authorization: Bearer %s", apiClient->accessToken) + 1; + authHeader = malloc(authHeaderSize); + snprintf(authHeader, authHeaderSize, "Authorization: Bearer %s", apiClient->accessToken); + headers = curl_slist_append(headers, authHeader); + free(authHeader); + } + {{/isBasicBearer}} {{/authMethods}} {{/hasAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache index 6c192cdc90a9..b12d98f4464e 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache @@ -34,6 +34,9 @@ typedef struct apiClient_t { char *username; char *password; {{/isBasicBasic}} + {{#isBasicBearer}} + char *accessToken; + {{/isBasicBearer}} {{#isOAuth}} char *accessToken; {{/isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index af6e1127e5bb..ebf15d178911 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -49,27 +49,20 @@ fail: } {{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}_parseFromJSON(cJSON *{{classname}}JSON) { - {{projectName}}_{{classVarName}}_{{enumName}}_e *{{classname}} = NULL; {{#isEnum}} {{#isNumeric}} - cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}"); - if(!cJSON_IsNumber({{{classname}}}Var)) - { - goto end; + if(!cJSON_IsNumber({{{classname}}}JSON)) { + return 0; } + return {{classname}}JSON->valueint; {{/isNumeric}} {{#isString}} - {{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}Variable; - cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}"); - if(!cJSON_IsString({{{classname}}}Var) || ({{{classname}}}Var->valuestring == NULL)){ - goto end; + if(!cJSON_IsString({{{classname}}}JSON) || ({{{classname}}}JSON->valuestring == NULL)) { + return 0; } - {{classname}}Variable = {{classFilename}}_{{classname}}_FromString({{{classname}}}Var->valuestring); + return {{classFilename}}_{{classname}}_FromString({{{classname}}}JSON->valuestring); {{/isString}} {{/isEnum}} - return {{classname}}Variable; -end: - return 0; } {{/isEnum}} {{^isEnum}} @@ -623,6 +616,9 @@ fail: {{#vars}} // {{{classname}}}->{{{name}}} cJSON *{{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}"); + if (cJSON_IsNull({{{name}}})) { + {{{name}}} = NULL; + } {{#required}} if (!{{{name}}}) { goto end; diff --git a/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml b/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml index 082c039eadb9..58f99c3126cd 100644 --- a/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml @@ -253,6 +253,26 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + /pet/picture: + post: + tags: + - pet + summary: Send a picture of your happy pet + description: '' + operationId: sharePicture + parameters: + - in: body + name: picture + description: A picture you want to share + required: true + schema: + type: string + responses: + '200': + description: successful operation + schema: + type: string + description: Thank you message '/pet/{petId}/uploadImage': post: tags: @@ -290,6 +310,31 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + '/pet/{petId}/isAvailable': + post: + tags: + - pet + summary: Is this pet still available? + description: '' + operationId: isPetAvailable + produces: + - application/json + parameters: + - name: petId + in: path + description: ID of pet to check + required: true + type: integer + format: int64 + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Bit' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' /store/inventory: get: tags: @@ -775,3 +820,9 @@ definitions: uniqueItems: true items: type: string + Bit: + description: bit value + type: number + enum: + - 0 + - 1 diff --git a/modules/openapi-generator/src/test/resources/3_0/c/bearer_auth.yaml b/modules/openapi-generator/src/test/resources/3_0/c/bearer_auth.yaml new file mode 100644 index 000000000000..c132519ef2fa --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/c/bearer_auth.yaml @@ -0,0 +1,58 @@ +# Copied from k6 +openapi: 3.0.0 +info: + title: Sample API + description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML. + version: 0.1.9 +servers: + - url: http://api.example.com/v1 + description: Optional server description, e.g. Main (production) server + - url: http://staging-api.example.com + description: Optional server description, e.g. Internal staging server for testing +security: + - bearerAuth: [] +paths: + /users: + get: + summary: Returns a list of users. + description: Optional extended description in CommonMark or HTML. + responses: + "200": # status code + description: A JSON array of user names + content: + application/json: + schema: + type: array + items: + type: string + security: + - bearerAuth: [] + /public: + get: + summary: Returns public information. + description: This endpoint does not require authentication. + responses: + "200": + description: A JSON object with public information + content: + application/json: + schema: + type: object + security: [] + /private: + get: + summary: Returns private information. + description: This endpoint requires global security settings. + responses: + "200": + description: A JSON object with private information + content: + application/json: + schema: + type: object +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # Optional: specify the format (e.g., JWT) if applicable diff --git a/samples/client/others/c/bearerAuth/.openapi-generator-ignore b/samples/client/others/c/bearerAuth/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/c/bearerAuth/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/c/bearerAuth/.openapi-generator/FILES b/samples/client/others/c/bearerAuth/.openapi-generator/FILES new file mode 100644 index 000000000000..735fcca33afa --- /dev/null +++ b/samples/client/others/c/bearerAuth/.openapi-generator/FILES @@ -0,0 +1,22 @@ +CMakeLists.txt +Packing.cmake +README.md +api/DefaultAPI.c +api/DefaultAPI.h +docs/DefaultAPI.md +external/cJSON.c +external/cJSON.h +external/cJSON.licence +include/apiClient.h +include/binary.h +include/keyValuePair.h +include/list.h +libcurl.licence +model/any_type.h +model/object.c +model/object.h +src/apiClient.c +src/apiKey.c +src/binary.c +src/list.c +uncrustify-rules.cfg diff --git a/samples/client/others/c/bearerAuth/.openapi-generator/VERSION b/samples/client/others/c/bearerAuth/.openapi-generator/VERSION new file mode 100644 index 000000000000..884119126398 --- /dev/null +++ b/samples/client/others/c/bearerAuth/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0-SNAPSHOT diff --git a/samples/client/others/c/bearerAuth/CMakeLists.txt b/samples/client/others/c/bearerAuth/CMakeLists.txt new file mode 100644 index 000000000000..44b182558743 --- /dev/null +++ b/samples/client/others/c/bearerAuth/CMakeLists.txt @@ -0,0 +1,168 @@ +cmake_minimum_required (VERSION 2.6...3.10.2) +project (CGenerator) + +cmake_policy(SET CMP0063 NEW) + +set(CMAKE_C_VISIBILITY_PRESET default) +set(CMAKE_CXX_VISIBILITY_PRESET default) +set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + +find_package(OpenSSL) + +if (OPENSSL_FOUND) + message (STATUS "OPENSSL found") + + set(CMAKE_C_FLAGS "-DOPENSSL") + if(CMAKE_VERSION VERSION_LESS 3.4) + include_directories(${OPENSSL_INCLUDE_DIR}) + include_directories(${OPENSSL_INCLUDE_DIRS}) + link_directories(${OPENSSL_LIBRARIES}) + endif() + + message(STATUS "Using OpenSSL ${OPENSSL_VERSION}") +else() + message (STATUS "OpenSSL Not found.") +endif() + +set(pkgName "sample_api") + +# this default version can be overridden in PreTarget.cmake +set(PROJECT_VERSION_MAJOR 0) +set(PROJECT_VERSION_MINOR 0) +set(PROJECT_VERSION_PATCH 1) + +if( (DEFINED CURL_INCLUDE_DIR) AND (DEFINED CURL_LIBRARIES)) + include_directories(${CURL_INCLUDE_DIR}) + set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) +else() + find_package(CURL 7.58.0 REQUIRED) + if(CURL_FOUND) + include_directories(${CURL_INCLUDE_DIR}) + set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) + else(CURL_FOUND) + message(FATAL_ERROR "Could not find the CURL library and development files.") + endif() +endif() + +set(SRCS + src/list.c + src/apiKey.c + src/apiClient.c + src/binary.c + external/cJSON.c + model/object.c + api/DefaultAPI.c + +) + +set(HDRS + include/apiClient.h + include/list.h + include/binary.h + include/keyValuePair.h + external/cJSON.h + model/object.h + model/any_type.h + api/DefaultAPI.h + +) + +include(PreTarget.cmake OPTIONAL) + +set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + +# Add library with project file with project name as library name +add_library(${pkgName} ${SRCS} ${HDRS}) +# Link dependent libraries +if(NOT CMAKE_VERSION VERSION_LESS 3.4) + target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto) +endif() +target_link_libraries(${pkgName} PUBLIC ${CURL_LIBRARIES} ) +target_include_directories( + ${pkgName} PUBLIC $ + $ +) + +include(PostTarget.cmake OPTIONAL) + +# installation of libraries, headers, and config files +if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in) + install(TARGETS ${pkgName} DESTINATION lib) +else() + include(GNUInstallDirs) + install(TARGETS ${pkgName} DESTINATION lib EXPORT ${pkgName}Targets) + + foreach(HDR_FILE ${HDRS}) + get_filename_component(HDR_DIRECTORY ${HDR_FILE} DIRECTORY) + get_filename_component(ABSOLUTE_HDR_DIRECTORY ${HDR_DIRECTORY} ABSOLUTE) + file(RELATIVE_PATH RELATIVE_HDR_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${ABSOLUTE_HDR_DIRECTORY}) + install(FILES ${HDR_FILE} DESTINATION include/${pkgName}/${RELATIVE_HDR_PATH}) + endforeach() + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}ConfigVersion.cmake" + VERSION "${PROJECT_VERSION_STRING}" + COMPATIBILITY AnyNewerVersion + ) + + export(EXPORT ${pkgName}Targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}Targets.cmake" + NAMESPACE ${pkgName}:: + ) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}Config.cmake" + @ONLY + ) + + set(ConfigPackageLocation lib/cmake/${pkgName}) + install(EXPORT ${pkgName}Targets + FILE + ${pkgName}Targets.cmake + NAMESPACE + ${pkgName}:: + DESTINATION + ${ConfigPackageLocation} + ) + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}ConfigVersion.cmake" + DESTINATION + ${ConfigPackageLocation} + ) +endif() + +# make installation packages +include(Packing.cmake OPTIONAL) + +# Setting file variables to null +set(SRCS "") +set(HDRS "") + + +## This section shows how to use the above compiled library to compile the source files +## set source files +#set(SRCS +# unit-tests/manual-DefaultAPI.c +#) + +##set header files +#set(HDRS +#) + +## loop over all files in SRCS variable +#foreach(SOURCE_FILE ${SRCS}) +# # Get only the file name from the file as add_executable does not support executable with slash("/") +# get_filename_component(FILE_NAME_ONLY ${SOURCE_FILE} NAME_WE) +# # Remove .c from the file name and set it as executable name +# string( REPLACE ".c" "" EXECUTABLE_FILE ${FILE_NAME_ONLY}) +# # Add executable for every source file in SRCS +# add_executable(unit-${EXECUTABLE_FILE} ${SOURCE_FILE}) +# # Link above created library to executable and dependent library curl +# target_link_libraries(unit-${EXECUTABLE_FILE} ${CURL_LIBRARIES} ${pkgName} ) +#endforeach(SOURCE_FILE ${SRCS}) diff --git a/samples/client/others/c/bearerAuth/Packing.cmake b/samples/client/others/c/bearerAuth/Packing.cmake new file mode 100644 index 000000000000..15bd4c8d5e9b --- /dev/null +++ b/samples/client/others/c/bearerAuth/Packing.cmake @@ -0,0 +1,24 @@ +set(CPACK_PACKAGE_NAME lib${pkgName}) + +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_PACKAGE_DESCRIPTION_SUMMARY}) +set(CPACK_PACKAGE_VENDOR ${PROJECT_PACKAGE_VENDOR}) +set(CPACK_PACKAGE_CONTACT ${PROJECT_PACKAGE_CONTACT}) +set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PROJECT_PACKAGE_MAINTAINER}) + +set(CPACK_VERBATIM_VARIABLES YES) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) + +set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) + +set(CPACK_DEB_COMPONENT_INSTALL YES) + +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE) + +include(CPack) \ No newline at end of file diff --git a/samples/client/others/c/bearerAuth/README.md b/samples/client/others/c/bearerAuth/README.md new file mode 100644 index 000000000000..1426ed93e06c --- /dev/null +++ b/samples/client/others/c/bearerAuth/README.md @@ -0,0 +1,90 @@ +# C API client for sample_api + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.1.9 +- Package version: +- Generator version: 7.11.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen + +## Installation +You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later. + +# Prerequisites + +## Install the `curl 7.58.0` package with the following command on Linux. +```bash +sudo apt remove curl +wget http://curl.haxx.se/download/curl-7.58.0.tar.gz +tar -xvf curl-7.58.0.tar.gz +cd curl-7.58.0/ +./configure +make +sudo make install +``` +## Install the `uncrustify 0.67` package with the following command on Linux. +```bash +git clone https://github.com/uncrustify/uncrustify.git +cd uncrustify +mkdir build +cd build +cmake .. +make +sudo make install +``` + +## Compile the sample: +This will compile the generated code and create a library in the build folder which has to be linked to the codes where API will be used. +```bash +mkdir build +cd build +// To install library to specific location, use following commands +cmake -DCMAKE_INSTALL_PREFIX=/pathtolocation .. +// for normal install use following command +cmake .. +make +sudo make install +``` +## How to use compiled library +Considering the test/source code which uses the API is written in main.c(respective api include is written and all objects necessary are defined and created) + +To compile main.c(considering the file is present in build folder) use following command +-L - location of the library(not required if cmake with normal installation is performed) +-l library name +```bash +gcc main.c -L. -lsample_api -o main +``` +Once compiled, you can run it with ``` ./main ``` + +Note: You don't need to specify includes for models and include folder separately as they are path linked. You just have to import the api.h file in your code, the include linking will work. + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.com/v1* + +Category | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultAPI* | [**DefaultAPI_privateGet**](docs/DefaultAPI.md#DefaultAPI_privateGet) | **GET** /private | Returns private information. +*DefaultAPI* | [**DefaultAPI_publicGet**](docs/DefaultAPI.md#DefaultAPI_publicGet) | **GET** /public | Returns public information. +*DefaultAPI* | [**DefaultAPI_usersGet**](docs/DefaultAPI.md#DefaultAPI_usersGet) | **GET** /users | Returns a list of users. + + +## Documentation for Models + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: +### bearerAuth + + +- **Type**: HTTP Bearer Token authentication (JWT) + + +## Author + + + diff --git a/samples/client/others/c/bearerAuth/api/DefaultAPI.c b/samples/client/others/c/bearerAuth/api/DefaultAPI.c new file mode 100644 index 000000000000..2ff9213bff46 --- /dev/null +++ b/samples/client/others/c/bearerAuth/api/DefaultAPI.c @@ -0,0 +1,204 @@ +#include +#include +#include +#include "DefaultAPI.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 +#define intToStr(dst, src) \ + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) + + +// Returns private information. +// +// This endpoint requires global security settings. +// +object_t* +DefaultAPI_privateGet(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/private")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/private"); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","A JSON object with private information"); + //} + //nonprimitive not container + cJSON *DefaultAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + object_t *elementToReturn = object_parseFromJSON(DefaultAPIlocalVarJSON); + cJSON_Delete(DefaultAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// Returns public information. +// +// This endpoint does not require authentication. +// +object_t* +DefaultAPI_publicGet(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/public")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/public"); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","A JSON object with public information"); + //} + //nonprimitive not container + cJSON *DefaultAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + object_t *elementToReturn = object_parseFromJSON(DefaultAPIlocalVarJSON); + cJSON_Delete(DefaultAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + +// Returns a list of users. +// +// Optional extended description in CommonMark or HTML. +// +list_t* +DefaultAPI_usersGet(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/users")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/users"); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","A JSON array of user names"); + //} + //primitive return type not simple + cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); + cJSON *VarJSON; + list_t *elementToReturn = list_createList(); + cJSON_ArrayForEach(VarJSON, localVarJSON){ + keyValuePair_t *keyPair = keyValuePair_create(strdup(VarJSON->string), cJSON_Print(VarJSON)); + list_addElement(elementToReturn, keyPair); + } + cJSON_Delete(localVarJSON); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + diff --git a/samples/client/others/c/bearerAuth/api/DefaultAPI.h b/samples/client/others/c/bearerAuth/api/DefaultAPI.h new file mode 100644 index 000000000000..dc576a2d49bb --- /dev/null +++ b/samples/client/others/c/bearerAuth/api/DefaultAPI.h @@ -0,0 +1,34 @@ +#include +#include +#include "../include/apiClient.h" +#include "../include/list.h" +#include "../external/cJSON.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "../model/object.h" + + +// Returns private information. +// +// This endpoint requires global security settings. +// +object_t* +DefaultAPI_privateGet(apiClient_t *apiClient); + + +// Returns public information. +// +// This endpoint does not require authentication. +// +object_t* +DefaultAPI_publicGet(apiClient_t *apiClient); + + +// Returns a list of users. +// +// Optional extended description in CommonMark or HTML. +// +list_t* +DefaultAPI_usersGet(apiClient_t *apiClient); + + diff --git a/samples/client/others/c/bearerAuth/docs/DefaultAPI.md b/samples/client/others/c/bearerAuth/docs/DefaultAPI.md new file mode 100644 index 000000000000..c07dc6bc9d04 --- /dev/null +++ b/samples/client/others/c/bearerAuth/docs/DefaultAPI.md @@ -0,0 +1,104 @@ +# DefaultAPI + +All URIs are relative to *http://api.example.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DefaultAPI_privateGet**](DefaultAPI.md#DefaultAPI_privateGet) | **GET** /private | Returns private information. +[**DefaultAPI_publicGet**](DefaultAPI.md#DefaultAPI_publicGet) | **GET** /public | Returns public information. +[**DefaultAPI_usersGet**](DefaultAPI.md#DefaultAPI_usersGet) | **GET** /users | Returns a list of users. + + +# **DefaultAPI_privateGet** +```c +// Returns private information. +// +// This endpoint requires global security settings. +// +object_t* DefaultAPI_privateGet(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[object_t](object.md) * + + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DefaultAPI_publicGet** +```c +// Returns public information. +// +// This endpoint does not require authentication. +// +object_t* DefaultAPI_publicGet(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + +[object_t](object.md) * + + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DefaultAPI_usersGet** +```c +// Returns a list of users. +// +// Optional extended description in CommonMark or HTML. +// +list_t* DefaultAPI_usersGet(apiClient_t *apiClient); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | + +### Return type + + +[list_t](char.md) * + + + + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/others/c/bearerAuth/external/cJSON.c b/samples/client/others/c/bearerAuth/external/cJSON.c new file mode 100644 index 000000000000..afc9ff0db8b2 --- /dev/null +++ b/samples/client/others/c/bearerAuth/external/cJSON.c @@ -0,0 +1,2932 @@ +/* + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +/* cJSON */ +/* JSON parser in C. */ + +/* disable warnings about old C89 functions in MSVC */ +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) +#define _CRT_SECURE_NO_DEPRECATE +#endif + +#ifdef __GNUC__ +#pragma GCC visibility push(default) +#endif +#if defined(_MSC_VER) +#pragma warning (push) +/* disable warning about single line comments in system headers */ +#pragma warning (disable : 4001) +#endif + +#include +#include +#include +#include +#include +#include + +#ifdef ENABLE_LOCALES +#include +#endif + +#if defined(_MSC_VER) +#pragma warning (pop) +#endif +#ifdef __GNUC__ +#pragma GCC visibility pop +#endif + +#include "cJSON.h" + +/* define our own boolean type */ +#define true ((cJSON_bool)1) +#define false ((cJSON_bool)0) + +typedef struct { + const unsigned char *json; + size_t position; +} error; +static error global_error = { NULL, 0 }; + +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) +{ + return (const char*) (global_error.json + global_error.position); +} + +CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item) { + if (!cJSON_IsString(item)) { + return NULL; + } + + return item->valuestring; +} + +/* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ +#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 7) + #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. +#endif + +CJSON_PUBLIC(const char*) cJSON_Version(void) +{ + static char version[15]; + sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); + + return version; +} + +/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) +{ + if ((string1 == NULL) || (string2 == NULL)) + { + return 1; + } + + if (string1 == string2) + { + return 0; + } + + for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) + { + if (*string1 == '\0') + { + return 0; + } + } + + return tolower(*string1) - tolower(*string2); +} + +typedef struct internal_hooks +{ + void *(*allocate)(size_t size); + void (*deallocate)(void *pointer); + void *(*reallocate)(void *pointer, size_t size); +} internal_hooks; + +#if defined(_MSC_VER) +/* work around MSVC error C2322: '...' address of dllimport '...' is not static */ +static void *internal_malloc(size_t size) +{ + return malloc(size); +} +static void internal_free(void *pointer) +{ + free(pointer); +} +static void *internal_realloc(void *pointer, size_t size) +{ + return realloc(pointer, size); +} +#else +#define internal_malloc malloc +#define internal_free free +#define internal_realloc realloc +#endif + +static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; + +static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) +{ + size_t length = 0; + unsigned char *copy = NULL; + + if (string == NULL) + { + return NULL; + } + + length = strlen((const char*)string) + sizeof(""); + copy = (unsigned char*)hooks->allocate(length); + if (copy == NULL) + { + return NULL; + } + memcpy(copy, string, length); + + return copy; +} + +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) +{ + if (hooks == NULL) + { + /* Reset hooks */ + global_hooks.allocate = malloc; + global_hooks.deallocate = free; + global_hooks.reallocate = realloc; + return; + } + + global_hooks.allocate = malloc; + if (hooks->malloc_fn != NULL) + { + global_hooks.allocate = hooks->malloc_fn; + } + + global_hooks.deallocate = free; + if (hooks->free_fn != NULL) + { + global_hooks.deallocate = hooks->free_fn; + } + + /* use realloc only if both free and malloc are used */ + global_hooks.reallocate = NULL; + if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) + { + global_hooks.reallocate = realloc; + } +} + +/* Internal constructor. */ +static cJSON *cJSON_New_Item(const internal_hooks * const hooks) +{ + cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); + if (node) + { + memset(node, '\0', sizeof(cJSON)); + } + + return node; +} + +/* Delete a cJSON structure. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) +{ + cJSON *next = NULL; + while (item != NULL) + { + next = item->next; + if (!(item->type & cJSON_IsReference) && (item->child != NULL)) + { + cJSON_Delete(item->child); + } + if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) + { + global_hooks.deallocate(item->valuestring); + } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + global_hooks.deallocate(item->string); + } + global_hooks.deallocate(item); + item = next; + } +} + +/* get the decimal point character of the current locale */ +static unsigned char get_decimal_point(void) +{ +#ifdef ENABLE_LOCALES + struct lconv *lconv = localeconv(); + return (unsigned char) lconv->decimal_point[0]; +#else + return '.'; +#endif +} + +typedef struct +{ + const unsigned char *content; + size_t length; + size_t offset; + size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ + internal_hooks hooks; +} parse_buffer; + +/* check if the given size is left to read in a given parse buffer (starting with 1) */ +#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) +/* check if the buffer can be accessed at the given index (starting with 0) */ +#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) +#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) +/* get a pointer to the buffer at the position */ +#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) + +/* Parse the input text to generate a number, and populate the result into item. */ +static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) +{ + double number = 0; + unsigned char *after_end = NULL; + unsigned char number_c_string[64]; + unsigned char decimal_point = get_decimal_point(); + size_t i = 0; + + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; + } + + /* copy the number into a temporary buffer and replace '.' with the decimal point + * of the current locale (for strtod) + * This also takes care of '\0' not necessarily being available for marking the end of the input */ + for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) + { + switch (buffer_at_offset(input_buffer)[i]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '+': + case '-': + case 'e': + case 'E': + number_c_string[i] = buffer_at_offset(input_buffer)[i]; + break; + + case '.': + number_c_string[i] = decimal_point; + break; + + default: + goto loop_end; + } + } +loop_end: + number_c_string[i] = '\0'; + + number = strtod((const char*)number_c_string, (char**)&after_end); + if (number_c_string == after_end) + { + return false; /* parse_error */ + } + + item->valuedouble = number; + + /* use saturation in case of overflow */ + if (number >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)number; + } + + item->type = cJSON_Number; + + input_buffer->offset += (size_t)(after_end - number_c_string); + return true; +} + +/* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) +{ + if (number >= INT_MAX) + { + object->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + object->valueint = INT_MIN; + } + else + { + object->valueint = (int)number; + } + + return object->valuedouble = number; +} + +typedef struct +{ + unsigned char *buffer; + size_t length; + size_t offset; + size_t depth; /* current nesting depth (for formatted printing) */ + cJSON_bool noalloc; + cJSON_bool format; /* is this print a formatted print */ + internal_hooks hooks; +} printbuffer; + +/* realloc printbuffer if necessary to have at least "needed" bytes more */ +static unsigned char* ensure(printbuffer * const p, size_t needed) +{ + unsigned char *newbuffer = NULL; + size_t newsize = 0; + + if ((p == NULL) || (p->buffer == NULL)) + { + return NULL; + } + + if ((p->length > 0) && (p->offset >= p->length)) + { + /* make sure that offset is valid */ + return NULL; + } + + if (needed > INT_MAX) + { + /* sizes bigger than INT_MAX are currently not supported */ + return NULL; + } + + needed += p->offset + 1; + if (needed <= p->length) + { + return p->buffer + p->offset; + } + + if (p->noalloc) { + return NULL; + } + + /* calculate new buffer size */ + if (needed > (INT_MAX / 2)) + { + /* overflow of int, use INT_MAX if possible */ + if (needed <= INT_MAX) + { + newsize = INT_MAX; + } + else + { + return NULL; + } + } + else + { + newsize = needed * 2; + } + + if (p->hooks.reallocate != NULL) + { + /* reallocate with realloc if available */ + newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); + if (newbuffer == NULL) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + } + else + { + /* otherwise reallocate manually */ + newbuffer = (unsigned char*)p->hooks.allocate(newsize); + if (!newbuffer) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + if (newbuffer) + { + memcpy(newbuffer, p->buffer, p->offset + 1); + } + p->hooks.deallocate(p->buffer); + } + p->length = newsize; + p->buffer = newbuffer; + + return newbuffer + p->offset; +} + +/* calculate the new length of the string in a printbuffer and update the offset */ +static void update_offset(printbuffer * const buffer) +{ + const unsigned char *buffer_pointer = NULL; + if ((buffer == NULL) || (buffer->buffer == NULL)) + { + return; + } + buffer_pointer = buffer->buffer + buffer->offset; + + buffer->offset += strlen((const char*)buffer_pointer); +} + +/* Render the number nicely from the given item into a string. */ +static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + double d = item->valuedouble; + int length = 0; + size_t i = 0; + unsigned char number_buffer[26]; /* temporary buffer to print the number into */ + unsigned char decimal_point = get_decimal_point(); + double test; + + if (output_buffer == NULL) + { + return false; + } + + /* This checks for NaN and Infinity */ + if ((d * 0) != 0) + { + length = sprintf((char*)number_buffer, "null"); + } + else + { + /* Try 15 decimal places of precision to avoid insignificant nonzero digits */ + length = sprintf((char*)number_buffer, "%1.15g", d); + + /* Check whether the original double can be recovered */ + if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || ((double)test != d)) + { + /* If not, print with 17 decimal places of precision */ + length = sprintf((char*)number_buffer, "%1.17g", d); + } + } + + /* sprintf failed or buffer overrun occurred */ + if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) + { + return false; + } + + /* reserve appropriate space in the output */ + output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); + if (output_pointer == NULL) + { + return false; + } + + /* copy the printed number to the output and replace locale + * dependent decimal point with '.' */ + for (i = 0; i < ((size_t)length); i++) + { + if (number_buffer[i] == decimal_point) + { + output_pointer[i] = '.'; + continue; + } + + output_pointer[i] = number_buffer[i]; + } + output_pointer[i] = '\0'; + + output_buffer->offset += (size_t)length; + + return true; +} + +/* parse 4 digit hexadecimal number */ +static unsigned parse_hex4(const unsigned char * const input) +{ + unsigned int h = 0; + size_t i = 0; + + for (i = 0; i < 4; i++) + { + /* parse digit */ + if ((input[i] >= '0') && (input[i] <= '9')) + { + h += (unsigned int) input[i] - '0'; + } + else if ((input[i] >= 'A') && (input[i] <= 'F')) + { + h += (unsigned int) 10 + input[i] - 'A'; + } + else if ((input[i] >= 'a') && (input[i] <= 'f')) + { + h += (unsigned int) 10 + input[i] - 'a'; + } + else /* invalid */ + { + return 0; + } + + if (i < 3) + { + /* shift left to make place for the next nibble */ + h = h << 4; + } + } + + return h; +} + +/* converts a UTF-16 literal to UTF-8 + * A literal can be one or two sequences of the form \uXXXX */ +static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) +{ + long unsigned int codepoint = 0; + unsigned int first_code = 0; + const unsigned char *first_sequence = input_pointer; + unsigned char utf8_length = 0; + unsigned char utf8_position = 0; + unsigned char sequence_length = 0; + unsigned char first_byte_mark = 0; + + if ((input_end - first_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + /* get the first utf16 sequence */ + first_code = parse_hex4(first_sequence + 2); + + /* check that the code is valid */ + if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) + { + goto fail; + } + + /* UTF16 surrogate pair */ + if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) + { + const unsigned char *second_sequence = first_sequence + 6; + unsigned int second_code = 0; + sequence_length = 12; /* \uXXXX\uXXXX */ + + if ((input_end - second_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) + { + /* missing second half of the surrogate pair */ + goto fail; + } + + /* get the second utf16 sequence */ + second_code = parse_hex4(second_sequence + 2); + /* check that the code is valid */ + if ((second_code < 0xDC00) || (second_code > 0xDFFF)) + { + /* invalid second half of the surrogate pair */ + goto fail; + } + + + /* calculate the unicode codepoint from the surrogate pair */ + codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); + } + else + { + sequence_length = 6; /* \uXXXX */ + codepoint = first_code; + } + + /* encode as UTF-8 + * takes at maximum 4 bytes to encode: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (codepoint < 0x80) + { + /* normal ascii, encoding 0xxxxxxx */ + utf8_length = 1; + } + else if (codepoint < 0x800) + { + /* two bytes, encoding 110xxxxx 10xxxxxx */ + utf8_length = 2; + first_byte_mark = 0xC0; /* 11000000 */ + } + else if (codepoint < 0x10000) + { + /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ + utf8_length = 3; + first_byte_mark = 0xE0; /* 11100000 */ + } + else if (codepoint <= 0x10FFFF) + { + /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ + utf8_length = 4; + first_byte_mark = 0xF0; /* 11110000 */ + } + else + { + /* invalid unicode codepoint */ + goto fail; + } + + /* encode as utf8 */ + for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) + { + /* 10xxxxxx */ + (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); + codepoint >>= 6; + } + /* encode first byte */ + if (utf8_length > 1) + { + (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); + } + else + { + (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); + } + + *output_pointer += utf8_length; + + return sequence_length; + +fail: + return 0; +} + +/* Parse the input text into an unescaped cinput, and populate item. */ +static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) +{ + const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; + const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; + unsigned char *output_pointer = NULL; + unsigned char *output = NULL; + + /* not a string */ + if (buffer_at_offset(input_buffer)[0] != '\"') + { + goto fail; + } + + { + /* calculate approximate size of the output (overestimate) */ + size_t allocation_length = 0; + size_t skipped_bytes = 0; + while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) + { + /* is escape sequence */ + if (input_end[0] == '\\') + { + if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) + { + /* prevent buffer overflow when last input character is a backslash */ + goto fail; + } + skipped_bytes++; + input_end++; + } + input_end++; + } + if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) + { + goto fail; /* string ended unexpectedly */ + } + + /* This is at most how much we need for the output */ + allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; + output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); + if (output == NULL) + { + goto fail; /* allocation failure */ + } + } + + output_pointer = output; + /* loop through the string literal */ + while (input_pointer < input_end) + { + if (*input_pointer != '\\') + { + *output_pointer++ = *input_pointer++; + } + /* escape sequence */ + else + { + unsigned char sequence_length = 2; + if ((input_end - input_pointer) < 1) + { + goto fail; + } + + switch (input_pointer[1]) + { + case 'b': + *output_pointer++ = '\b'; + break; + case 'f': + *output_pointer++ = '\f'; + break; + case 'n': + *output_pointer++ = '\n'; + break; + case 'r': + *output_pointer++ = '\r'; + break; + case 't': + *output_pointer++ = '\t'; + break; + case '\"': + case '\\': + case '/': + *output_pointer++ = input_pointer[1]; + break; + + /* UTF-16 literal */ + case 'u': + sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); + if (sequence_length == 0) + { + /* failed to convert UTF16-literal to UTF-8 */ + goto fail; + } + break; + + default: + goto fail; + } + input_pointer += sequence_length; + } + } + + /* zero terminate the output */ + *output_pointer = '\0'; + + item->type = cJSON_String; + item->valuestring = (char*)output; + + input_buffer->offset = (size_t) (input_end - input_buffer->content); + input_buffer->offset++; + + return true; + +fail: + if (output != NULL) + { + input_buffer->hooks.deallocate(output); + } + + if (input_pointer != NULL) + { + input_buffer->offset = (size_t)(input_pointer - input_buffer->content); + } + + return false; +} + +/* Render the cstring provided to an escaped version that can be printed. */ +static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) +{ + const unsigned char *input_pointer = NULL; + unsigned char *output = NULL; + unsigned char *output_pointer = NULL; + size_t output_length = 0; + /* numbers of additional characters needed for escaping */ + size_t escape_characters = 0; + + if (output_buffer == NULL) + { + return false; + } + + /* empty string */ + if (input == NULL) + { + output = ensure(output_buffer, sizeof("\"\"")); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "\"\""); + + return true; + } + + /* set "flag" to 1 if something needs to be escaped */ + for (input_pointer = input; *input_pointer; input_pointer++) + { + switch (*input_pointer) + { + case '\"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + /* one character escape sequence */ + escape_characters++; + break; + default: + if (*input_pointer < 32) + { + /* UTF-16 escape sequence uXXXX */ + escape_characters += 5; + } + break; + } + } + output_length = (size_t)(input_pointer - input) + escape_characters; + + output = ensure(output_buffer, output_length + sizeof("\"\"")); + if (output == NULL) + { + return false; + } + + /* no characters have to be escaped */ + if (escape_characters == 0) + { + output[0] = '\"'; + memcpy(output + 1, input, output_length); + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; + } + + output[0] = '\"'; + output_pointer = output + 1; + /* copy the string */ + for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) + { + if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) + { + /* normal character, copy */ + *output_pointer = *input_pointer; + } + else + { + /* character needs to be escaped */ + *output_pointer++ = '\\'; + switch (*input_pointer) + { + case '\\': + *output_pointer = '\\'; + break; + case '\"': + *output_pointer = '\"'; + break; + case '\b': + *output_pointer = 'b'; + break; + case '\f': + *output_pointer = 'f'; + break; + case '\n': + *output_pointer = 'n'; + break; + case '\r': + *output_pointer = 'r'; + break; + case '\t': + *output_pointer = 't'; + break; + default: + /* escape and print as unicode codepoint */ + sprintf((char*)output_pointer, "u%04x", *input_pointer); + output_pointer += 4; + break; + } + } + } + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; +} + +/* Invoke print_string_ptr (which is useful) on an item. */ +static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) +{ + return print_string_ptr((unsigned char*)item->valuestring, p); +} + +/* Predeclare these prototypes. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); + +/* Utility to jump whitespace and cr/lf */ +static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL)) + { + return NULL; + } + + while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) + { + buffer->offset++; + } + + if (buffer->offset == buffer->length) + { + buffer->offset--; + } + + return buffer; +} + +/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ +static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) + { + return NULL; + } + + if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) + { + buffer->offset += 3; + } + + return buffer; +} + +/* Parse an object - create a new root, and populate. */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; + cJSON *item = NULL; + + /* reset error position */ + global_error.json = NULL; + global_error.position = 0; + + if (value == NULL) + { + goto fail; + } + + buffer.content = (const unsigned char*)value; + buffer.length = strlen((const char*)value) + sizeof(""); + buffer.offset = 0; + buffer.hooks = global_hooks; + + item = cJSON_New_Item(&global_hooks); + if (item == NULL) /* memory fail */ + { + goto fail; + } + + if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) + { + /* parse failure. ep is set. */ + goto fail; + } + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) + { + buffer_skip_whitespace(&buffer); + if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') + { + goto fail; + } + } + if (return_parse_end) + { + *return_parse_end = (const char*)buffer_at_offset(&buffer); + } + + return item; + +fail: + if (item != NULL) + { + cJSON_Delete(item); + } + + if (value != NULL) + { + error local_error; + local_error.json = (const unsigned char*)value; + local_error.position = 0; + + if (buffer.offset < buffer.length) + { + local_error.position = buffer.offset; + } + else if (buffer.length > 0) + { + local_error.position = buffer.length - 1; + } + + if (return_parse_end != NULL) + { + *return_parse_end = (const char*)local_error.json + local_error.position; + } + + global_error = local_error; + } + + return NULL; +} + +/* Default options for cJSON_Parse */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) +{ + return cJSON_ParseWithOpts(value, 0, 0); +} + +#define cjson_min(a, b) ((a < b) ? a : b) + +static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) +{ + static const size_t default_buffer_size = 256; + printbuffer buffer[1]; + unsigned char *printed = NULL; + + memset(buffer, 0, sizeof(buffer)); + + /* create buffer */ + buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); + buffer->length = default_buffer_size; + buffer->format = format; + buffer->hooks = *hooks; + if (buffer->buffer == NULL) + { + goto fail; + } + + /* print the value */ + if (!print_value(item, buffer)) + { + goto fail; + } + update_offset(buffer); + + /* check if reallocate is available */ + if (hooks->reallocate != NULL) + { + printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); + if (printed == NULL) { + goto fail; + } + buffer->buffer = NULL; + } + else /* otherwise copy the JSON over to a new buffer */ + { + printed = (unsigned char*) hooks->allocate(buffer->offset + 1); + if (printed == NULL) + { + goto fail; + } + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); + printed[buffer->offset] = '\0'; /* just to be sure */ + + /* free the buffer */ + hooks->deallocate(buffer->buffer); + } + + return printed; + +fail: + if (buffer->buffer != NULL) + { + hooks->deallocate(buffer->buffer); + } + + if (printed != NULL) + { + hooks->deallocate(printed); + } + + return NULL; +} + +/* Render a cJSON item/entity/structure to text. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) +{ + return (char*)print(item, true, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) +{ + return (char*)print(item, false, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if (prebuffer < 0) + { + return NULL; + } + + p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); + if (!p.buffer) + { + return NULL; + } + + p.length = (size_t)prebuffer; + p.offset = 0; + p.noalloc = false; + p.format = fmt; + p.hooks = global_hooks; + + if (!print_value(item, &p)) + { + global_hooks.deallocate(p.buffer); + return NULL; + } + + return (char*)p.buffer; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if ((len < 0) || (buf == NULL)) + { + return false; + } + + p.buffer = (unsigned char*)buf; + p.length = (size_t)len; + p.offset = 0; + p.noalloc = true; + p.format = fmt; + p.hooks = global_hooks; + + return print_value(item, &p); +} + +/* Parser core - when encountering text, process appropriately. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) +{ + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; /* no input */ + } + + /* parse the different types of values */ + /* null */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) + { + item->type = cJSON_NULL; + input_buffer->offset += 4; + return true; + } + /* false */ + if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) + { + item->type = cJSON_False; + input_buffer->offset += 5; + return true; + } + /* true */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) + { + item->type = cJSON_True; + item->valueint = 1; + input_buffer->offset += 4; + return true; + } + /* string */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) + { + return parse_string(item, input_buffer); + } + /* number */ + if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) + { + return parse_number(item, input_buffer); + } + /* array */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) + { + return parse_array(item, input_buffer); + } + /* object */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) + { + return parse_object(item, input_buffer); + } + + return false; +} + +/* Render a value to text. */ +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output = NULL; + + if ((item == NULL) || (output_buffer == NULL)) + { + return false; + } + + switch ((item->type) & 0xFF) + { + case cJSON_NULL: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "null"); + return true; + + case cJSON_False: + output = ensure(output_buffer, 6); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "false"); + return true; + + case cJSON_True: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "true"); + return true; + + case cJSON_Number: + return print_number(item, output_buffer); + + case cJSON_Raw: + { + size_t raw_length = 0; + if (item->valuestring == NULL) + { + return false; + } + + raw_length = strlen(item->valuestring) + sizeof(""); + output = ensure(output_buffer, raw_length); + if (output == NULL) + { + return false; + } + memcpy(output, item->valuestring, raw_length); + return true; + } + + case cJSON_String: + return print_string(item, output_buffer); + + case cJSON_Array: + return print_array(item, output_buffer); + + case cJSON_Object: + return print_object(item, output_buffer); + + default: + return false; + } +} + +/* Build an array from input text. */ +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* head of the linked list */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (buffer_at_offset(input_buffer)[0] != '[') + { + /* not an array */ + goto fail; + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) + { + /* empty array */ + goto success; + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse next value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') + { + goto fail; /* expected end of array */ + } + +success: + input_buffer->depth--; + + item->type = cJSON_Array; + item->child = head; + + input_buffer->offset++; + + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an array to text */ +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_element = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output array. */ + /* opening square bracket */ + output_pointer = ensure(output_buffer, 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer = '['; + output_buffer->offset++; + output_buffer->depth++; + + while (current_element != NULL) + { + if (!print_value(current_element, output_buffer)) + { + return false; + } + update_offset(output_buffer); + if (current_element->next) + { + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ','; + if(output_buffer->format) + { + *output_pointer++ = ' '; + } + *output_pointer = '\0'; + output_buffer->offset += length; + } + current_element = current_element->next; + } + + output_pointer = ensure(output_buffer, 2); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ']'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Build an object from the text. */ +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* linked list head */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) + { + goto fail; /* not an object */ + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) + { + goto success; /* empty object */ + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse the name of the child */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_string(current_item, input_buffer)) + { + goto fail; /* fail to parse name */ + } + buffer_skip_whitespace(input_buffer); + + /* swap valuestring and string, because we parsed the name */ + current_item->string = current_item->valuestring; + current_item->valuestring = NULL; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) + { + goto fail; /* invalid object */ + } + + /* parse the value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) + { + goto fail; /* expected end of object */ + } + +success: + input_buffer->depth--; + + item->type = cJSON_Object; + item->child = head; + + input_buffer->offset++; + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an object to text. */ +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_item = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output: */ + length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer++ = '{'; + output_buffer->depth++; + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + output_buffer->offset += length; + + while (current_item) + { + if (output_buffer->format) + { + size_t i; + output_pointer = ensure(output_buffer, output_buffer->depth); + if (output_pointer == NULL) + { + return false; + } + for (i = 0; i < output_buffer->depth; i++) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += output_buffer->depth; + } + + /* print key */ + if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ':'; + if (output_buffer->format) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += length; + + /* print value */ + if (!print_value(current_item, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + /* print comma if not last */ + length = (size_t) ((output_buffer->format ? 1 : 0) + (current_item->next ? 1 : 0)); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + if (current_item->next) + { + *output_pointer++ = ','; + } + + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + *output_pointer = '\0'; + output_buffer->offset += length; + + current_item = current_item->next; + } + + output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); + if (output_pointer == NULL) + { + return false; + } + if (output_buffer->format) + { + size_t i; + for (i = 0; i < (output_buffer->depth - 1); i++) + { + *output_pointer++ = '\t'; + } + } + *output_pointer++ = '}'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Get Array size/item / object item. */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) +{ + cJSON *child = NULL; + size_t size = 0; + + if (array == NULL) + { + return 0; + } + + child = array->child; + + while(child != NULL) + { + size++; + child = child->next; + } + + /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ + + return (int)size; +} + +static cJSON* get_array_item(const cJSON *array, size_t index) +{ + cJSON *current_child = NULL; + + if (array == NULL) + { + return NULL; + } + + current_child = array->child; + while ((current_child != NULL) && (index > 0)) + { + index--; + current_child = current_child->next; + } + + return current_child; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) +{ + if (index < 0) + { + return NULL; + } + + return get_array_item(array, (size_t)index); +} + +static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) +{ + cJSON *current_element = NULL; + + if ((object == NULL) || (name == NULL)) + { + return NULL; + } + + current_element = object->child; + if (case_sensitive) + { + while ((current_element != NULL) && (strcmp(name, current_element->string) != 0)) + { + current_element = current_element->next; + } + } + else + { + while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) + { + current_element = current_element->next; + } + } + + return current_element; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, false); +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, true); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) +{ + return cJSON_GetObjectItem(object, string) ? 1 : 0; +} + +/* Utility for array list handling. */ +static void suffix_object(cJSON *prev, cJSON *item) +{ + prev->next = item; + item->prev = prev; +} + +/* Utility for handling references. */ +static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) +{ + cJSON *reference = NULL; + if (item == NULL) + { + return NULL; + } + + reference = cJSON_New_Item(hooks); + if (reference == NULL) + { + return NULL; + } + + memcpy(reference, item, sizeof(cJSON)); + reference->string = NULL; + reference->type |= cJSON_IsReference; + reference->next = reference->prev = NULL; + return reference; +} + +static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) +{ + cJSON *child = NULL; + + if ((item == NULL) || (array == NULL)) + { + return false; + } + + child = array->child; + + if (child == NULL) + { + /* list is empty, start new one */ + array->child = item; + } + else + { + /* append to the end */ + while (child->next) + { + child = child->next; + } + suffix_object(child, item); + } + + return true; +} + +/* Add item to array/object. */ +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item) +{ + add_item_to_array(array, item); +} + +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic push +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif +/* helper function to cast away const */ +static void* cast_away_const(const void* string) +{ + return (void*)string; +} +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic pop +#endif + + +static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key) +{ + char *new_key = NULL; + int new_type = cJSON_Invalid; + + if ((object == NULL) || (string == NULL) || (item == NULL)) + { + return false; + } + + if (constant_key) + { + new_key = (char*)cast_away_const(string); + new_type = item->type | cJSON_StringIsConst; + } + else + { + new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); + if (new_key == NULL) + { + return false; + } + + new_type = item->type & ~cJSON_StringIsConst; + } + + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + hooks->deallocate(item->string); + } + + item->string = new_key; + item->type = new_type; + + return add_item_to_array(object, item); +} + +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) +{ + add_item_to_object(object, string, item, &global_hooks, false); +} + +/* Add an item to an object with constant string as key */ +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) +{ + add_item_to_object(object, string, item, &global_hooks, true); +} + +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) +{ + if (array == NULL) + { + return; + } + + add_item_to_array(array, create_reference(item, &global_hooks)); +} + +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) +{ + if ((object == NULL) || (string == NULL)) + { + return; + } + + add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); +} + +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name) +{ + cJSON *null = cJSON_CreateNull(); + if (add_item_to_object(object, name, null, &global_hooks, false)) + { + return null; + } + + cJSON_Delete(null); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name) +{ + cJSON *true_item = cJSON_CreateTrue(); + if (add_item_to_object(object, name, true_item, &global_hooks, false)) + { + return true_item; + } + + cJSON_Delete(true_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name) +{ + cJSON *false_item = cJSON_CreateFalse(); + if (add_item_to_object(object, name, false_item, &global_hooks, false)) + { + return false_item; + } + + cJSON_Delete(false_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean) +{ + cJSON *bool_item = cJSON_CreateBool(boolean); + if (add_item_to_object(object, name, bool_item, &global_hooks, false)) + { + return bool_item; + } + + cJSON_Delete(bool_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) +{ + cJSON *number_item = cJSON_CreateNumber(number); + if (add_item_to_object(object, name, number_item, &global_hooks, false)) + { + return number_item; + } + + cJSON_Delete(number_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) +{ + cJSON *string_item = cJSON_CreateString(string); + if (add_item_to_object(object, name, string_item, &global_hooks, false)) + { + return string_item; + } + + cJSON_Delete(string_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw) +{ + cJSON *raw_item = cJSON_CreateRaw(raw); + if (add_item_to_object(object, name, raw_item, &global_hooks, false)) + { + return raw_item; + } + + cJSON_Delete(raw_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name) +{ + cJSON *object_item = cJSON_CreateObject(); + if (add_item_to_object(object, name, object_item, &global_hooks, false)) + { + return object_item; + } + + cJSON_Delete(object_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name) +{ + cJSON *array = cJSON_CreateArray(); + if (add_item_to_object(object, name, array, &global_hooks, false)) + { + return array; + } + + cJSON_Delete(array); + return NULL; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) +{ + if ((parent == NULL) || (item == NULL)) + { + return NULL; + } + + if (item->prev != NULL) + { + /* not the first element */ + item->prev->next = item->next; + } + if (item->next != NULL) + { + /* not the last element */ + item->next->prev = item->prev; + } + + if (item == parent->child) + { + /* first element */ + parent->child = item->next; + } + /* make sure the detached item doesn't point anywhere anymore */ + item->prev = NULL; + item->next = NULL; + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) +{ + if (which < 0) + { + return NULL; + } + + return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) +{ + cJSON_Delete(cJSON_DetachItemFromArray(array, which)); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItem(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObject(object, string)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); +} + +/* Replace array/object items with new ones. */ +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) +{ + cJSON *after_inserted = NULL; + + if (which < 0) + { + return; + } + + after_inserted = get_array_item(array, (size_t)which); + if (after_inserted == NULL) + { + add_item_to_array(array, newitem); + return; + } + + newitem->next = after_inserted; + newitem->prev = after_inserted->prev; + after_inserted->prev = newitem; + if (after_inserted == array->child) + { + array->child = newitem; + } + else + { + newitem->prev->next = newitem; + } +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) +{ + if ((parent == NULL) || (replacement == NULL) || (item == NULL)) + { + return false; + } + + if (replacement == item) + { + return true; + } + + replacement->next = item->next; + replacement->prev = item->prev; + + if (replacement->next != NULL) + { + replacement->next->prev = replacement; + } + if (replacement->prev != NULL) + { + replacement->prev->next = replacement; + } + if (parent->child == item) + { + parent->child = replacement; + } + + item->next = NULL; + item->prev = NULL; + cJSON_Delete(item); + + return true; +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) +{ + if (which < 0) + { + return; + } + + cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); +} + +static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) +{ + if ((replacement == NULL) || (string == NULL)) + { + return false; + } + + /* replace the name in the replacement */ + if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) + { + cJSON_free(replacement->string); + } + replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + replacement->type &= ~cJSON_StringIsConst; + + cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); + + return true; +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) +{ + replace_item_in_object(object, string, newitem, false); +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) +{ + replace_item_in_object(object, string, newitem, true); +} + +/* Create basic types: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_NULL; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_True; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool b) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = b ? cJSON_True : cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Number; + item->valuedouble = num; + + /* use saturation in case of overflow */ + if (num >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (num <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)num; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_String; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) + { + item->type = cJSON_String | cJSON_IsReference; + item->valuestring = (char*)cast_away_const(string); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Object | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) { + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Array | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Raw; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type=cJSON_Array; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item) + { + item->type = cJSON_Object; + } + + return item; +} + +/* Create Arrays: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if (!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber((double)numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0;a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (strings == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for (i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateString(strings[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p,n); + } + p = n; + } + + return a; +} + +/* Duplication */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) +{ + cJSON *newitem = NULL; + cJSON *child = NULL; + cJSON *next = NULL; + cJSON *newchild = NULL; + + /* Bail on bad ptr */ + if (!item) + { + goto fail; + } + /* Create new item */ + newitem = cJSON_New_Item(&global_hooks); + if (!newitem) + { + goto fail; + } + /* Copy over all vars */ + newitem->type = item->type & (~cJSON_IsReference); + newitem->valueint = item->valueint; + newitem->valuedouble = item->valuedouble; + if (item->valuestring) + { + newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); + if (!newitem->valuestring) + { + goto fail; + } + } + if (item->string) + { + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); + if (!newitem->string) + { + goto fail; + } + } + /* If non-recursive, then we're done! */ + if (!recurse) + { + return newitem; + } + /* Walk the ->next chain for the child. */ + child = item->child; + while (child != NULL) + { + newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) + { + goto fail; + } + if (next != NULL) + { + /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + next->next = newchild; + newchild->prev = next; + next = newchild; + } + else + { + /* Set newitem->child and move to it */ + newitem->child = newchild; + next = newchild; + } + child = child->next; + } + + return newitem; + +fail: + if (newitem != NULL) + { + cJSON_Delete(newitem); + } + + return NULL; +} + +CJSON_PUBLIC(void) cJSON_Minify(char *json) +{ + unsigned char *into = (unsigned char*)json; + + if (json == NULL) + { + return; + } + + while (*json) + { + if (*json == ' ') + { + json++; + } + else if (*json == '\t') + { + /* Whitespace characters. */ + json++; + } + else if (*json == '\r') + { + json++; + } + else if (*json=='\n') + { + json++; + } + else if ((*json == '/') && (json[1] == '/')) + { + /* double-slash comments, to end of line. */ + while (*json && (*json != '\n')) + { + json++; + } + } + else if ((*json == '/') && (json[1] == '*')) + { + /* multiline comments. */ + while (*json && !((*json == '*') && (json[1] == '/'))) + { + json++; + } + json += 2; + } + else if (*json == '\"') + { + /* string literals, which are \" sensitive. */ + *into++ = (unsigned char)*json++; + while (*json && (*json != '\"')) + { + if (*json == '\\') + { + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + else + { + /* All other characters. */ + *into++ = (unsigned char)*json++; + } + } + + /* and null-terminate. */ + *into = '\0'; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Invalid; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_False; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xff) == cJSON_True; +} + + +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & (cJSON_True | cJSON_False)) != 0; +} +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_NULL; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Number; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_String; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Array; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Object; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Raw; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) +{ + if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)) || cJSON_IsInvalid(a)) + { + return false; + } + + /* check if type is valid */ + switch (a->type & 0xFF) + { + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + case cJSON_Number: + case cJSON_String: + case cJSON_Raw: + case cJSON_Array: + case cJSON_Object: + break; + + default: + return false; + } + + /* identical objects are equal */ + if (a == b) + { + return true; + } + + switch (a->type & 0xFF) + { + /* in these cases and equal type is enough */ + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + return true; + + case cJSON_Number: + if (a->valuedouble == b->valuedouble) + { + return true; + } + return false; + + case cJSON_String: + case cJSON_Raw: + if ((a->valuestring == NULL) || (b->valuestring == NULL)) + { + return false; + } + if (strcmp(a->valuestring, b->valuestring) == 0) + { + return true; + } + + return false; + + case cJSON_Array: + { + cJSON *a_element = a->child; + cJSON *b_element = b->child; + + for (; (a_element != NULL) && (b_element != NULL);) + { + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + + a_element = a_element->next; + b_element = b_element->next; + } + + /* one of the arrays is longer than the other */ + if (a_element != b_element) { + return false; + } + + return true; + } + + case cJSON_Object: + { + cJSON *a_element = NULL; + cJSON *b_element = NULL; + cJSON_ArrayForEach(a_element, a) + { + /* TODO This has O(n^2) runtime, which is horrible! */ + b_element = get_object_item(b, a_element->string, case_sensitive); + if (b_element == NULL) + { + return false; + } + + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + } + + /* doing this twice, once on a and b to prevent true comparison if a subset of b + * TODO: Do this the proper way, this is just a fix for now */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); + if (a_element == NULL) + { + return false; + } + + if (!cJSON_Compare(b_element, a_element, case_sensitive)) + { + return false; + } + } + + return true; + } + + default: + return false; + } +} + +CJSON_PUBLIC(void *) cJSON_malloc(size_t size) +{ + return global_hooks.allocate(size); +} + +CJSON_PUBLIC(void) cJSON_free(void *object) +{ + global_hooks.deallocate(object); +} diff --git a/samples/client/others/c/bearerAuth/external/cJSON.h b/samples/client/others/c/bearerAuth/external/cJSON.h new file mode 100644 index 000000000000..ab0d0fbaced7 --- /dev/null +++ b/samples/client/others/c/bearerAuth/external/cJSON.h @@ -0,0 +1,277 @@ +/* + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef cJSON__h +#define cJSON__h + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* project version */ +#define CJSON_VERSION_MAJOR 1 +#define CJSON_VERSION_MINOR 7 +#define CJSON_VERSION_PATCH 7 + +#include + +/* cJSON Types: */ +#define cJSON_Invalid (0) +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) +#define cJSON_Number (1 << 3) +#define cJSON_String (1 << 4) +#define cJSON_Array (1 << 5) +#define cJSON_Object (1 << 6) +#define cJSON_Raw (1 << 7) /* raw json */ + +#define cJSON_IsReference 256 +#define cJSON_StringIsConst 512 + +/* The cJSON structure: */ +typedef struct cJSON +{ + /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *next; + struct cJSON *prev; + /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + struct cJSON *child; + + /* The type of the item, as above. */ + int type; + + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + /* The item's number, if type==cJSON_Number */ + double valuedouble; + + /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + char *string; +} cJSON; + +typedef struct cJSON_Hooks +{ + void *(*malloc_fn)(size_t sz); + void (*free_fn)(void *ptr); +} cJSON_Hooks; + +typedef int cJSON_bool; + +#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) +#define __WINDOWS__ +#endif +#ifdef __WINDOWS__ + +/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options: + +CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols +CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) +CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol + +For *nix builds that support visibility attribute, you can define similar behavior by + +setting default visibility to hidden by adding +-fvisibility=hidden (for gcc) +or +-xldscope=hidden (for sun cc) +to CFLAGS + +then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does + +*/ + +/* export symbols by default, this is necessary for copy pasting the C and header file */ +#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) +#define CJSON_EXPORT_SYMBOLS +#endif + +#if defined(CJSON_HIDE_SYMBOLS) +#define CJSON_PUBLIC(type) type __stdcall +#elif defined(CJSON_EXPORT_SYMBOLS) +#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall +#elif defined(CJSON_IMPORT_SYMBOLS) +#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall +#endif +#else /* !WIN32 */ +#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) +#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type +#else +#define CJSON_PUBLIC(type) type +#endif +#endif + +/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them. + * This is to prevent stack overflows. */ +#ifndef CJSON_NESTING_LIMIT +#define CJSON_NESTING_LIMIT 1000 +#endif + +/* returns the version of cJSON as a string */ +CJSON_PUBLIC(const char*) cJSON_Version(void); + +/* Supply malloc, realloc and free functions to cJSON */ +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); + +/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ +/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); +/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ +/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); + +/* Render a cJSON entity to text for transfer/storage. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); +/* Render a cJSON entity to text for transfer/storage without any formatting. */ +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); +/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); +/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ +/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); +/* Delete a cJSON entity and all subentities. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *c); + +/* Returns the number of items in an array (or object). */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); +/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); +/* Get item "string" from object. Case insensitive. */ +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); +/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); + +/* Check if the item is a string and return its valuestring */ +CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item); + +/* These functions check the type of an item */ +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item); + +/* These calls create a cJSON item of the appropriate type. */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); +/* raw json */ +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); + +/* Create a string where valuestring references a string so + * it will not be freed by cJSON_Delete */ +CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); +/* Create an object/array that only references it's elements so + * they will not be freed by cJSON_Delete */ +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); + +/* These utilities create an Array of count items. */ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count); + +/* Append item to the specified array/object. */ +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); +/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. + * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before + * writing to `item->string` */ +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); +/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); + +/* Remove/Detach items from Arrays/Objects. */ +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); + +/* Update array items. */ +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); + +/* Duplicate a cJSON item */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); +/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will +need to be released. With recurse!=0, it will duplicate any children connected to the item. +The item->next and ->prev pointers are always zero on return from Duplicate. */ +/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. + * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); + + +CJSON_PUBLIC(void) cJSON_Minify(char *json); + +/* Helper functions for creating and adding items to an object at the same time. + * They return the added item or NULL on failure. */ +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); + +/* When assigning an integer value, it needs to be propagated to valuedouble too. */ +#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) +/* helper for the cJSON_SetNumberValue macro */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) + +/* Macro for iterating over an array or object */ +#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) + +/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ +CJSON_PUBLIC(void *) cJSON_malloc(size_t size); +CJSON_PUBLIC(void) cJSON_free(void *object); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/samples/client/others/c/bearerAuth/external/cJSON.licence b/samples/client/others/c/bearerAuth/external/cJSON.licence new file mode 100644 index 000000000000..47234478c110 --- /dev/null +++ b/samples/client/others/c/bearerAuth/external/cJSON.licence @@ -0,0 +1,19 @@ +Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/samples/client/others/c/bearerAuth/include/apiClient.h b/samples/client/others/c/bearerAuth/include/apiClient.h new file mode 100644 index 000000000000..0b2fd51148cf --- /dev/null +++ b/samples/client/others/c/bearerAuth/include/apiClient.h @@ -0,0 +1,62 @@ +#ifndef INCLUDE_API_CLIENT_H +#define INCLUDE_API_CLIENT_H + +#include +#include +#include +#include +#include +#include +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct sslConfig_t { + char *clientCertFile; /* client certificate */ + char *clientKeyFile; /* client private key */ + char *CACertFile; /* CA certificate */ + int insecureSkipTlsVerify ; /* 0 -- verify server certificate */ + /* 1 -- skip ssl verify for server certificate */ +} sslConfig_t; + +typedef struct apiClient_t { + char *basePath; + sslConfig_t *sslConfig; + void *dataReceived; + long dataReceivedLen; + void (*data_callback_func)(void **, long *); + int (*progress_func)(void *, curl_off_t, curl_off_t, curl_off_t, curl_off_t); + void *progress_data; + long response_code; + char *accessToken; +} apiClient_t; + +apiClient_t* apiClient_create(); + +apiClient_t* apiClient_create_with_base_path(const char *basePath +, sslConfig_t *sslConfig +); + +void apiClient_free(apiClient_t *apiClient); + +void apiClient_invoke(apiClient_t *apiClient,const char* operationParameter, list_t *queryParameters, list_t *headerParameters, list_t *formParameters,list_t *headerType,list_t *contentType, const char *bodyParameters, const char *requestType); + +sslConfig_t *sslConfig_create(const char *clientCertFile, const char *clientKeyFile, const char *CACertFile, int insecureSkipTlsVerify); + +void sslConfig_free(sslConfig_t *sslConfig); + +char *strReplace(char *orig, char *rep, char *with); + +/* + * In single thread program, the function apiClient_setupGlobalEnv is not needed. + * But in multi-thread program, apiClient_setupGlobalEnv must be called before any worker thread is created + */ +void apiClient_setupGlobalEnv(); + +/* + * This function apiClient_unsetupGlobalEnv must be called whether single or multiple program. + * In multi-thread program, it is must be called after all worker threads end. + */ +void apiClient_unsetupGlobalEnv(); + +#endif // INCLUDE_API_CLIENT_H diff --git a/samples/client/others/c/bearerAuth/include/binary.h b/samples/client/others/c/bearerAuth/include/binary.h new file mode 100644 index 000000000000..571df5b35fba --- /dev/null +++ b/samples/client/others/c/bearerAuth/include/binary.h @@ -0,0 +1,18 @@ +#ifndef INCLUDE_BINARY_H +#define INCLUDE_BINARY_H + +#include + +typedef struct binary_t +{ + uint8_t* data; + unsigned int len; +} binary_t; + +binary_t* instantiate_binary_t(char* data, int len); + +char *base64encode(const void *b64_encode_this, int encode_this_many_bytes); + +char *base64decode(const void *b64_decode_this, int decode_this_many_bytes, int *decoded_bytes); + +#endif // INCLUDE_BINARY_H diff --git a/samples/client/others/c/bearerAuth/include/keyValuePair.h b/samples/client/others/c/bearerAuth/include/keyValuePair.h new file mode 100644 index 000000000000..cb839f29cdcf --- /dev/null +++ b/samples/client/others/c/bearerAuth/include/keyValuePair.h @@ -0,0 +1,17 @@ +#ifndef _keyValuePair_H_ +#define _keyValuePair_H_ + +#include + +typedef struct keyValuePair_t { + char* key; + void* value; +} keyValuePair_t; + +keyValuePair_t *keyValuePair_create(char *key, void *value); + +keyValuePair_t* keyValuePair_create_allocate(char* key, double value); + +void keyValuePair_free(keyValuePair_t *keyValuePair); + +#endif /* _keyValuePair_H_ */ \ No newline at end of file diff --git a/samples/client/others/c/bearerAuth/include/list.h b/samples/client/others/c/bearerAuth/include/list.h new file mode 100644 index 000000000000..96384d049b3e --- /dev/null +++ b/samples/client/others/c/bearerAuth/include/list.h @@ -0,0 +1,42 @@ +#ifndef INCLUDE_LIST_H +#define INCLUDE_LIST_H + +#include "../external/cJSON.h" +#include "../include/list.h" + +typedef struct list_t list_t; + +typedef struct listEntry_t listEntry_t; + +struct listEntry_t { + listEntry_t* nextListEntry; + listEntry_t* prevListEntry; + void* data; +}; + +typedef struct list_t { + listEntry_t *firstEntry; + listEntry_t *lastEntry; + + long count; +} list_t; + +#define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) + +list_t* list_createList(); +void list_freeList(list_t* listToFree); + +void list_addElement(list_t* list, void* dataToAddInList); +listEntry_t* list_getElementAt(list_t *list, long indexOfElement); +listEntry_t* list_getWithIndex(list_t* list, int index); +void list_removeElement(list_t* list, listEntry_t* elementToRemove); + +void list_iterateThroughListForward(list_t* list, void (*operationToPerform)(listEntry_t*, void*), void *additionalDataNeededForCallbackFunction); +void list_iterateThroughListBackward(list_t* list, void (*operationToPerform)(listEntry_t*, void*), void *additionalDataNeededForCallbackFunction); + +void listEntry_printAsInt(listEntry_t* listEntry, void *additionalData); +void listEntry_free(listEntry_t *listEntry, void *additionalData); + +char* findStrInStrList(list_t* strList, const char* str); +void clear_and_free_string_list(list_t * list); +#endif // INCLUDE_LIST_H diff --git a/samples/client/others/c/bearerAuth/libcurl.licence b/samples/client/others/c/bearerAuth/libcurl.licence new file mode 100644 index 000000000000..b5f47ac94dee --- /dev/null +++ b/samples/client/others/c/bearerAuth/libcurl.licence @@ -0,0 +1,11 @@ +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2018, Daniel Stenberg, daniel@haxx.se, and many contributors, see the THANKS file. + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. diff --git a/samples/client/others/c/bearerAuth/model/any_type.h b/samples/client/others/c/bearerAuth/model/any_type.h new file mode 100644 index 000000000000..7bdc92487f5b --- /dev/null +++ b/samples/client/others/c/bearerAuth/model/any_type.h @@ -0,0 +1,5 @@ +/* + * any_type.h + * + * A placeholder for now, this type isn't really needed. + */ diff --git a/samples/client/others/c/bearerAuth/model/object.c b/samples/client/others/c/bearerAuth/model/object.c new file mode 100644 index 000000000000..ff293bcdac85 --- /dev/null +++ b/samples/client/others/c/bearerAuth/model/object.c @@ -0,0 +1,51 @@ +#include +#include +#include +#include "object.h" + +object_t *object_create() { + object_t *object = calloc(1, sizeof(object_t)); + + return object; +} + +void object_free(object_t *object) { + if (!object) { + return ; + } + + if (object->temporary) { + free(object->temporary); + object->temporary = NULL; + } + + free (object); +} + +cJSON *object_convertToJSON(object_t *object) { + if (!object) { + return NULL; + } + + if (!object->temporary) { + return cJSON_Parse("null"); + } + + return cJSON_Parse(object->temporary); +} + +object_t *object_parseFromJSON(cJSON *json){ + if (!json) { + goto end; + } + + object_t *object = object_create(); + if (!object) { + goto end; + } + object->temporary = cJSON_Print(json); + return object; + +end: + return NULL; +} diff --git a/samples/client/others/c/bearerAuth/model/object.h b/samples/client/others/c/bearerAuth/model/object.h new file mode 100644 index 000000000000..35bfeb60fd13 --- /dev/null +++ b/samples/client/others/c/bearerAuth/model/object.h @@ -0,0 +1,27 @@ +/* + * object.h + */ + +#ifndef _object_H_ +#define _object_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + + +typedef struct object_t { + void *temporary; +} object_t; + +object_t *object_create(); + +void object_free(object_t *object); + +object_t *object_parseFromJSON(cJSON *json); + +cJSON *object_convertToJSON(object_t *object); + +#endif /* _object_H_ */ diff --git a/samples/client/others/c/bearerAuth/src/apiClient.c b/samples/client/others/c/bearerAuth/src/apiClient.c new file mode 100644 index 000000000000..a40112255f92 --- /dev/null +++ b/samples/client/others/c/bearerAuth/src/apiClient.c @@ -0,0 +1,509 @@ +#include +#include +#include +#include +#include "../include/apiClient.h" + +size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp); + +apiClient_t *apiClient_create() { + apiClient_t *apiClient = malloc(sizeof(apiClient_t)); + apiClient->basePath = strdup("http://api.example.com/v1"); + apiClient->sslConfig = NULL; + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + apiClient->data_callback_func = NULL; + apiClient->progress_func = NULL; + apiClient->progress_data = NULL; + apiClient->response_code = 0; + apiClient->accessToken = NULL; + + return apiClient; +} + +apiClient_t *apiClient_create_with_base_path(const char *basePath +, sslConfig_t *sslConfig +) { + apiClient_t *apiClient = malloc(sizeof(apiClient_t)); + if(basePath){ + apiClient->basePath = strdup(basePath); + }else{ + apiClient->basePath = strdup("http://api.example.com/v1"); + } + + if(sslConfig){ + apiClient->sslConfig = sslConfig; + }else{ + apiClient->sslConfig = NULL; + } + + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + apiClient->data_callback_func = NULL; + apiClient->progress_func = NULL; + apiClient->progress_data = NULL; + apiClient->response_code = 0; + apiClient->accessToken = NULL; + + return apiClient; +} + +void apiClient_free(apiClient_t *apiClient) { + if(apiClient->basePath) { + free(apiClient->basePath); + } + apiClient->data_callback_func = NULL; + apiClient->progress_func = NULL; + apiClient->progress_data = NULL; + if(apiClient->accessToken) { + free(apiClient->accessToken); + } + free(apiClient); +} + +sslConfig_t *sslConfig_create(const char *clientCertFile, const char *clientKeyFile, const char *CACertFile, int insecureSkipTlsVerify) { + sslConfig_t *sslConfig = calloc(1, sizeof(sslConfig_t)); + if ( clientCertFile ) { + sslConfig->clientCertFile = strdup(clientCertFile); + } + if ( clientKeyFile ) { + sslConfig->clientKeyFile = strdup(clientKeyFile); + } + if ( CACertFile ) { + sslConfig->CACertFile = strdup(CACertFile); + } + sslConfig->insecureSkipTlsVerify = insecureSkipTlsVerify; + return sslConfig; +} + +void sslConfig_free(sslConfig_t *sslConfig) { + if ( sslConfig->clientCertFile ) { + free(sslConfig->clientCertFile); + } + if ( sslConfig->clientKeyFile ) { + free(sslConfig->clientKeyFile); + } + if ( sslConfig->CACertFile ){ + free(sslConfig->CACertFile); + } + free(sslConfig); +} + +void replaceSpaceWithPlus(char *stringToProcess) { + for(int i = 0; i < strlen(stringToProcess); i++) { + if(stringToProcess[i] == ' ') { + stringToProcess[i] = '+'; + } + } +} + +char *assembleTargetUrl(const char *basePath, + const char *operationParameter, + list_t *queryParameters) { + int neededBufferSizeForQueryParameters = 0; + listEntry_t *listEntry; + + if(queryParameters != NULL) { + list_ForEach(listEntry, queryParameters) { + keyValuePair_t *pair = listEntry->data; + neededBufferSizeForQueryParameters += + strlen(pair->key) + strlen(pair->value); + } + + neededBufferSizeForQueryParameters += + (queryParameters->count * 2); // each keyValuePair is separated by a = and a & except the last, but this makes up for the ? at the beginning + } + + int operationParameterLength = 0; + int basePathLength = strlen(basePath); + + if(operationParameter != NULL) { + operationParameterLength = (1 + strlen(operationParameter)); + } + + char *targetUrl = + malloc( + neededBufferSizeForQueryParameters + basePathLength + operationParameterLength + + 1); + + strcpy(targetUrl, basePath); + + if(operationParameter != NULL) { + strcat(targetUrl, operationParameter); + } + + if(queryParameters != NULL) { + strcat(targetUrl, "?"); + list_ForEach(listEntry, queryParameters) { + keyValuePair_t *pair = listEntry->data; + replaceSpaceWithPlus(pair->key); + strcat(targetUrl, pair->key); + strcat(targetUrl, "="); + replaceSpaceWithPlus(pair->value); + strcat(targetUrl, pair->value); + if(listEntry->nextListEntry != NULL) { + strcat(targetUrl, "&"); + } + } + } + + return targetUrl; +} + +char *assembleHeaderField(char *key, char *value) { + char *header = malloc(strlen(key) + strlen(value) + 3); + + strcpy(header, key), + strcat(header, ": "); + strcat(header, value); + + return header; +} + +void postData(CURL *handle, const char *bodyParameters) { + curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters); + curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE, + (curl_off_t)strlen(bodyParameters)); +} + +int lengthOfKeyPair(keyValuePair_t *keyPair) { + long length = 0; + if((keyPair->key != NULL) && + (keyPair->value != NULL) ) + { + length = strlen(keyPair->key) + strlen(keyPair->value); + return length; + } + return 0; +} + + +void apiClient_invoke(apiClient_t *apiClient, + const char *operationParameter, + list_t *queryParameters, + list_t *headerParameters, + list_t *formParameters, + list_t *headerType, + list_t *contentType, + const char *bodyParameters, + const char *requestType) { + CURL *handle = curl_easy_init(); + CURLcode res; + + if(handle) { + listEntry_t *listEntry; + curl_mime *mime = NULL; + struct curl_slist *headers = NULL; + char *buffContent = NULL; + char *buffHeader = NULL; + binary_t *fileVar = NULL; + char *formString = NULL; + + if(headerType != NULL) { + list_ForEach(listEntry, headerType) { + if(strstr((char *) listEntry->data, + "xml") == NULL) + { + buffHeader = malloc(strlen( + "Accept: ") + + strlen((char *) + listEntry-> + data) + 1); + sprintf(buffHeader, "%s%s", "Accept: ", + (char *) listEntry->data); + headers = curl_slist_append(headers, + buffHeader); + free(buffHeader); + } + } + } + if(contentType != NULL) { + list_ForEach(listEntry, contentType) { + if(strstr((char *) listEntry->data, + "xml") == NULL) + { + buffContent = + malloc(strlen( + "Content-Type: ") + strlen( + (char *) + listEntry->data) + + 1); + sprintf(buffContent, "%s%s", + "Content-Type: ", + (char *) listEntry->data); + headers = curl_slist_append(headers, + buffContent); + free(buffContent); + buffContent = NULL; + } + } + } else { + headers = curl_slist_append(headers, + "Content-Type: application/json"); + } + + if(requestType != NULL) { + curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, + requestType); + } + + if(formParameters != NULL) { + if(contentType && + findStrInStrList(contentType, "application/x-www-form-urlencoded") != NULL) + { + long parameterLength = 0; + long keyPairLength = 0; + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyPair = + listEntry->data; + + keyPairLength = + lengthOfKeyPair(keyPair) + 1; + + if(listEntry->nextListEntry != NULL) { + parameterLength++; + } + parameterLength = parameterLength + + keyPairLength; + } + + formString = malloc(parameterLength + 1); + memset(formString, 0, parameterLength + 1); + + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyPair = + listEntry->data; + if((keyPair->key != NULL) && + (keyPair->value != NULL) ) + { + strcat(formString, + keyPair->key); + strcat(formString, "="); + strcat(formString, + keyPair->value); + if(listEntry->nextListEntry != + NULL) + { + strcat(formString, "&"); + } + } + } + curl_easy_setopt(handle, CURLOPT_POSTFIELDS, + formString); + } + if(contentType && + findStrInStrList(contentType, "multipart/form-data") != NULL) { + mime = curl_mime_init(handle); + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyValuePair = + listEntry->data; + + if((keyValuePair->key != NULL) && + (keyValuePair->value != NULL) ) + { + curl_mimepart *part = + curl_mime_addpart(mime); + + curl_mime_name(part, + keyValuePair->key); + + + if(strcmp(keyValuePair->key, + "file") == 0) + { + memcpy(&fileVar, + keyValuePair->value, + sizeof(fileVar)); + curl_mime_data(part, + fileVar->data, + fileVar->len); + curl_mime_filename(part, + "image.png"); + } else { + curl_mime_data(part, + keyValuePair->value, + CURL_ZERO_TERMINATED); + } + } + } + curl_easy_setopt(handle, CURLOPT_MIMEPOST, + mime); + } + } + + list_ForEach(listEntry, headerParameters) { + keyValuePair_t *keyValuePair = listEntry->data; + if((keyValuePair->key != NULL) && + (keyValuePair->value != NULL) ) + { + char *headerValueToWrite = assembleHeaderField( + keyValuePair->key, keyValuePair->value); + curl_slist_append(headers, headerValueToWrite); + free(headerValueToWrite); + } + } + + if ( strstr(apiClient->basePath, "https") != NULL ) { + if ( apiClient->sslConfig ) { + if( apiClient->sslConfig->clientCertFile ) { + curl_easy_setopt(handle, CURLOPT_SSLCERT, apiClient->sslConfig->clientCertFile); + } + if( apiClient->sslConfig->clientKeyFile ) { + curl_easy_setopt(handle, CURLOPT_SSLKEY, apiClient->sslConfig->clientKeyFile); + } + if( apiClient->sslConfig->CACertFile ) { + curl_easy_setopt(handle, CURLOPT_CAINFO, apiClient->sslConfig->CACertFile); + } + if ( 1 == apiClient->sslConfig->insecureSkipTlsVerify ) { + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L); + } else { + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L); + } + } else { + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L); + } + } + + if (apiClient->progress_func != NULL) { + curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION, apiClient->progress_func); + if (apiClient->progress_data != NULL) { + curl_easy_setopt(handle, CURLOPT_XFERINFODATA, apiClient->progress_data); + } + curl_easy_setopt(handle, CURLOPT_NOPROGRESS, 0L); + } + + // this would only be generated for bearer token authentication + if(apiClient->accessToken != NULL) + { + int authHeaderSize; + char *authHeader = NULL; + + authHeaderSize = snprintf(NULL, 0, "Authorization: Bearer %s", apiClient->accessToken) + 1; + authHeader = malloc(authHeaderSize); + snprintf(authHeader, authHeaderSize, "Authorization: Bearer %s", apiClient->accessToken); + headers = curl_slist_append(headers, authHeader); + free(authHeader); + } + + char *targetUrl = + assembleTargetUrl(apiClient->basePath, + operationParameter, + queryParameters); + + curl_easy_setopt(handle, CURLOPT_URL, targetUrl); + curl_easy_setopt(handle, + CURLOPT_WRITEFUNCTION, + writeDataCallback); + curl_easy_setopt(handle, + CURLOPT_WRITEDATA, + apiClient); + curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable + + + if(bodyParameters != NULL) { + postData(handle, bodyParameters); + } + + res = curl_easy_perform(handle); + + curl_slist_free_all(headers); + + free(targetUrl); + + if(res == CURLE_OK) { + curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &apiClient->response_code); + } else { + char *url,*ip,*scheme; + long port; + curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url); + curl_easy_getinfo(handle, CURLINFO_PRIMARY_IP, &ip); + curl_easy_getinfo(handle, CURLINFO_PRIMARY_PORT, &port); + curl_easy_getinfo(handle, CURLINFO_SCHEME, &scheme); + fprintf(stderr, "curl_easy_perform() failed\n\nURL: %s\nIP: %s\nPORT: %li\nSCHEME: %s\nStrERROR: %s\n",url,ip,port,scheme, + curl_easy_strerror(res)); + } + + curl_easy_cleanup(handle); + if(formParameters != NULL) { + free(formString); + curl_mime_free(mime); + } + } +} + +size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { + size_t size_this_time = nmemb * size; + apiClient_t *apiClient = (apiClient_t *)userp; + apiClient->dataReceived = (char *)realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1); + memcpy((char *)apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); + apiClient->dataReceivedLen += size_this_time; + ((char*)apiClient->dataReceived)[apiClient->dataReceivedLen] = '\0'; // the space size of (apiClient->dataReceived) = dataReceivedLen + 1 + if (apiClient->data_callback_func) { + apiClient->data_callback_func(&apiClient->dataReceived, &apiClient->dataReceivedLen); + } + return size_this_time; +} + +char *strReplace(char *orig, char *rep, char *with) { + char *result; // the return string + char *ins; // the next insert point + char *tmp; // varies + int lenRep; // length of rep (the string to remove) + int lenWith; // length of with (the string to replace rep with) + int lenFront; // distance between rep and end of last rep + int count; // number of replacements + + // sanity checks and initialization + if(!orig || !rep) + { + return NULL; + } + lenRep = strlen(rep); + if(lenRep == 0) { + return NULL; // empty rep causes infinite loop during count + } + if(!with) { + with = ""; + } + lenWith = strlen(with); + + // count the number of replacements needed + ins = orig; + for(count = 0; tmp = strstr(ins, rep); ++count) { + ins = tmp + lenRep; + } + + tmp = result = malloc(strlen(orig) + (lenWith - lenRep) * count + 1); + + if(!result) { + return NULL; + } + char *originalPointer = orig; // copying original pointer to free the memory + // first time through the loop, all the variable are set correctly + // from here on, + // tmp points to the end of the result string + // ins points to the next occurrence of rep in orig + // orig points to the remainder of orig after "end of rep" + while(count--) { + ins = strstr(orig, rep); + lenFront = ins - orig; + tmp = strncpy(tmp, orig, lenFront) + lenFront; + tmp = strcpy(tmp, with) + lenWith; + orig += lenFront + lenRep; // move to next "end of rep" + } + strcpy(tmp, orig); + free(originalPointer); + return result; +} + +void apiClient_setupGlobalEnv() { + curl_global_init(CURL_GLOBAL_ALL); +} + +void apiClient_unsetupGlobalEnv() { + curl_global_cleanup(); +} diff --git a/samples/client/others/c/bearerAuth/src/apiKey.c b/samples/client/others/c/bearerAuth/src/apiKey.c new file mode 100644 index 000000000000..c65d91c8e9f9 --- /dev/null +++ b/samples/client/others/c/bearerAuth/src/apiKey.c @@ -0,0 +1,20 @@ +#include +#include +#include "../include/keyValuePair.h" + +keyValuePair_t *keyValuePair_create(char *key, void *value) { + keyValuePair_t *keyValuePair = malloc(sizeof(keyValuePair_t)); + keyValuePair->key = key; + keyValuePair->value = value; + return keyValuePair; +} + +keyValuePair_t* keyValuePair_create_allocate(char* key, double value) { + double* boolpointer = malloc(sizeof(value)); + memcpy(boolpointer, &value, sizeof(value)); + return keyValuePair_create(key, boolpointer); +} + +void keyValuePair_free(keyValuePair_t *keyValuePair) { + free(keyValuePair); +} diff --git a/samples/client/others/c/bearerAuth/src/binary.c b/samples/client/others/c/bearerAuth/src/binary.c new file mode 100644 index 000000000000..ddd162a91f3d --- /dev/null +++ b/samples/client/others/c/bearerAuth/src/binary.c @@ -0,0 +1,58 @@ +#include +#include +#include "../include/binary.h" +#ifdef OPENSSL +#include "openssl/pem.h" +#endif + +binary_t* instantiate_binary_t(char* data, int len) { + binary_t* ret = malloc(sizeof(struct binary_t)); + ret->len=len; + ret->data = malloc(len); + memcpy(ret->data, data, len); + return ret; +} + +char *base64encode (const void *b64_encode_this, int encode_this_many_bytes){ +#ifdef OPENSSL + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory sink BIO. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-sink BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //No newlines every 64 characters or less. + BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); //Records base64 encoded data. + BIO_flush(b64_bio); //Flush data. Necessary for b64 encoding, because of pad characters. + BIO_get_mem_ptr(mem_bio, &mem_bio_mem_ptr); //Store address of mem_bio's memory structure. + BIO_set_close(mem_bio, BIO_NOCLOSE); //Permit access to mem_ptr after BIOs are destroyed. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); //Makes space for end null. + (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail. + return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct). +#else // OPENSSL +#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library. + return NULL; +#endif // OPENSSL +} + +char *base64decode (const void *b64_decode_this, int decode_this_many_bytes, int *decoded_bytes){ +#ifdef OPENSSL + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + char *base64_decoded = calloc( (decode_this_many_bytes*3)/4+1, sizeof(char) ); //+1 = null. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory source BIO. + BIO_write(mem_bio, b64_decode_this, decode_this_many_bytes); //Base64 data saved in source. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-source BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //Don't require trailing newlines. + int decoded_byte_index = 0; //Index where the next base64_decoded byte should be written. + while ( 0 < BIO_read(b64_bio, base64_decoded+decoded_byte_index, 1) ){ //Read byte-by-byte. + decoded_byte_index++; //Increment the index until read of BIO decoded data is complete. + } //Once we're done reading decoded data, BIO_read returns -1 even though there's no error. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + *decoded_bytes = decoded_byte_index; + return base64_decoded; //Returns base-64 decoded data with trailing null terminator. +#else // OPENSSL +#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library. + return NULL; +#endif // OPENSSL +} diff --git a/samples/client/others/c/bearerAuth/src/list.c b/samples/client/others/c/bearerAuth/src/list.c new file mode 100644 index 000000000000..786812158a24 --- /dev/null +++ b/samples/client/others/c/bearerAuth/src/list.c @@ -0,0 +1,200 @@ +#include +#include +#include +#include + +#include "../include/list.h" +static listEntry_t *listEntry_create(void *data) { + listEntry_t *createdListEntry = malloc(sizeof(listEntry_t)); + if(createdListEntry == NULL) { + // TODO Malloc Failure + return NULL; + } + createdListEntry->data = data; + + return createdListEntry; +} + +void listEntry_free(listEntry_t *listEntry, void *additionalData) { + free(listEntry); +} + +void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { + printf("%i\n", *((int *) (listEntry->data))); +} + +list_t *list_createList() { + list_t *createdList = malloc(sizeof(list_t)); + if(createdList == NULL) { + // TODO Malloc Failure + return NULL; + } + createdList->firstEntry = NULL; + createdList->lastEntry = NULL; + createdList->count = 0; + + return createdList; +} + +void list_iterateThroughListForward(list_t *list, + void (*operationToPerform)( + listEntry_t *, + void *callbackFunctionUsedData), + void *additionalDataNeededForCallbackFunction) +{ + listEntry_t *currentListEntry = list->firstEntry; + listEntry_t *nextListEntry; + + if(currentListEntry == NULL) { + return; + } + + nextListEntry = currentListEntry->nextListEntry; + + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + + while(currentListEntry != NULL) { + nextListEntry = currentListEntry->nextListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + } +} + +void list_iterateThroughListBackward(list_t *list, + void (*operationToPerform)( + listEntry_t *, + void *callbackFunctionUsedData), + void *additionalDataNeededForCallbackFunction) +{ + listEntry_t *currentListEntry = list->lastEntry; + listEntry_t *nextListEntry = currentListEntry->prevListEntry; + + if(currentListEntry == NULL) { + return; + } + + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + + while(currentListEntry != NULL) { + nextListEntry = currentListEntry->prevListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + } +} + +void list_freeList(list_t *list) { + if(list){ + list_iterateThroughListForward(list, listEntry_free, NULL); + free(list); + } +} + +void list_addElement(list_t *list, void *dataToAddInList) { + listEntry_t *newListEntry = listEntry_create(dataToAddInList); + if(newListEntry == NULL) { + // TODO Malloc Failure + return; + } + if(list->firstEntry == NULL) { + list->firstEntry = newListEntry; + list->lastEntry = newListEntry; + + newListEntry->prevListEntry = NULL; + newListEntry->nextListEntry = NULL; + + list->count++; + + return; + } + + list->lastEntry->nextListEntry = newListEntry; + newListEntry->prevListEntry = list->lastEntry; + newListEntry->nextListEntry = NULL; + list->lastEntry = newListEntry; + + list->count++; +} + +void list_removeElement(list_t *list, listEntry_t *elementToRemove) { + listEntry_t *elementBeforeElementToRemove = + elementToRemove->prevListEntry; + listEntry_t *elementAfterElementToRemove = + elementToRemove->nextListEntry; + + if(elementBeforeElementToRemove != NULL) { + elementBeforeElementToRemove->nextListEntry = + elementAfterElementToRemove; + } else { + list->firstEntry = elementAfterElementToRemove; + } + + if(elementAfterElementToRemove != NULL) { + elementAfterElementToRemove->prevListEntry = + elementBeforeElementToRemove; + } else { + list->lastEntry = elementBeforeElementToRemove; + } + + listEntry_free(elementToRemove, NULL); + + list->count--; +} + +listEntry_t *list_getElementAt(list_t *list, long indexOfElement) { + listEntry_t *currentListEntry; + + if((list->count / 2) > indexOfElement) { + currentListEntry = list->firstEntry; + + for(int i = 0; i < indexOfElement; i++) { + currentListEntry = currentListEntry->nextListEntry; + } + + return currentListEntry; + } else { + currentListEntry = list->lastEntry; + + for(int i = 1; i < (list->count - indexOfElement); i++) { + currentListEntry = currentListEntry->prevListEntry; + } + + return currentListEntry; + } +} + +char* findStrInStrList(list_t *strList, const char *str) +{ + if (!strList || !str) { + return NULL; + } + + listEntry_t* listEntry = NULL; + list_ForEach(listEntry, strList) { + if (strstr((char*)listEntry->data, str) != NULL) { + return (char*)listEntry->data; + } + } + + return NULL; +} + +void clear_and_free_string_list(list_t *list) +{ + if (!list) { + return; + } + + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, list) { + char *list_item = listEntry->data; + free(list_item); + list_item = NULL; + } + list_freeList(list); +} \ No newline at end of file diff --git a/samples/client/others/c/bearerAuth/uncrustify-rules.cfg b/samples/client/others/c/bearerAuth/uncrustify-rules.cfg new file mode 100644 index 000000000000..fa6d5bfb312d --- /dev/null +++ b/samples/client/others/c/bearerAuth/uncrustify-rules.cfg @@ -0,0 +1,210 @@ +tok_split_gte=false +utf8_byte=false +utf8_force=true +indent_cmt_with_tabs=false +indent_align_string=false +indent_braces=false +indent_braces_no_func=false +indent_braces_no_class=false +indent_braces_no_struct=false +indent_brace_parent=false +indent_namespace=false +indent_extern=true +indent_class=false +indent_class_colon=false +indent_else_if=false +indent_var_def_cont=false +indent_func_call_param=false +indent_func_def_param=false +indent_func_proto_param=false +indent_func_class_param=false +indent_func_ctor_var_param=false +indent_template_param=false +indent_func_param_double=false +indent_relative_single_line_comments=false +indent_col1_comment=false +indent_access_spec_body=false +indent_paren_nl=false +indent_comma_paren=false +indent_bool_paren=false +indent_first_bool_expr=false +indent_square_nl=false +indent_preserve_sql=false +indent_align_assign=true +sp_balance_nested_parens=false +align_keep_tabs=false +align_with_tabs=true +align_on_tabstop=true +align_func_params=true +align_same_func_call_params=false +align_var_def_colon=false +align_var_def_attribute=false +align_var_def_inline=false +align_right_cmt_mix=false +align_on_operator=false +align_mix_var_proto=false +align_single_line_func=false +align_single_line_brace=false +align_nl_cont=false +align_left_shift=true +align_oc_decl_colon=false +nl_collapse_empty_body=true +nl_assign_leave_one_liners=false +nl_class_leave_one_liners=false +nl_enum_leave_one_liners=false +nl_getset_leave_one_liners=false +nl_func_leave_one_liners=false +nl_if_leave_one_liners=false +nl_multi_line_cond=true +nl_multi_line_define=false +nl_before_case=true +nl_after_case=true +nl_after_return=false +nl_after_semicolon=true +nl_after_brace_open=false +nl_after_brace_open_cmt=false +nl_after_vbrace_open=false +nl_after_vbrace_open_empty=false +nl_after_brace_close=false +nl_after_vbrace_close=false +nl_define_macro=false +nl_squeeze_ifdef=false +nl_ds_struct_enum_cmt=false +nl_ds_struct_enum_close_brace=false +nl_create_if_one_liner=false +nl_create_for_one_liner=false +nl_create_while_one_liner=false +ls_for_split_full=false +ls_func_split_full=false +nl_after_multiline_comment=false +eat_blanks_after_open_brace=true +eat_blanks_before_close_brace=true +mod_full_brace_if_chain=false +mod_pawn_semicolon=false +mod_full_paren_if_bool=true +mod_remove_extra_semicolon=true +mod_sort_import=true +mod_sort_using=false +mod_sort_include=false +mod_move_case_break=false +mod_remove_empty_return=true +cmt_indent_multi=true +cmt_c_group=false +cmt_c_nl_start=true +cmt_c_nl_end=true +cmt_cpp_group=false +cmt_cpp_nl_start=true +cmt_cpp_nl_end=true +cmt_cpp_to_c=false +cmt_star_cont=false +cmt_multi_check_last=true +cmt_insert_before_preproc=false +pp_indent_at_level=false +pp_region_indent_code=false +pp_if_indent_code=false +pp_define_at_level=false +align_var_def_star_style=1 +align_var_def_amp_style=0 +code_width=80 +indent_with_tabs=1 +sp_arith=force +sp_assign=force +sp_assign_default=force +sp_enum_assign=force +sp_bool=force +sp_compare=force +sp_inside_paren=remove +sp_before_ptr_star=force +sp_before_unnamed_ptr_star=force +sp_between_ptr_star=remove +sp_after_ptr_star=remove +sp_before_sparen=remove +sp_inside_sparen=remove +sp_sparen_brace=force +sp_before_semi=remove +sp_before_semi_for_empty=force +sp_after_semi=force +sp_after_semi_for=force +sp_after_semi_for_empty=force +sp_before_square=remove +sp_before_squares=remove +sp_inside_square=remove +sp_after_comma=force +sp_before_comma=remove +sp_paren_comma=force +sp_before_case_colon=remove +sp_after_cast=force +sp_inside_paren_cast=remove +sp_sizeof_paren=remove +sp_inside_braces_struct=force +sp_type_func=remove +sp_func_proto_paren=remove +sp_func_def_paren=remove +sp_inside_fparens=remove +sp_inside_fparen=remove +sp_square_fparen=remove +sp_fparen_brace=force +sp_func_call_paren=remove +sp_attribute_paren=remove +sp_defined_paren=remove +sp_macro=force +sp_macro_func=force +sp_else_brace=force +sp_brace_else=force +sp_brace_typedef=force +sp_not=remove +sp_inv=remove +sp_addr=remove +sp_member=remove +sp_deref=remove +sp_sign=remove +sp_incdec=remove +sp_before_nl_cont=force +sp_cond_colon=force +sp_cond_question=force +sp_case_label=force +sp_cmt_cpp_start=force +sp_endif_cmt=force +sp_before_tr_emb_cmt=force +nl_start_of_file=remove +nl_end_of_file=add +nl_assign_brace=remove +nl_enum_brace=remove +nl_struct_brace=remove +nl_union_brace=remove +nl_if_brace=remove +nl_brace_else=remove +nl_elseif_brace=remove +nl_else_brace=remove +nl_else_if=remove +nl_brace_finally=remove +nl_finally_brace=remove +nl_try_brace=remove +nl_for_brace=remove +nl_catch_brace=remove +nl_brace_catch=remove +nl_while_brace=remove +nl_do_brace=remove +nl_brace_while=remove +nl_switch_brace=remove +nl_class_brace=remove +nl_func_type_name=remove +nl_func_proto_type_name=remove +nl_func_paren=remove +nl_func_def_paren=remove +nl_func_decl_start=remove +nl_func_def_start=remove +nl_func_decl_args=remove +nl_func_def_args=remove +nl_func_decl_end=remove +nl_func_def_end=remove +nl_func_decl_empty=remove +nl_func_def_empty=remove +nl_fdef_brace=remove +nl_return_expr=remove +pos_bool=trail_break +mod_full_brace_do=force +mod_full_brace_for=force +mod_full_brace_if=force +mod_full_brace_while=force +mod_paren_on_return=remove \ No newline at end of file diff --git a/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES b/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES index 043461c7a2e2..7dfcd68f4e6c 100644 --- a/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES +++ b/samples/client/petstore/c-useJsonUnformatted/.openapi-generator/FILES @@ -12,6 +12,7 @@ docs/PetAPI.md docs/StoreAPI.md docs/UserAPI.md docs/api_response.md +docs/bit.md docs/category.md docs/model_with_set_propertes.md docs/order.md @@ -30,6 +31,8 @@ libcurl.licence model/any_type.h model/api_response.c model/api_response.h +model/bit.c +model/bit.h model/category.c model/category.h model/mapped_model.c diff --git a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt index 7eab107fda2f..d41d5ed59c86 100644 --- a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt +++ b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt @@ -56,6 +56,7 @@ set(SRCS model/object.c model/mapped_model.c model/api_response.c + model/bit.c model/category.c model/model_with_set_propertes.c model/order.c @@ -79,6 +80,7 @@ set(HDRS model/any_type.h model/mapped_model.h model/api_response.h + model/bit.h model/category.h model/model_with_set_propertes.h model/order.h diff --git a/samples/client/petstore/c-useJsonUnformatted/README.md b/samples/client/petstore/c-useJsonUnformatted/README.md index 707999204fbe..2ce0cfb21307 100644 --- a/samples/client/petstore/c-useJsonUnformatted/README.md +++ b/samples/client/petstore/c-useJsonUnformatted/README.md @@ -70,6 +70,8 @@ Category | Method | HTTP request | Description *PetAPI* | [**PetAPI_findPetsByStatus**](docs/PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status *PetAPI* | [**PetAPI_findPetsByTags**](docs/PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags *PetAPI* | [**PetAPI_getPetById**](docs/PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetAPI* | [**PetAPI_isPetAvailable**](docs/PetAPI.md#PetAPI_isPetAvailable) | **POST** /pet/{petId}/isAvailable | Is this pet still available? +*PetAPI* | [**PetAPI_sharePicture**](docs/PetAPI.md#PetAPI_sharePicture) | **POST** /pet/picture | Send a picture of your happy pet *PetAPI* | [**PetAPI_specialtyPet**](docs/PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop *PetAPI* | [**PetAPI_updatePet**](docs/PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet *PetAPI* | [**PetAPI_updatePetWithForm**](docs/PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data @@ -93,6 +95,7 @@ Category | Method | HTTP request | Description - [MappedModel_t](docs/MappedModel.md) - [api_response_t](docs/api_response.md) + - [bit_t](docs/bit.md) - [category_t](docs/category.md) - [model_with_set_propertes_t](docs/model_with_set_propertes.md) - [order_t](docs/order.md) diff --git a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c index 6cb279c58bb3..405162b4a0d7 100644 --- a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c +++ b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c @@ -460,6 +460,141 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId) } +// Is this pet still available? +// +openapi_petstore_bit__e +PetAPI_isPetAvailable(apiClient_t *apiClient, long petId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}/isAvailable")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}/isAvailable"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","successful operation"); + //} + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + openapi_petstore_bit__e elementToReturn = bit_parseFromJSON(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); + if(elementToReturn == 0) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_petId); + return elementToReturn; +end: + free(localVarPath); + return 0; + +} + +// Send a picture of your happy pet +// +char* +PetAPI_sharePicture(apiClient_t *apiClient, char *picture) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/picture")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/picture"); + + + + + // Body Param + localVarBodyParameters = strdup(picture); + list_addElement(localVarHeaderType,"*/*"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","successful operation"); + //} + //primitive return type simple + char* elementToReturn = strdup((char*)apiClient->dataReceived); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarBodyParameters); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + // Specialty of the shop // // Returns the kind of pet the store specializes in diff --git a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h index d33d0394b2d5..5c89fb864da3 100644 --- a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h +++ b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.h @@ -6,6 +6,7 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "../model/api_response.h" +#include "../model/bit.h" #include "../model/pet.h" #include "../model/preference.h" @@ -49,6 +50,18 @@ pet_t* PetAPI_getPetById(apiClient_t *apiClient, long petId); +// Is this pet still available? +// +openapi_petstore_bit__e +PetAPI_isPetAvailable(apiClient_t *apiClient, long petId); + + +// Send a picture of your happy pet +// +char* +PetAPI_sharePicture(apiClient_t *apiClient, char *picture); + + // Specialty of the shop // // Returns the kind of pet the store specializes in diff --git a/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md b/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md index bcdc9e8e1c36..9573ddfe9c45 100644 --- a/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md +++ b/samples/client/petstore/c-useJsonUnformatted/docs/PetAPI.md @@ -9,6 +9,8 @@ Method | HTTP request | Description [**PetAPI_findPetsByStatus**](PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**PetAPI_findPetsByTags**](PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**PetAPI_getPetById**](PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +[**PetAPI_isPetAvailable**](PetAPI.md#PetAPI_isPetAvailable) | **POST** /pet/{petId}/isAvailable | Is this pet still available? +[**PetAPI_sharePicture**](PetAPI.md#PetAPI_sharePicture) | **POST** /pet/picture | Send a picture of your happy pet [**PetAPI_specialtyPet**](PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop [**PetAPI_updatePet**](PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet [**PetAPI_updatePetWithForm**](PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data @@ -165,6 +167,65 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **PetAPI_isPetAvailable** +```c +// Is this pet still available? +// +bit_t* PetAPI_isPetAvailable(apiClient_t *apiClient, long petId); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**petId** | **long** | ID of pet to check | + +### Return type + +[bit_t](bit.md) * + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PetAPI_sharePicture** +```c +// Send a picture of your happy pet +// +char* PetAPI_sharePicture(apiClient_t *apiClient, char *picture); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**picture** | **char \*** | A picture you want to share | + +### Return type + +char* + + + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **PetAPI_specialtyPet** ```c // Specialty of the shop diff --git a/samples/client/petstore/c-useJsonUnformatted/docs/bit.md b/samples/client/petstore/c-useJsonUnformatted/docs/bit.md new file mode 100644 index 000000000000..52946111aa5d --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/docs/bit.md @@ -0,0 +1,9 @@ +# bit_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/c-useJsonUnformatted/model/api_response.c b/samples/client/petstore/c-useJsonUnformatted/model/api_response.c index a1636e35b49b..ccae1f010102 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/api_response.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/api_response.c @@ -78,6 +78,9 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ // api_response->code cJSON *code = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "code"); + if (cJSON_IsNull(code)) { + code = NULL; + } if (code) { if(!cJSON_IsNumber(code)) { @@ -87,6 +90,9 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ // api_response->type cJSON *type = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -96,6 +102,9 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ // api_response->message cJSON *message = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { diff --git a/samples/client/petstore/c-useJsonUnformatted/model/bit.c b/samples/client/petstore/c-useJsonUnformatted/model/bit.c new file mode 100644 index 000000000000..5e0b3bee01dd --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/model/bit.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include "bit.h" + + +char* bit_bit_ToString(openapi_petstore_bit__e bit) { + char *bitArray[] = { "NULL", "0", "1" }; + return bitArray[bit]; +} + +openapi_petstore_bit__e bit_bit_FromString(char* bit) { + int stringToReturn = 0; + char *bitArray[] = { "NULL", "0", "1" }; + size_t sizeofArray = sizeof(bitArray) / sizeof(bitArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(bit, bitArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + +cJSON *bit_convertToJSON(openapi_petstore_bit__e bit) { + cJSON *item = cJSON_CreateObject(); + if(cJSON_AddNumberToObject(item, "bit", bit) == NULL) { + goto fail; + } + return item; +fail: + cJSON_Delete(item); + return NULL; +} + +openapi_petstore_bit__e bit_parseFromJSON(cJSON *bitJSON) { + if(!cJSON_IsNumber(bitJSON)) { + return 0; + } + return bitJSON->valueint; +} diff --git a/samples/client/petstore/c-useJsonUnformatted/model/bit.h b/samples/client/petstore/c-useJsonUnformatted/model/bit.h new file mode 100644 index 000000000000..27ce29db7cf1 --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/model/bit.h @@ -0,0 +1,32 @@ +/* + * bit.h + * + * bit value + */ + +#ifndef _bit_H_ +#define _bit_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct bit_t bit_t; + + +// Enum for bit + +typedef enum { openapi_petstore_bit__NULL = 0, openapi_petstore_bit___0, openapi_petstore_bit___1 } openapi_petstore_bit__e; + +char* bit_bit_ToString(openapi_petstore_bit__e bit); + +openapi_petstore_bit__e bit_bit_FromString(char* bit); + +cJSON *bit_convertToJSON(openapi_petstore_bit__e bit); + +openapi_petstore_bit__e bit_parseFromJSON(cJSON *bitJSON); + +#endif /* _bit_H_ */ + diff --git a/samples/client/petstore/c-useJsonUnformatted/model/category.c b/samples/client/petstore/c-useJsonUnformatted/model/category.c index 3f6c32da5278..a1ea1a5d5cee 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/category.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/category.c @@ -64,6 +64,9 @@ category_t *category_parseFromJSON(cJSON *categoryJSON){ // category->id cJSON *id = cJSON_GetObjectItemCaseSensitive(categoryJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -73,6 +76,9 @@ category_t *category_parseFromJSON(cJSON *categoryJSON){ // category->name cJSON *name = cJSON_GetObjectItemCaseSensitive(categoryJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { diff --git a/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c b/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c index 03b148e44938..7423e32eb338 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c @@ -64,6 +64,9 @@ MappedModel_t *MappedModel_parseFromJSON(cJSON *MappedModelJSON){ // MappedModel->another_property cJSON *another_property = cJSON_GetObjectItemCaseSensitive(MappedModelJSON, "another_property"); + if (cJSON_IsNull(another_property)) { + another_property = NULL; + } if (another_property) { if(!cJSON_IsNumber(another_property)) { @@ -73,6 +76,9 @@ MappedModel_t *MappedModel_parseFromJSON(cJSON *MappedModelJSON){ // MappedModel->uuid_property cJSON *uuid_property = cJSON_GetObjectItemCaseSensitive(MappedModelJSON, "uuid_property"); + if (cJSON_IsNull(uuid_property)) { + uuid_property = NULL; + } if (uuid_property) { if(!cJSON_IsString(uuid_property) && !cJSON_IsNull(uuid_property)) { diff --git a/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c b/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c index 45b497263646..d29660fccfcd 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c @@ -101,6 +101,9 @@ model_with_set_propertes_t *model_with_set_propertes_parseFromJSON(cJSON *model_ // model_with_set_propertes->tag_set cJSON *tag_set = cJSON_GetObjectItemCaseSensitive(model_with_set_propertesJSON, "tag_set"); + if (cJSON_IsNull(tag_set)) { + tag_set = NULL; + } if (tag_set) { cJSON *tag_set_local_nonprimitive = NULL; if(!cJSON_IsArray(tag_set)){ @@ -122,6 +125,9 @@ model_with_set_propertes_t *model_with_set_propertes_parseFromJSON(cJSON *model_ // model_with_set_propertes->string_set cJSON *string_set = cJSON_GetObjectItemCaseSensitive(model_with_set_propertesJSON, "string_set"); + if (cJSON_IsNull(string_set)) { + string_set = NULL; + } if (string_set) { cJSON *string_set_local = NULL; if(!cJSON_IsArray(string_set)) { diff --git a/samples/client/petstore/c-useJsonUnformatted/model/order.c b/samples/client/petstore/c-useJsonUnformatted/model/order.c index b18413bf6e7b..bbbc50e1a316 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/order.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/order.c @@ -122,6 +122,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->id cJSON *id = cJSON_GetObjectItemCaseSensitive(orderJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -131,6 +134,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->pet_id cJSON *pet_id = cJSON_GetObjectItemCaseSensitive(orderJSON, "petId"); + if (cJSON_IsNull(pet_id)) { + pet_id = NULL; + } if (pet_id) { if(!cJSON_IsNumber(pet_id)) { @@ -140,6 +146,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->quantity cJSON *quantity = cJSON_GetObjectItemCaseSensitive(orderJSON, "quantity"); + if (cJSON_IsNull(quantity)) { + quantity = NULL; + } if (quantity) { if(!cJSON_IsNumber(quantity)) { @@ -149,6 +158,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->ship_date cJSON *ship_date = cJSON_GetObjectItemCaseSensitive(orderJSON, "shipDate"); + if (cJSON_IsNull(ship_date)) { + ship_date = NULL; + } if (ship_date) { if(!cJSON_IsString(ship_date) && !cJSON_IsNull(ship_date)) { @@ -158,6 +170,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->status cJSON *status = cJSON_GetObjectItemCaseSensitive(orderJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } openapi_petstore_order_STATUS_e statusVariable; if (status) { if(!cJSON_IsString(status)) @@ -169,6 +184,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->complete cJSON *complete = cJSON_GetObjectItemCaseSensitive(orderJSON, "complete"); + if (cJSON_IsNull(complete)) { + complete = NULL; + } if (complete) { if(!cJSON_IsBool(complete)) { diff --git a/samples/client/petstore/c-useJsonUnformatted/model/pet.c b/samples/client/petstore/c-useJsonUnformatted/model/pet.c index b84be2a3511b..d95d672eda00 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/pet.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/pet.c @@ -177,6 +177,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->id cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -186,12 +189,18 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->category cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); + if (cJSON_IsNull(category)) { + category = NULL; + } if (category) { category_local_nonprim = category_parseFromJSON(category); //nonprimitive } // pet->name cJSON *name = cJSON_GetObjectItemCaseSensitive(petJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -204,6 +213,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->photo_urls cJSON *photo_urls = cJSON_GetObjectItemCaseSensitive(petJSON, "photoUrls"); + if (cJSON_IsNull(photo_urls)) { + photo_urls = NULL; + } if (!photo_urls) { goto end; } @@ -226,6 +238,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->tags cJSON *tags = cJSON_GetObjectItemCaseSensitive(petJSON, "tags"); + if (cJSON_IsNull(tags)) { + tags = NULL; + } if (tags) { cJSON *tags_local_nonprimitive = NULL; if(!cJSON_IsArray(tags)){ @@ -247,6 +262,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->status cJSON *status = cJSON_GetObjectItemCaseSensitive(petJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } openapi_petstore_pet_STATUS_e statusVariable; if (status) { if(!cJSON_IsString(status)) diff --git a/samples/client/petstore/c-useJsonUnformatted/model/preference.c b/samples/client/petstore/c-useJsonUnformatted/model/preference.c index ac7e600fed02..020c983426f4 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/preference.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/preference.c @@ -34,14 +34,8 @@ cJSON *preference_convertToJSON(openapi_petstore_preference__e preference) { } openapi_petstore_preference__e preference_parseFromJSON(cJSON *preferenceJSON) { - openapi_petstore_preference__e *preference = NULL; - openapi_petstore_preference__e preferenceVariable; - cJSON *preferenceVar = cJSON_GetObjectItemCaseSensitive(preferenceJSON, "preference"); - if(!cJSON_IsString(preferenceVar) || (preferenceVar->valuestring == NULL)){ - goto end; + if(!cJSON_IsString(preferenceJSON) || (preferenceJSON->valuestring == NULL)) { + return 0; } - preferenceVariable = preference_preference_FromString(preferenceVar->valuestring); - return preferenceVariable; -end: - return 0; + return preference_preference_FromString(preferenceJSON->valuestring); } diff --git a/samples/client/petstore/c-useJsonUnformatted/model/tag.c b/samples/client/petstore/c-useJsonUnformatted/model/tag.c index 00d73b2d2473..f79d34ef9acd 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/tag.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/tag.c @@ -64,6 +64,9 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON){ // tag->id cJSON *id = cJSON_GetObjectItemCaseSensitive(tagJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -73,6 +76,9 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON){ // tag->name cJSON *name = cJSON_GetObjectItemCaseSensitive(tagJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { diff --git a/samples/client/petstore/c-useJsonUnformatted/model/user.c b/samples/client/petstore/c-useJsonUnformatted/model/user.c index b43d428e1ffa..111bafdc02ad 100644 --- a/samples/client/petstore/c-useJsonUnformatted/model/user.c +++ b/samples/client/petstore/c-useJsonUnformatted/model/user.c @@ -193,6 +193,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->id cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -202,6 +205,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->username cJSON *username = cJSON_GetObjectItemCaseSensitive(userJSON, "username"); + if (cJSON_IsNull(username)) { + username = NULL; + } if (username) { if(!cJSON_IsString(username) && !cJSON_IsNull(username)) { @@ -211,6 +217,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->first_name cJSON *first_name = cJSON_GetObjectItemCaseSensitive(userJSON, "firstName"); + if (cJSON_IsNull(first_name)) { + first_name = NULL; + } if (first_name) { if(!cJSON_IsString(first_name) && !cJSON_IsNull(first_name)) { @@ -220,6 +229,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->last_name cJSON *last_name = cJSON_GetObjectItemCaseSensitive(userJSON, "lastName"); + if (cJSON_IsNull(last_name)) { + last_name = NULL; + } if (last_name) { if(!cJSON_IsString(last_name) && !cJSON_IsNull(last_name)) { @@ -229,6 +241,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->email cJSON *email = cJSON_GetObjectItemCaseSensitive(userJSON, "email"); + if (cJSON_IsNull(email)) { + email = NULL; + } if (email) { if(!cJSON_IsString(email) && !cJSON_IsNull(email)) { @@ -238,6 +253,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->password cJSON *password = cJSON_GetObjectItemCaseSensitive(userJSON, "password"); + if (cJSON_IsNull(password)) { + password = NULL; + } if (password) { if(!cJSON_IsString(password) && !cJSON_IsNull(password)) { @@ -247,6 +265,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->phone cJSON *phone = cJSON_GetObjectItemCaseSensitive(userJSON, "phone"); + if (cJSON_IsNull(phone)) { + phone = NULL; + } if (phone) { if(!cJSON_IsString(phone) && !cJSON_IsNull(phone)) { @@ -256,6 +277,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->user_status cJSON *user_status = cJSON_GetObjectItemCaseSensitive(userJSON, "userStatus"); + if (cJSON_IsNull(user_status)) { + user_status = NULL; + } if (user_status) { if(!cJSON_IsNumber(user_status)) { @@ -265,6 +289,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(userJSON, "extra"); + if (cJSON_IsNull(extra)) { + extra = NULL; + } if (extra) { cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) @@ -285,6 +312,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->preference cJSON *preference = cJSON_GetObjectItemCaseSensitive(userJSON, "preference"); + if (cJSON_IsNull(preference)) { + preference = NULL; + } if (preference) { preference_local_nonprim = preference_parseFromJSON(preference); //custom } diff --git a/samples/client/petstore/c-useJsonUnformatted/unit-test/test_bit.c b/samples/client/petstore/c-useJsonUnformatted/unit-test/test_bit.c new file mode 100644 index 000000000000..1a0e6c26b693 --- /dev/null +++ b/samples/client/petstore/c-useJsonUnformatted/unit-test/test_bit.c @@ -0,0 +1,56 @@ +#ifndef bit_TEST +#define bit_TEST + +// the following is to include only the main from the first c file +#ifndef TEST_MAIN +#define TEST_MAIN +#define bit_MAIN +#endif // TEST_MAIN + +#include +#include +#include +#include +#include "../external/cJSON.h" + +#include "../model/bit.h" +bit_t* instantiate_bit(int include_optional); + + + +bit_t* instantiate_bit(int include_optional) { + bit_t* bit = NULL; + if (include_optional) { + bit = bit_create( + ); + } else { + bit = bit_create( + ); + } + + return bit; +} + + +#ifdef bit_MAIN + +void test_bit(int include_optional) { + bit_t* bit_1 = instantiate_bit(include_optional); + + cJSON* jsonbit_1 = bit_convertToJSON(bit_1); + printf("bit :\n%s\n", cJSON_PrintUnformatted(jsonbit_1)); + bit_t* bit_2 = bit_parseFromJSON(jsonbit_1); + cJSON* jsonbit_2 = bit_convertToJSON(bit_2); + printf("repeating bit:\n%s\n", cJSON_PrintUnformatted(jsonbit_2)); +} + +int main() { + test_bit(1); + test_bit(0); + + printf("Hello world \n"); + return 0; +} + +#endif // bit_MAIN +#endif // bit_TEST diff --git a/samples/client/petstore/c/.openapi-generator/FILES b/samples/client/petstore/c/.openapi-generator/FILES index eff7ae714342..bb03f840cfc5 100644 --- a/samples/client/petstore/c/.openapi-generator/FILES +++ b/samples/client/petstore/c/.openapi-generator/FILES @@ -11,6 +11,7 @@ docs/PetAPI.md docs/StoreAPI.md docs/UserAPI.md docs/api_response.md +docs/bit.md docs/category.md docs/model_with_set_propertes.md docs/order.md @@ -29,6 +30,8 @@ libcurl.licence model/any_type.h model/api_response.c model/api_response.h +model/bit.c +model/bit.h model/category.c model/category.h model/mapped_model.c diff --git a/samples/client/petstore/c/README.md b/samples/client/petstore/c/README.md index 707999204fbe..2ce0cfb21307 100644 --- a/samples/client/petstore/c/README.md +++ b/samples/client/petstore/c/README.md @@ -70,6 +70,8 @@ Category | Method | HTTP request | Description *PetAPI* | [**PetAPI_findPetsByStatus**](docs/PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status *PetAPI* | [**PetAPI_findPetsByTags**](docs/PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags *PetAPI* | [**PetAPI_getPetById**](docs/PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetAPI* | [**PetAPI_isPetAvailable**](docs/PetAPI.md#PetAPI_isPetAvailable) | **POST** /pet/{petId}/isAvailable | Is this pet still available? +*PetAPI* | [**PetAPI_sharePicture**](docs/PetAPI.md#PetAPI_sharePicture) | **POST** /pet/picture | Send a picture of your happy pet *PetAPI* | [**PetAPI_specialtyPet**](docs/PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop *PetAPI* | [**PetAPI_updatePet**](docs/PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet *PetAPI* | [**PetAPI_updatePetWithForm**](docs/PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data @@ -93,6 +95,7 @@ Category | Method | HTTP request | Description - [MappedModel_t](docs/MappedModel.md) - [api_response_t](docs/api_response.md) + - [bit_t](docs/bit.md) - [category_t](docs/category.md) - [model_with_set_propertes_t](docs/model_with_set_propertes.md) - [order_t](docs/order.md) diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index 9cf09a2e4ad9..adf72e1cf601 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -460,6 +460,141 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId) } +// Is this pet still available? +// +openapi_petstore_bit__e +PetAPI_isPetAvailable(apiClient_t *apiClient, long petId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}/isAvailable")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}/isAvailable"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","successful operation"); + //} + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + openapi_petstore_bit__e elementToReturn = bit_parseFromJSON(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); + if(elementToReturn == 0) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_petId); + return elementToReturn; +end: + free(localVarPath); + return 0; + +} + +// Send a picture of your happy pet +// +char* +PetAPI_sharePicture(apiClient_t *apiClient, char *picture) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/picture")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/picture"); + + + + + // Body Param + localVarBodyParameters = strdup(picture); + list_addElement(localVarHeaderType,"*/*"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + // uncomment below to debug the error response + //if (apiClient->response_code == 200) { + // printf("%s\n","successful operation"); + //} + //primitive return type simple + char* elementToReturn = strdup((char*)apiClient->dataReceived); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; + } + + + + list_freeList(localVarHeaderType); + + free(localVarPath); + free(localVarBodyParameters); + return elementToReturn; +end: + free(localVarPath); + return NULL; + +} + // Specialty of the shop // // Returns the kind of pet the store specializes in diff --git a/samples/client/petstore/c/api/PetAPI.h b/samples/client/petstore/c/api/PetAPI.h index d33d0394b2d5..5c89fb864da3 100644 --- a/samples/client/petstore/c/api/PetAPI.h +++ b/samples/client/petstore/c/api/PetAPI.h @@ -6,6 +6,7 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "../model/api_response.h" +#include "../model/bit.h" #include "../model/pet.h" #include "../model/preference.h" @@ -49,6 +50,18 @@ pet_t* PetAPI_getPetById(apiClient_t *apiClient, long petId); +// Is this pet still available? +// +openapi_petstore_bit__e +PetAPI_isPetAvailable(apiClient_t *apiClient, long petId); + + +// Send a picture of your happy pet +// +char* +PetAPI_sharePicture(apiClient_t *apiClient, char *picture); + + // Specialty of the shop // // Returns the kind of pet the store specializes in diff --git a/samples/client/petstore/c/docs/PetAPI.md b/samples/client/petstore/c/docs/PetAPI.md index bcdc9e8e1c36..9573ddfe9c45 100644 --- a/samples/client/petstore/c/docs/PetAPI.md +++ b/samples/client/petstore/c/docs/PetAPI.md @@ -9,6 +9,8 @@ Method | HTTP request | Description [**PetAPI_findPetsByStatus**](PetAPI.md#PetAPI_findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**PetAPI_findPetsByTags**](PetAPI.md#PetAPI_findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**PetAPI_getPetById**](PetAPI.md#PetAPI_getPetById) | **GET** /pet/{petId} | Find pet by ID +[**PetAPI_isPetAvailable**](PetAPI.md#PetAPI_isPetAvailable) | **POST** /pet/{petId}/isAvailable | Is this pet still available? +[**PetAPI_sharePicture**](PetAPI.md#PetAPI_sharePicture) | **POST** /pet/picture | Send a picture of your happy pet [**PetAPI_specialtyPet**](PetAPI.md#PetAPI_specialtyPet) | **GET** /pet/specialty | Specialty of the shop [**PetAPI_updatePet**](PetAPI.md#PetAPI_updatePet) | **PUT** /pet | Update an existing pet [**PetAPI_updatePetWithForm**](PetAPI.md#PetAPI_updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data @@ -165,6 +167,65 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **PetAPI_isPetAvailable** +```c +// Is this pet still available? +// +bit_t* PetAPI_isPetAvailable(apiClient_t *apiClient, long petId); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**petId** | **long** | ID of pet to check | + +### Return type + +[bit_t](bit.md) * + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PetAPI_sharePicture** +```c +// Send a picture of your happy pet +// +char* PetAPI_sharePicture(apiClient_t *apiClient, char *picture); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**picture** | **char \*** | A picture you want to share | + +### Return type + +char* + + + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **PetAPI_specialtyPet** ```c // Specialty of the shop diff --git a/samples/client/petstore/c/docs/bit.md b/samples/client/petstore/c/docs/bit.md new file mode 100644 index 000000000000..52946111aa5d --- /dev/null +++ b/samples/client/petstore/c/docs/bit.md @@ -0,0 +1,9 @@ +# bit_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/c/model/api_response.c b/samples/client/petstore/c/model/api_response.c index a1636e35b49b..ccae1f010102 100644 --- a/samples/client/petstore/c/model/api_response.c +++ b/samples/client/petstore/c/model/api_response.c @@ -78,6 +78,9 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ // api_response->code cJSON *code = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "code"); + if (cJSON_IsNull(code)) { + code = NULL; + } if (code) { if(!cJSON_IsNumber(code)) { @@ -87,6 +90,9 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ // api_response->type cJSON *type = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "type"); + if (cJSON_IsNull(type)) { + type = NULL; + } if (type) { if(!cJSON_IsString(type) && !cJSON_IsNull(type)) { @@ -96,6 +102,9 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ // api_response->message cJSON *message = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "message"); + if (cJSON_IsNull(message)) { + message = NULL; + } if (message) { if(!cJSON_IsString(message) && !cJSON_IsNull(message)) { diff --git a/samples/client/petstore/c/model/bit.c b/samples/client/petstore/c/model/bit.c new file mode 100644 index 000000000000..5e0b3bee01dd --- /dev/null +++ b/samples/client/petstore/c/model/bit.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include "bit.h" + + +char* bit_bit_ToString(openapi_petstore_bit__e bit) { + char *bitArray[] = { "NULL", "0", "1" }; + return bitArray[bit]; +} + +openapi_petstore_bit__e bit_bit_FromString(char* bit) { + int stringToReturn = 0; + char *bitArray[] = { "NULL", "0", "1" }; + size_t sizeofArray = sizeof(bitArray) / sizeof(bitArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(bit, bitArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + +cJSON *bit_convertToJSON(openapi_petstore_bit__e bit) { + cJSON *item = cJSON_CreateObject(); + if(cJSON_AddNumberToObject(item, "bit", bit) == NULL) { + goto fail; + } + return item; +fail: + cJSON_Delete(item); + return NULL; +} + +openapi_petstore_bit__e bit_parseFromJSON(cJSON *bitJSON) { + if(!cJSON_IsNumber(bitJSON)) { + return 0; + } + return bitJSON->valueint; +} diff --git a/samples/client/petstore/c/model/bit.h b/samples/client/petstore/c/model/bit.h new file mode 100644 index 000000000000..27ce29db7cf1 --- /dev/null +++ b/samples/client/petstore/c/model/bit.h @@ -0,0 +1,32 @@ +/* + * bit.h + * + * bit value + */ + +#ifndef _bit_H_ +#define _bit_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct bit_t bit_t; + + +// Enum for bit + +typedef enum { openapi_petstore_bit__NULL = 0, openapi_petstore_bit___0, openapi_petstore_bit___1 } openapi_petstore_bit__e; + +char* bit_bit_ToString(openapi_petstore_bit__e bit); + +openapi_petstore_bit__e bit_bit_FromString(char* bit); + +cJSON *bit_convertToJSON(openapi_petstore_bit__e bit); + +openapi_petstore_bit__e bit_parseFromJSON(cJSON *bitJSON); + +#endif /* _bit_H_ */ + diff --git a/samples/client/petstore/c/model/category.c b/samples/client/petstore/c/model/category.c index 3f6c32da5278..a1ea1a5d5cee 100644 --- a/samples/client/petstore/c/model/category.c +++ b/samples/client/petstore/c/model/category.c @@ -64,6 +64,9 @@ category_t *category_parseFromJSON(cJSON *categoryJSON){ // category->id cJSON *id = cJSON_GetObjectItemCaseSensitive(categoryJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -73,6 +76,9 @@ category_t *category_parseFromJSON(cJSON *categoryJSON){ // category->name cJSON *name = cJSON_GetObjectItemCaseSensitive(categoryJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { diff --git a/samples/client/petstore/c/model/mapped_model.c b/samples/client/petstore/c/model/mapped_model.c index 03b148e44938..7423e32eb338 100644 --- a/samples/client/petstore/c/model/mapped_model.c +++ b/samples/client/petstore/c/model/mapped_model.c @@ -64,6 +64,9 @@ MappedModel_t *MappedModel_parseFromJSON(cJSON *MappedModelJSON){ // MappedModel->another_property cJSON *another_property = cJSON_GetObjectItemCaseSensitive(MappedModelJSON, "another_property"); + if (cJSON_IsNull(another_property)) { + another_property = NULL; + } if (another_property) { if(!cJSON_IsNumber(another_property)) { @@ -73,6 +76,9 @@ MappedModel_t *MappedModel_parseFromJSON(cJSON *MappedModelJSON){ // MappedModel->uuid_property cJSON *uuid_property = cJSON_GetObjectItemCaseSensitive(MappedModelJSON, "uuid_property"); + if (cJSON_IsNull(uuid_property)) { + uuid_property = NULL; + } if (uuid_property) { if(!cJSON_IsString(uuid_property) && !cJSON_IsNull(uuid_property)) { diff --git a/samples/client/petstore/c/model/model_with_set_propertes.c b/samples/client/petstore/c/model/model_with_set_propertes.c index 45b497263646..d29660fccfcd 100644 --- a/samples/client/petstore/c/model/model_with_set_propertes.c +++ b/samples/client/petstore/c/model/model_with_set_propertes.c @@ -101,6 +101,9 @@ model_with_set_propertes_t *model_with_set_propertes_parseFromJSON(cJSON *model_ // model_with_set_propertes->tag_set cJSON *tag_set = cJSON_GetObjectItemCaseSensitive(model_with_set_propertesJSON, "tag_set"); + if (cJSON_IsNull(tag_set)) { + tag_set = NULL; + } if (tag_set) { cJSON *tag_set_local_nonprimitive = NULL; if(!cJSON_IsArray(tag_set)){ @@ -122,6 +125,9 @@ model_with_set_propertes_t *model_with_set_propertes_parseFromJSON(cJSON *model_ // model_with_set_propertes->string_set cJSON *string_set = cJSON_GetObjectItemCaseSensitive(model_with_set_propertesJSON, "string_set"); + if (cJSON_IsNull(string_set)) { + string_set = NULL; + } if (string_set) { cJSON *string_set_local = NULL; if(!cJSON_IsArray(string_set)) { diff --git a/samples/client/petstore/c/model/order.c b/samples/client/petstore/c/model/order.c index b18413bf6e7b..bbbc50e1a316 100644 --- a/samples/client/petstore/c/model/order.c +++ b/samples/client/petstore/c/model/order.c @@ -122,6 +122,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->id cJSON *id = cJSON_GetObjectItemCaseSensitive(orderJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -131,6 +134,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->pet_id cJSON *pet_id = cJSON_GetObjectItemCaseSensitive(orderJSON, "petId"); + if (cJSON_IsNull(pet_id)) { + pet_id = NULL; + } if (pet_id) { if(!cJSON_IsNumber(pet_id)) { @@ -140,6 +146,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->quantity cJSON *quantity = cJSON_GetObjectItemCaseSensitive(orderJSON, "quantity"); + if (cJSON_IsNull(quantity)) { + quantity = NULL; + } if (quantity) { if(!cJSON_IsNumber(quantity)) { @@ -149,6 +158,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->ship_date cJSON *ship_date = cJSON_GetObjectItemCaseSensitive(orderJSON, "shipDate"); + if (cJSON_IsNull(ship_date)) { + ship_date = NULL; + } if (ship_date) { if(!cJSON_IsString(ship_date) && !cJSON_IsNull(ship_date)) { @@ -158,6 +170,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->status cJSON *status = cJSON_GetObjectItemCaseSensitive(orderJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } openapi_petstore_order_STATUS_e statusVariable; if (status) { if(!cJSON_IsString(status)) @@ -169,6 +184,9 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ // order->complete cJSON *complete = cJSON_GetObjectItemCaseSensitive(orderJSON, "complete"); + if (cJSON_IsNull(complete)) { + complete = NULL; + } if (complete) { if(!cJSON_IsBool(complete)) { diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index b84be2a3511b..d95d672eda00 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -177,6 +177,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->id cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -186,12 +189,18 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->category cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); + if (cJSON_IsNull(category)) { + category = NULL; + } if (category) { category_local_nonprim = category_parseFromJSON(category); //nonprimitive } // pet->name cJSON *name = cJSON_GetObjectItemCaseSensitive(petJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (!name) { goto end; } @@ -204,6 +213,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->photo_urls cJSON *photo_urls = cJSON_GetObjectItemCaseSensitive(petJSON, "photoUrls"); + if (cJSON_IsNull(photo_urls)) { + photo_urls = NULL; + } if (!photo_urls) { goto end; } @@ -226,6 +238,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->tags cJSON *tags = cJSON_GetObjectItemCaseSensitive(petJSON, "tags"); + if (cJSON_IsNull(tags)) { + tags = NULL; + } if (tags) { cJSON *tags_local_nonprimitive = NULL; if(!cJSON_IsArray(tags)){ @@ -247,6 +262,9 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ // pet->status cJSON *status = cJSON_GetObjectItemCaseSensitive(petJSON, "status"); + if (cJSON_IsNull(status)) { + status = NULL; + } openapi_petstore_pet_STATUS_e statusVariable; if (status) { if(!cJSON_IsString(status)) diff --git a/samples/client/petstore/c/model/preference.c b/samples/client/petstore/c/model/preference.c index ac7e600fed02..020c983426f4 100644 --- a/samples/client/petstore/c/model/preference.c +++ b/samples/client/petstore/c/model/preference.c @@ -34,14 +34,8 @@ cJSON *preference_convertToJSON(openapi_petstore_preference__e preference) { } openapi_petstore_preference__e preference_parseFromJSON(cJSON *preferenceJSON) { - openapi_petstore_preference__e *preference = NULL; - openapi_petstore_preference__e preferenceVariable; - cJSON *preferenceVar = cJSON_GetObjectItemCaseSensitive(preferenceJSON, "preference"); - if(!cJSON_IsString(preferenceVar) || (preferenceVar->valuestring == NULL)){ - goto end; + if(!cJSON_IsString(preferenceJSON) || (preferenceJSON->valuestring == NULL)) { + return 0; } - preferenceVariable = preference_preference_FromString(preferenceVar->valuestring); - return preferenceVariable; -end: - return 0; + return preference_preference_FromString(preferenceJSON->valuestring); } diff --git a/samples/client/petstore/c/model/tag.c b/samples/client/petstore/c/model/tag.c index 00d73b2d2473..f79d34ef9acd 100644 --- a/samples/client/petstore/c/model/tag.c +++ b/samples/client/petstore/c/model/tag.c @@ -64,6 +64,9 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON){ // tag->id cJSON *id = cJSON_GetObjectItemCaseSensitive(tagJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -73,6 +76,9 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON){ // tag->name cJSON *name = cJSON_GetObjectItemCaseSensitive(tagJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } if (name) { if(!cJSON_IsString(name) && !cJSON_IsNull(name)) { diff --git a/samples/client/petstore/c/model/user.c b/samples/client/petstore/c/model/user.c index b43d428e1ffa..111bafdc02ad 100644 --- a/samples/client/petstore/c/model/user.c +++ b/samples/client/petstore/c/model/user.c @@ -193,6 +193,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->id cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); + if (cJSON_IsNull(id)) { + id = NULL; + } if (id) { if(!cJSON_IsNumber(id)) { @@ -202,6 +205,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->username cJSON *username = cJSON_GetObjectItemCaseSensitive(userJSON, "username"); + if (cJSON_IsNull(username)) { + username = NULL; + } if (username) { if(!cJSON_IsString(username) && !cJSON_IsNull(username)) { @@ -211,6 +217,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->first_name cJSON *first_name = cJSON_GetObjectItemCaseSensitive(userJSON, "firstName"); + if (cJSON_IsNull(first_name)) { + first_name = NULL; + } if (first_name) { if(!cJSON_IsString(first_name) && !cJSON_IsNull(first_name)) { @@ -220,6 +229,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->last_name cJSON *last_name = cJSON_GetObjectItemCaseSensitive(userJSON, "lastName"); + if (cJSON_IsNull(last_name)) { + last_name = NULL; + } if (last_name) { if(!cJSON_IsString(last_name) && !cJSON_IsNull(last_name)) { @@ -229,6 +241,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->email cJSON *email = cJSON_GetObjectItemCaseSensitive(userJSON, "email"); + if (cJSON_IsNull(email)) { + email = NULL; + } if (email) { if(!cJSON_IsString(email) && !cJSON_IsNull(email)) { @@ -238,6 +253,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->password cJSON *password = cJSON_GetObjectItemCaseSensitive(userJSON, "password"); + if (cJSON_IsNull(password)) { + password = NULL; + } if (password) { if(!cJSON_IsString(password) && !cJSON_IsNull(password)) { @@ -247,6 +265,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->phone cJSON *phone = cJSON_GetObjectItemCaseSensitive(userJSON, "phone"); + if (cJSON_IsNull(phone)) { + phone = NULL; + } if (phone) { if(!cJSON_IsString(phone) && !cJSON_IsNull(phone)) { @@ -256,6 +277,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->user_status cJSON *user_status = cJSON_GetObjectItemCaseSensitive(userJSON, "userStatus"); + if (cJSON_IsNull(user_status)) { + user_status = NULL; + } if (user_status) { if(!cJSON_IsNumber(user_status)) { @@ -265,6 +289,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(userJSON, "extra"); + if (cJSON_IsNull(extra)) { + extra = NULL; + } if (extra) { cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) @@ -285,6 +312,9 @@ user_t *user_parseFromJSON(cJSON *userJSON){ // user->preference cJSON *preference = cJSON_GetObjectItemCaseSensitive(userJSON, "preference"); + if (cJSON_IsNull(preference)) { + preference = NULL; + } if (preference) { preference_local_nonprim = preference_parseFromJSON(preference); //custom } diff --git a/samples/client/petstore/c/unit-test/test_bit.c b/samples/client/petstore/c/unit-test/test_bit.c new file mode 100644 index 000000000000..8e3e83eb87a7 --- /dev/null +++ b/samples/client/petstore/c/unit-test/test_bit.c @@ -0,0 +1,56 @@ +#ifndef bit_TEST +#define bit_TEST + +// the following is to include only the main from the first c file +#ifndef TEST_MAIN +#define TEST_MAIN +#define bit_MAIN +#endif // TEST_MAIN + +#include +#include +#include +#include +#include "../external/cJSON.h" + +#include "../model/bit.h" +bit_t* instantiate_bit(int include_optional); + + + +bit_t* instantiate_bit(int include_optional) { + bit_t* bit = NULL; + if (include_optional) { + bit = bit_create( + ); + } else { + bit = bit_create( + ); + } + + return bit; +} + + +#ifdef bit_MAIN + +void test_bit(int include_optional) { + bit_t* bit_1 = instantiate_bit(include_optional); + + cJSON* jsonbit_1 = bit_convertToJSON(bit_1); + printf("bit :\n%s\n", cJSON_Print(jsonbit_1)); + bit_t* bit_2 = bit_parseFromJSON(jsonbit_1); + cJSON* jsonbit_2 = bit_convertToJSON(bit_2); + printf("repeating bit:\n%s\n", cJSON_Print(jsonbit_2)); +} + +int main() { + test_bit(1); + test_bit(0); + + printf("Hello world \n"); + return 0; +} + +#endif // bit_MAIN +#endif // bit_TEST From ba5ecbccde1c24261a4cf05bee4e12ae7b752785 Mon Sep 17 00:00:00 2001 From: drewble Date: Fri, 6 Dec 2024 00:26:39 -0600 Subject: [PATCH 38/40] Improved Elixir Atom Generation (#20229) * Update ElixirClientCodegen.java * Refine the regular expression for atoms The original regex incorrectly matched `@atom` (unquoted atoms cannot begin with @). However, through testing with `iex`, it also turns out that the atom `:@` is legal. The following atoms will now be quoted that would have been incorrectly not quoted: - `:@type` * Add model to petstore client to test new atom creation regex pattern --- .../languages/ElixirClientCodegen.java | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 477 +++++++++--------- .../petstore/elixir/.openapi-generator/FILES | 1 + .../elixir/lib/openapi_petstore/model/any.ex | 22 + .../client/petstore/elixir/test/any_test.exs | 14 + 5 files changed, 279 insertions(+), 237 deletions(-) create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex create mode 100644 samples/client/petstore/elixir/test/any_test.exs diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 775afb9bd597..095d6ac7e189 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -48,7 +48,7 @@ public class ElixirClientCodegen extends DefaultCodegen { private final Logger LOGGER = LoggerFactory.getLogger(ElixirClientCodegen.class); - private final Pattern simpleAtomPattern = Pattern.compile("\\A(?:(?:[_@\\p{Alpha}][_@\\p{Alnum}]*[?!]?)|-)\\z"); + private final Pattern simpleAtomPattern = Pattern.compile("\\A(?:(?:[_\\p{Alpha}][_@\\p{Alnum}]*[?!]?)|-|@)\\z"); @Setter protected String packageVersion = "1.0.0"; @Setter protected String moduleName; diff --git a/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml index e4957b4e19d1..229450a390d6 100644 --- a/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml @@ -8,7 +8,7 @@ info: title: OpenAPI Petstore license: name: Apache-2.0 - url: 'https://www.apache.org/licenses/LICENSE-2.0.html' + url: "https://www.apache.org/licenses/LICENSE-2.0.html" tags: - name: pet description: Everything about your Pets @@ -28,65 +28,65 @@ paths: type: object properties: string: - $ref: '#/components/schemas/Foo' + $ref: "#/components/schemas/Foo" /pet: servers: - - url: 'http://petstore.swagger.io/v2' - - url: 'http://path-server-test.petstore.local/v2' - - url: 'http://{server}.swagger.io:{port}/v2' - description: test server with variables - variables: - server: - description: target server - enum: - - 'petstore' - - 'qa-petstore' - - 'dev-petstore' - default: 'petstore' - port: - enum: - - 80 - - 8080 - default: 80 + - url: "http://petstore.swagger.io/v2" + - url: "http://path-server-test.petstore.local/v2" + - url: "http://{server}.swagger.io:{port}/v2" + description: test server with variables + variables: + server: + description: target server + enum: + - "petstore" + - "qa-petstore" + - "dev-petstore" + default: "petstore" + port: + enum: + - 80 + - 8080 + default: 80 post: tags: - pet summary: Add a new pet to the store - description: '' + description: "" operationId: addPet responses: - '200': + "200": description: Successful operation - '405': + "405": description: Invalid input security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" requestBody: - $ref: '#/components/requestBodies/Pet' + $ref: "#/components/requestBodies/Pet" put: tags: - pet summary: Update an existing pet - description: '' + description: "" operationId: updatePet x-webclient-blocking: true responses: - '200': + "200": description: Successful operation - '400': + "400": description: Invalid ID supplied - '404': + "404": description: Pet not found - '405': + "405": description: Validation exception security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" requestBody: - $ref: '#/components/requestBodies/Pet' + $ref: "#/components/requestBodies/Pet" /pet/findByStatus: get: tags: @@ -113,25 +113,25 @@ paths: - sold default: available responses: - '200': + "200": description: successful operation content: application/xml: schema: type: array items: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" application/json: schema: type: array items: - $ref: '#/components/schemas/Pet' - '400': + $ref: "#/components/schemas/Pet" + "400": description: Invalid status value security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" /pet/findByTags: get: tags: @@ -155,29 +155,29 @@ paths: type: string uniqueItems: true responses: - '200': + "200": description: successful operation content: application/xml: schema: type: array items: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" uniqueItems: true application/json: schema: type: array items: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" uniqueItems: true - '400': + "400": description: Invalid tag value security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" deprecated: true - '/pet/{petId}': + "/pet/{petId}": get: tags: - pet @@ -194,18 +194,18 @@ paths: type: integer format: int64 responses: - '200': + "200": description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" application/json: schema: - $ref: '#/components/schemas/Pet' - '400': + $ref: "#/components/schemas/Pet" + "400": description: Invalid ID supplied - '404': + "404": description: Pet not found security: - api_key: [] @@ -213,7 +213,7 @@ paths: tags: - pet summary: Updates a pet in the store with form data - description: '' + description: "" operationId: updatePetWithForm parameters: - name: petId @@ -224,14 +224,14 @@ paths: type: integer format: int64 responses: - '200': + "200": description: Successful operation - '405': + "405": description: Invalid input security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" requestBody: content: application/x-www-form-urlencoded: @@ -248,7 +248,7 @@ paths: tags: - pet summary: Deletes a pet - description: '' + description: "" operationId: deletePet parameters: - name: api_key @@ -264,20 +264,20 @@ paths: type: integer format: int64 responses: - '200': + "200": description: Successful operation - '400': + "400": description: Invalid pet value security: - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}/uploadImage': + - "write:pets" + - "read:pets" + "/pet/{petId}/uploadImage": post: tags: - pet summary: uploads an image - description: '' + description: "" operationId: uploadFile parameters: - name: petId @@ -288,16 +288,16 @@ paths: type: integer format: int64 responses: - '200': + "200": description: successful operation content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' + $ref: "#/components/schemas/ApiResponse" security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" requestBody: content: multipart/form-data: @@ -320,7 +320,7 @@ paths: operationId: getInventory x-webclient-blocking: false responses: - '200': + "200": description: successful operation content: application/json: @@ -336,28 +336,28 @@ paths: tags: - store summary: Place an order for a pet - description: '' + description: "" operationId: placeOrder responses: - '200': + "200": description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/Order' + $ref: "#/components/schemas/Order" application/json: schema: - $ref: '#/components/schemas/Order' - '400': + $ref: "#/components/schemas/Order" + "400": description: Invalid Order requestBody: content: application/json: schema: - $ref: '#/components/schemas/Order' + $ref: "#/components/schemas/Order" description: order placed for purchasing the pet required: true - '/store/order/{order_id}': + "/store/order/{order_id}": get: tags: - store @@ -377,18 +377,18 @@ paths: minimum: 1 maximum: 5 responses: - '200': + "200": description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/Order' + $ref: "#/components/schemas/Order" application/json: schema: - $ref: '#/components/schemas/Order' - '400': + $ref: "#/components/schemas/Order" + "400": description: Invalid ID supplied - '404': + "404": description: Order not found delete: tags: @@ -406,9 +406,9 @@ paths: schema: type: string responses: - '400': + "400": description: Invalid ID supplied - '404': + "404": description: Order not found /user: post: @@ -424,7 +424,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" description: Created user object required: true /user/createWithArray: @@ -432,31 +432,31 @@ paths: tags: - user summary: Creates list of users with given input array - description: '' + description: "" operationId: createUsersWithArrayInput responses: default: description: successful operation requestBody: - $ref: '#/components/requestBodies/UserArray' + $ref: "#/components/requestBodies/UserArray" /user/createWithList: post: tags: - user summary: Creates list of users with given input array - description: '' + description: "" operationId: createUsersWithListInput responses: default: description: successful operation requestBody: - $ref: '#/components/requestBodies/UserArray' + $ref: "#/components/requestBodies/UserArray" /user/login: get: tags: - user summary: Logs user into the system - description: '' + description: "" operationId: loginUser parameters: - name: username @@ -472,7 +472,7 @@ paths: schema: type: string responses: - '200': + "200": description: successful operation headers: X-Rate-Limit: @@ -492,24 +492,24 @@ paths: application/json: schema: type: string - '400': + "400": description: Invalid username/password supplied /user/logout: get: tags: - user summary: Logs out current logged in user session - description: '' + description: "" operationId: logoutUser responses: default: description: successful operation - '/user/{username}': + "/user/{username}": get: tags: - user summary: Get user by user name - description: '' + description: "" operationId: getUserByName parameters: - name: username @@ -519,18 +519,18 @@ paths: schema: type: string responses: - '200': + "200": description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" application/json: schema: - $ref: '#/components/schemas/User' - '400': + $ref: "#/components/schemas/User" + "400": description: Invalid username supplied - '404': + "404": description: User not found put: tags: @@ -546,15 +546,15 @@ paths: schema: type: string responses: - '400': + "400": description: Invalid user supplied - '404': + "404": description: User not found requestBody: content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" description: Updated user object required: true delete: @@ -571,28 +571,28 @@ paths: schema: type: string responses: - '400': + "400": description: Invalid username supplied - '404': + "404": description: User not found /fake_classname_test: patch: tags: - - 'fake_classname_tags 123#$%^' + - "fake_classname_tags 123#$%^" summary: To test class name in snake case description: To test class name in snake case operationId: testClassname responses: - '200': + "200": description: successful operation content: application/json: schema: - $ref: '#/components/schemas/Client' + $ref: "#/components/schemas/Client" security: - api_key_query: [] requestBody: - $ref: '#/components/requestBodies/Client' + $ref: "#/components/requestBodies/Client" /fake: patch: tags: @@ -601,14 +601,14 @@ paths: description: To test "client" model operationId: testClientModel responses: - '200': + "200": description: successful operation content: application/json: schema: - $ref: '#/components/schemas/Client' + $ref: "#/components/schemas/Client" requestBody: - $ref: '#/components/requestBodies/Client' + $ref: "#/components/requestBodies/Client" get: tags: - fake @@ -625,7 +625,7 @@ paths: type: string default: $ enum: - - '>' + - ">" - $ - name: enum_header_string in: header @@ -634,9 +634,9 @@ paths: type: string enum: - _abc - - '-efg' + - "-efg" - (xyz) - default: '-efg' + default: "-efg" - name: enum_query_string_array in: query description: Query parameter enum test (string array) @@ -646,7 +646,7 @@ paths: type: string default: $ enum: - - '>' + - ">" - $ - name: enum_query_string in: query @@ -655,9 +655,9 @@ paths: type: string enum: - _abc - - '-efg' + - "-efg" - (xyz) - default: '-efg' + default: "-efg" - name: enum_query_integer in: query description: Query parameter enum test (double) @@ -681,11 +681,11 @@ paths: schema: type: array items: - $ref: '#/components/schemas/EnumClass' + $ref: "#/components/schemas/EnumClass" responses: - '400': + "400": description: Invalid request - '404': + "404": description: Not found requestBody: content: @@ -700,16 +700,16 @@ paths: type: string default: $ enum: - - '>' + - ">" - $ enum_form_string: description: Form parameter enum test (string) type: string enum: - _abc - - '-efg' + - "-efg" - (xyz) - default: '-efg' + default: "-efg" post: tags: - fake @@ -725,9 +725,9 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters responses: - '400': + "400": description: Invalid username supplied - '404': + "404": description: User not found security: - http_basic_test: [] @@ -771,11 +771,11 @@ paths: string: description: None type: string - pattern: '/[a-z]/i' + pattern: "/[a-z]/i" pattern_without_delimiter: description: None type: string - pattern: '^[A-Z].*' + pattern: "^[A-Z].*" byte: description: None type: string @@ -852,7 +852,7 @@ paths: type: integer format: int64 responses: - '400': + "400": description: Something wrong /fake/outer/number: post: @@ -861,17 +861,17 @@ paths: description: Test serialization of outer number types operationId: fakeOuterNumberSerialize responses: - '200': + "200": description: Output number content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/OuterNumber' + $ref: "#/components/schemas/OuterNumber" requestBody: content: application/json: schema: - $ref: '#/components/schemas/OuterNumber' + $ref: "#/components/schemas/OuterNumber" description: Input number as post body /fake/property/enum-int: post: @@ -880,18 +880,18 @@ paths: description: Test serialization of enum (int) properties with examples operationId: fakePropertyEnumIntegerSerialize responses: - '200': + "200": description: Output enum (int) content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/OuterObjectWithEnumProperty' + $ref: "#/components/schemas/OuterObjectWithEnumProperty" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/OuterObjectWithEnumProperty' + $ref: "#/components/schemas/OuterObjectWithEnumProperty" description: Input enum (int) as post body /fake/outer/string: post: @@ -900,17 +900,17 @@ paths: description: Test serialization of outer string types operationId: fakeOuterStringSerialize responses: - '200': + "200": description: Output string content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/OuterString' + $ref: "#/components/schemas/OuterString" requestBody: content: application/json: schema: - $ref: '#/components/schemas/OuterString' + $ref: "#/components/schemas/OuterString" description: Input string as post body /fake/outer/boolean: post: @@ -919,17 +919,17 @@ paths: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize responses: - '200': + "200": description: Output boolean content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/OuterBoolean' + $ref: "#/components/schemas/OuterBoolean" requestBody: content: application/json: schema: - $ref: '#/components/schemas/OuterBoolean' + $ref: "#/components/schemas/OuterBoolean" description: Input boolean as post body /fake/outer/composite: post: @@ -938,17 +938,17 @@ paths: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize responses: - '200': + "200": description: Output composite content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/OuterComposite' + $ref: "#/components/schemas/OuterComposite" requestBody: content: application/json: schema: - $ref: '#/components/schemas/OuterComposite' + $ref: "#/components/schemas/OuterComposite" description: Input composite as post body /fake/BigDecimalMap: get: @@ -957,10 +957,10 @@ paths: description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys operationId: fakeBigDecimalMap responses: - '200': + "200": description: successful operation content: - '*/*': + "*/*": schema: type: object properties: @@ -975,10 +975,10 @@ paths: tags: - fake summary: test json serialization of form data - description: '' + description: "" operationId: testJsonFormData responses: - '200': + "200": description: successful operation requestBody: content: @@ -1000,16 +1000,16 @@ paths: tags: - fake summary: test referenced additionalProperties - description: '' + description: "" operationId: testAdditionalPropertiesReference responses: - '200': + "200": description: successful operation requestBody: content: application/json: schema: - $ref: '#/components/schemas/FreeFormObject' + $ref: "#/components/schemas/FreeFormObject" description: request body required: true /fake/stringMap-reference: @@ -1017,16 +1017,16 @@ paths: tags: - fake summary: test referenced string map - description: '' + description: "" operationId: testStringMapReference responses: - '200': + "200": description: successful operation requestBody: content: application/json: schema: - $ref: '#/components/schemas/MapOfString' + $ref: "#/components/schemas/MapOfString" description: request body required: true /fake/inline-additionalProperties: @@ -1034,10 +1034,10 @@ paths: tags: - fake summary: test inline additionalProperties - description: '' + description: "" operationId: testInlineAdditionalProperties responses: - '200': + "200": description: successful operation requestBody: content: @@ -1053,10 +1053,10 @@ paths: tags: - fake summary: test inline free-form additionalProperties - description: '' + description: "" operationId: testInlineFreeformAdditionalProperties responses: - '200': + "200": description: successful operation requestBody: content: @@ -1080,7 +1080,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ChildWithNullable' + $ref: "#/components/schemas/ChildWithNullable" description: request body required: true responses: @@ -1098,13 +1098,13 @@ paths: schema: type: string responses: - '200': + "200": description: Success requestBody: content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" required: true /another-fake/dummy: patch: @@ -1112,16 +1112,16 @@ paths: - $another-fake? summary: To test special tags description: To test special tags and operation ID starting with number - operationId: '123_test_@#$%_special_tags' + operationId: "123_test_@#$%_special_tags" responses: - '200': + "200": description: successful operation content: application/json: schema: - $ref: '#/components/schemas/Client' + $ref: "#/components/schemas/Client" requestBody: - $ref: '#/components/requestBodies/Client' + $ref: "#/components/requestBodies/Client" /fake/body-with-file-schema: put: tags: @@ -1131,13 +1131,13 @@ paths: `File`. operationId: testBodyWithFileSchema responses: - '200': + "200": description: Success requestBody: content: application/json: schema: - $ref: '#/components/schemas/FileSchemaTestClass' + $ref: "#/components/schemas/FileSchemaTestClass" required: true /fake/body-with-binary: put: @@ -1147,7 +1147,7 @@ paths: For this test, the body has to be a binary file. operationId: testBodyWithBinary responses: - '200': + "200": description: Success requestBody: content: @@ -1224,12 +1224,12 @@ paths: responses: "200": description: Success - '/fake/{petId}/uploadImageWithRequiredFile': + "/fake/{petId}/uploadImageWithRequiredFile": post: tags: - pet summary: uploads an image (required) - description: '' + description: "" operationId: uploadFileWithRequiredFile parameters: - name: petId @@ -1240,16 +1240,16 @@ paths: type: integer format: int64 responses: - '200': + "200": description: successful operation content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' + $ref: "#/components/schemas/ApiResponse" security: - petstore_auth: - - 'write:pets' - - 'read:pets' + - "write:pets" + - "read:pets" requestBody: content: multipart/form-data: @@ -1276,7 +1276,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/HealthCheckResult' + $ref: "#/components/schemas/HealthCheckResult" /fake/http-signature-test: get: tags: @@ -1299,20 +1299,20 @@ paths: security: - http_signature_test: [] requestBody: - $ref: '#/components/requestBodies/Pet' + $ref: "#/components/requestBodies/Pet" responses: 200: description: The instance started successfully servers: - - url: 'http://{server}.swagger.io:{port}/v2' + - url: "http://{server}.swagger.io:{port}/v2" description: petstore server variables: server: enum: - - 'petstore' - - 'qa-petstore' - - 'dev-petstore' - default: 'petstore' + - "petstore" + - "qa-petstore" + - "dev-petstore" + default: "petstore" port: enum: - 80 @@ -1323,9 +1323,9 @@ servers: variables: version: enum: - - 'v1' - - 'v2' - default: 'v2' + - "v1" + - "v2" + default: "v2" - url: https://127.0.0.1/no_varaible description: The local server without variables components: @@ -1336,24 +1336,24 @@ components: schema: type: array items: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" description: List of user object required: true Client: content: application/json: schema: - $ref: '#/components/schemas/Client' + $ref: "#/components/schemas/Client" description: client model required: true Pet: content: application/json: schema: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" application/xml: schema: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" description: Pet object that needs to be added to the store required: true securitySchemes: @@ -1361,10 +1361,10 @@ components: type: oauth2 flows: implicit: - authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog" scopes: - 'write:pets': modify pets in your account - 'read:pets': read your pets + "write:pets": modify pets in your account + "read:pets": read your pets api_key: type: apiKey name: api_key @@ -1388,7 +1388,7 @@ components: type: object properties: bar: - $ref: '#/components/schemas/Bar' + $ref: "#/components/schemas/Bar" Bar: type: string default: bar @@ -1478,7 +1478,7 @@ components: format: int64 x-is-unique: true category: - $ref: '#/components/schemas/Category' + $ref: "#/components/schemas/Category" name: type: string example: doggie @@ -1497,7 +1497,7 @@ components: name: tag wrapped: true items: - $ref: '#/components/schemas/Tag' + $ref: "#/components/schemas/Tag" status: type: string description: pet status in the store @@ -1561,14 +1561,14 @@ components: type: string Dog: allOf: - - $ref: '#/components/schemas/Animal' + - $ref: "#/components/schemas/Animal" - type: object properties: breed: type: string Cat: allOf: - - $ref: '#/components/schemas/Animal' + - $ref: "#/components/schemas/Animal" - type: object properties: declawed: @@ -1578,8 +1578,8 @@ components: discriminator: propertyName: className mapping: - DOG: '#/components/schemas/Dog' - CAT: '#/components/schemas/Cat' + DOG: "#/components/schemas/Dog" + CAT: "#/components/schemas/Cat" required: - className properties: @@ -1591,7 +1591,7 @@ components: AnimalFarm: type: array items: - $ref: '#/components/schemas/Animal' + $ref: "#/components/schemas/Animal" format_test: type: object required: @@ -1631,7 +1631,7 @@ components: format: number string: type: string - pattern: '/[a-z]/i' + pattern: "/[a-z]/i" byte: type: string format: byte @@ -1663,10 +1663,10 @@ components: pattern: '/^image_\d{1,3}$/i' EnumClass: type: string - default: '-efg' + default: "-efg" enum: - _abc - - '-efg' + - "-efg" - (xyz) Enum_Test: type: object @@ -1678,13 +1678,13 @@ components: enum: - UPPER - lower - - '' + - "" enum_string_required: type: string enum: - UPPER - lower - - '' + - "" enum_integer: type: integer format: int32 @@ -1698,13 +1698,13 @@ components: - 1.1 - -1.2 outerEnum: - $ref: '#/components/schemas/OuterEnum' + $ref: "#/components/schemas/OuterEnum" outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' + $ref: "#/components/schemas/OuterEnumInteger" outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' + $ref: "#/components/schemas/OuterEnumDefaultValue" outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" AdditionalPropertiesClass: type: object properties: @@ -1730,7 +1730,7 @@ components: map: type: object additionalProperties: - $ref: '#/components/schemas/Animal' + $ref: "#/components/schemas/Animal" List: type: object properties: @@ -1796,7 +1796,7 @@ components: additionalProperties: type: boolean indirect_map: - $ref: '#/components/schemas/StringBooleanMap' + $ref: "#/components/schemas/StringBooleanMap" ArrayTest: type: object properties: @@ -1818,7 +1818,7 @@ components: items: type: array items: - $ref: '#/components/schemas/ReadOnlyFirst' + $ref: "#/components/schemas/ReadOnlyFirst" NumberOnly: type: object properties: @@ -1846,7 +1846,7 @@ components: just_symbol: type: string enum: - - '>=' + - ">=" - $ array_enum: type: array @@ -1874,33 +1874,33 @@ components: OuterEnumInteger: type: integer enum: - - 0 - - 1 - - 2 + - 0 + - 1 + - 2 example: 2 OuterEnumDefaultValue: type: string enum: - - placed - - approved - - delivered + - placed + - approved + - delivered default: placed OuterEnumIntegerDefaultValue: type: integer enum: - - 0 - - 1 - - 2 + - 0 + - 1 + - 2 default: 0 OuterComposite: type: object properties: my_number: - $ref: '#/components/schemas/OuterNumber' + $ref: "#/components/schemas/OuterNumber" my_string: - $ref: '#/components/schemas/OuterString' + $ref: "#/components/schemas/OuterString" my_boolean: - $ref: '#/components/schemas/OuterBoolean' + $ref: "#/components/schemas/OuterBoolean" OuterNumber: type: number OuterString: @@ -1922,7 +1922,7 @@ components: nullable: true ChildWithNullable: allOf: - - $ref: '#/components/schemas/ParentWithNullable' + - $ref: "#/components/schemas/ParentWithNullable" - type: object properties: otherProperty: @@ -1934,11 +1934,11 @@ components: type: object properties: file: - $ref: '#/components/schemas/File' + $ref: "#/components/schemas/File" files: type: array items: - $ref: '#/components/schemas/File' + $ref: "#/components/schemas/File" File: type: object description: Must be named `File` for test. @@ -1948,11 +1948,11 @@ components: type: string _special_model.name_: properties: - '$special[property.name]': + "$special[property.name]": type: integer format: int64 xml: - name: '$special[model.name]' + name: "$special[model.name]" HealthCheckResult: type: object properties: @@ -2026,7 +2026,7 @@ components: - value properties: value: - $ref: '#/components/schemas/OuterEnumInteger' + $ref: "#/components/schemas/OuterEnumInteger" DeprecatedObject: type: object deprecated: true @@ -2042,12 +2042,12 @@ components: type: number deprecated: true deprecatedRef: - $ref: '#/components/schemas/DeprecatedObject' + $ref: "#/components/schemas/DeprecatedObject" bars: type: array deprecated: true items: - $ref: '#/components/schemas/Bar' + $ref: "#/components/schemas/Bar" AllOfWithSingleRef: type: object properties: @@ -2055,7 +2055,12 @@ components: type: string SingleRefType: allOf: - - $ref: '#/components/schemas/SingleRefType' + - $ref: "#/components/schemas/SingleRefType" + Any: + type: object + properties: + "@type": + type: string SingleRefType: type: string title: SingleRefType diff --git a/samples/client/petstore/elixir/.openapi-generator/FILES b/samples/client/petstore/elixir/.openapi-generator/FILES index aadc7af9aa6a..baf3f42cbc21 100644 --- a/samples/client/petstore/elixir/.openapi-generator/FILES +++ b/samples/client/petstore/elixir/.openapi-generator/FILES @@ -17,6 +17,7 @@ lib/openapi_petstore/model/_special_model_name_.ex lib/openapi_petstore/model/additional_properties_class.ex lib/openapi_petstore/model/all_of_with_single_ref.ex lib/openapi_petstore/model/animal.ex +lib/openapi_petstore/model/any.ex lib/openapi_petstore/model/api_response.ex lib/openapi_petstore/model/array_of_array_of_number_only.ex lib/openapi_petstore/model/array_of_number_only.ex diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex new file mode 100644 index 000000000000..752351449d9d --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex @@ -0,0 +1,22 @@ +# NOTE: This file is auto generated by OpenAPI Generator 7.11.0-SNAPSHOT (https://openapi-generator.tech). +# Do not edit this file manually. + +defmodule OpenapiPetstore.Model.Any do + @moduledoc """ + + """ + + @derive Jason.Encoder + defstruct [ + :"@type" + ] + + @type t :: %__MODULE__{ + :"@type" => String.t | nil + } + + def decode(value) do + value + end +end + diff --git a/samples/client/petstore/elixir/test/any_test.exs b/samples/client/petstore/elixir/test/any_test.exs new file mode 100644 index 000000000000..de9b3e095b4d --- /dev/null +++ b/samples/client/petstore/elixir/test/any_test.exs @@ -0,0 +1,14 @@ +defmodule AnyTest do + use ExUnit.Case, async: true + alias OpenapiPetstore.Model.Any, as: Model + + test "decode all properties (not nil)" do + assert %Model{ + "@type": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + |> Model.decode() == + %Model{ + "@type": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + end +end From 474307675b9f1505fc7bd94eff6de63d9172cd02 Mon Sep 17 00:00:00 2001 From: Hiromi Hishida Date: Fri, 6 Dec 2024 15:33:55 +0900 Subject: [PATCH 39/40] [php] Follow PHP8.4 update: declared nullable parameters explicitly (#20243) * explictly declared nullable to parameters with "null" default value * generated php sample * fixed unnecessary "?" * re-generated sample --- .../main/resources/php/Configuration.mustache | 2 +- .../resources/php/ObjectSerializer.mustache | 6 +- .../src/main/resources/php/api.mustache | 18 +- .../libraries/psr-18/ApiException.mustache | 4 +- .../php/libraries/psr-18/api.mustache | 14 +- .../main/resources/php/model_generic.mustache | 4 +- .../lib/Api/AnotherFakeApi.php | 8 +- .../OpenAPIClient-php/lib/Api/DefaultApi.php | 8 +- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 298 +++++++++--------- .../lib/Api/FakeClassnameTags123Api.php | 8 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 68 ++-- .../OpenAPIClient-php/lib/Api/StoreApi.php | 8 +- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 8 +- .../OpenAPIClient-php/lib/Configuration.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 4 +- .../lib/Model/AllOfWithSingleRef.php | 4 +- .../OpenAPIClient-php/lib/Model/Animal.php | 4 +- .../lib/Model/ApiResponse.php | 4 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 4 +- .../lib/Model/ArrayOfNumberOnly.php | 4 +- .../OpenAPIClient-php/lib/Model/ArrayTest.php | 4 +- .../lib/Model/Capitalization.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Cat.php | 4 +- .../OpenAPIClient-php/lib/Model/Category.php | 4 +- .../lib/Model/ClassModel.php | 4 +- .../OpenAPIClient-php/lib/Model/Client.php | 4 +- .../lib/Model/DeprecatedObject.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Dog.php | 4 +- .../lib/Model/EnumArrays.php | 4 +- .../OpenAPIClient-php/lib/Model/EnumTest.php | 4 +- .../Model/FakeBigDecimalMap200Response.php | 4 +- .../php/OpenAPIClient-php/lib/Model/File.php | 4 +- .../lib/Model/FileSchemaTestClass.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Foo.php | 4 +- .../lib/Model/FooGetDefaultResponse.php | 4 +- .../lib/Model/FormatTest.php | 4 +- .../lib/Model/HasOnlyReadOnly.php | 4 +- .../lib/Model/HealthCheckResult.php | 4 +- .../OpenAPIClient-php/lib/Model/MapTest.php | 4 +- ...PropertiesAndAdditionalPropertiesClass.php | 4 +- .../lib/Model/Model200Response.php | 4 +- .../OpenAPIClient-php/lib/Model/ModelList.php | 4 +- .../lib/Model/ModelReturn.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Name.php | 4 +- .../lib/Model/NullableClass.php | 4 +- .../lib/Model/NumberOnly.php | 4 +- .../lib/Model/ObjectWithDeprecatedFields.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Order.php | 4 +- .../lib/Model/OuterComposite.php | 4 +- .../lib/Model/OuterObjectWithEnumProperty.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Pet.php | 4 +- .../lib/Model/PropertyNameMapping.php | 4 +- .../lib/Model/ReadOnlyFirst.php | 4 +- .../lib/Model/SpecialModelName.php | 4 +- .../php/OpenAPIClient-php/lib/Model/Tag.php | 4 +- ...ineFreeformAdditionalPropertiesRequest.php | 4 +- .../php/OpenAPIClient-php/lib/Model/User.php | 4 +- .../lib/ObjectSerializer.php | 6 +- .../php/psr-18/lib/Api/AnotherFakeApi.php | 14 +- .../php/psr-18/lib/Api/DefaultApi.php | 14 +- .../petstore/php/psr-18/lib/Api/FakeApi.php | 14 +- .../lib/Api/FakeClassnameTags123Api.php | 14 +- .../petstore/php/psr-18/lib/Api/PetApi.php | 14 +- .../petstore/php/psr-18/lib/Api/StoreApi.php | 14 +- .../petstore/php/psr-18/lib/Api/UserApi.php | 14 +- .../petstore/php/psr-18/lib/ApiException.php | 4 +- .../petstore/php/psr-18/lib/Configuration.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 4 +- .../psr-18/lib/Model/AllOfWithSingleRef.php | 4 +- .../petstore/php/psr-18/lib/Model/Animal.php | 4 +- .../php/psr-18/lib/Model/ApiResponse.php | 4 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 4 +- .../psr-18/lib/Model/ArrayOfNumberOnly.php | 4 +- .../php/psr-18/lib/Model/ArrayTest.php | 4 +- .../php/psr-18/lib/Model/Capitalization.php | 4 +- .../petstore/php/psr-18/lib/Model/Cat.php | 4 +- .../php/psr-18/lib/Model/Category.php | 4 +- .../php/psr-18/lib/Model/ClassModel.php | 4 +- .../petstore/php/psr-18/lib/Model/Client.php | 4 +- .../php/psr-18/lib/Model/DeprecatedObject.php | 4 +- .../petstore/php/psr-18/lib/Model/Dog.php | 4 +- .../php/psr-18/lib/Model/EnumArrays.php | 4 +- .../php/psr-18/lib/Model/EnumTest.php | 4 +- .../Model/FakeBigDecimalMap200Response.php | 4 +- .../petstore/php/psr-18/lib/Model/File.php | 4 +- .../psr-18/lib/Model/FileSchemaTestClass.php | 4 +- .../petstore/php/psr-18/lib/Model/Foo.php | 4 +- .../lib/Model/FooGetDefaultResponse.php | 4 +- .../php/psr-18/lib/Model/FormatTest.php | 4 +- .../php/psr-18/lib/Model/HasOnlyReadOnly.php | 4 +- .../psr-18/lib/Model/HealthCheckResult.php | 4 +- .../petstore/php/psr-18/lib/Model/MapTest.php | 4 +- ...PropertiesAndAdditionalPropertiesClass.php | 4 +- .../php/psr-18/lib/Model/Model200Response.php | 4 +- .../php/psr-18/lib/Model/ModelList.php | 4 +- .../php/psr-18/lib/Model/ModelReturn.php | 4 +- .../petstore/php/psr-18/lib/Model/Name.php | 4 +- .../php/psr-18/lib/Model/NullableClass.php | 4 +- .../php/psr-18/lib/Model/NumberOnly.php | 4 +- .../lib/Model/ObjectWithDeprecatedFields.php | 4 +- .../petstore/php/psr-18/lib/Model/Order.php | 4 +- .../php/psr-18/lib/Model/OuterComposite.php | 4 +- .../lib/Model/OuterObjectWithEnumProperty.php | 4 +- .../petstore/php/psr-18/lib/Model/Pet.php | 4 +- .../psr-18/lib/Model/PropertyNameMapping.php | 4 +- .../php/psr-18/lib/Model/ReadOnlyFirst.php | 4 +- .../php/psr-18/lib/Model/SpecialModelName.php | 4 +- .../petstore/php/psr-18/lib/Model/Tag.php | 4 +- ...ineFreeformAdditionalPropertiesRequest.php | 4 +- .../petstore/php/psr-18/lib/Model/User.php | 4 +- .../php/psr-18/lib/ObjectSerializer.php | 6 +- 111 files changed, 458 insertions(+), 458 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/Configuration.mustache b/modules/openapi-generator/src/main/resources/php/Configuration.mustache index 0f6aaf01f95f..95d0ce2df1fe 100644 --- a/modules/openapi-generator/src/main/resources/php/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/php/Configuration.mustache @@ -503,7 +503,7 @@ class Configuration * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 00aeea6cbccf..7c2a64ee47b4 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -49,8 +49,8 @@ class ObjectSerializer * Serialize data * * @param mixed $data the data to serialize - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @param string|null $type the OpenAPIToolsType of the data + * @param string|null $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -395,7 +395,7 @@ class ObjectSerializer * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index a8da00edff9c..b1b9dd3bf102 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -76,10 +76,10 @@ use {{invokerPackage}}\ObjectSerializer; * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -152,7 +152,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -211,7 +211,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -395,7 +395,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -457,7 +457,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -547,7 +547,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache index 83aaec422dd4..e3f055abafb7 100644 --- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache @@ -58,8 +58,8 @@ class ApiException extends RequestException public function __construct( $message, RequestInterface $request, - ResponseInterface $response = null, - Exception $previous = null + ?ResponseInterface $response = null, + ?Exception $previous = null ) { parent::__construct($message, $request, $previous); if ($response) { diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache index 8321b1d6072b..5ec833183d46 100644 --- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache @@ -95,13 +95,13 @@ use function sprintf; protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/modules/openapi-generator/src/main/resources/php/model_generic.mustache b/modules/openapi-generator/src/main/resources/php/model_generic.mustache index 6b0aa6d39c4b..0dc2675f4b5f 100644 --- a/modules/openapi-generator/src/main/resources/php/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_generic.mustache @@ -231,10 +231,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { {{#parentSchema}} parent::__construct($data); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 53d1c5a7a97a..d764b181173d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -83,10 +83,10 @@ class AnotherFakeApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 9c635a4de7ff..215c235358a2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -83,10 +83,10 @@ class DefaultApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 9c3012466230..8b66a8daa242 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -150,10 +150,10 @@ class FakeApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -1114,8 +1114,8 @@ public function fakeHealthGetRequest(string $contentType = self::contentTypes['f * test http signature authentication * * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) + * @param string|null $query_1 query parameter (optional) + * @param string|null $header_1 header parameter (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1133,8 +1133,8 @@ public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null, s * test http signature authentication * * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) + * @param string|null $query_1 query parameter (optional) + * @param string|null $header_1 header parameter (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1183,8 +1183,8 @@ public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header * test http signature authentication * * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) + * @param string|null $query_1 query parameter (optional) + * @param string|null $header_1 header parameter (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1206,8 +1206,8 @@ function ($response) { * test http signature authentication * * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) + * @param string|null $query_1 query parameter (optional) + * @param string|null $header_1 header parameter (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1245,8 +1245,8 @@ function ($exception) { * Create request for operation 'fakeHttpSignatureTest' * * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) + * @param string|null $query_1 query parameter (optional) + * @param string|null $header_1 header parameter (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1352,7 +1352,7 @@ public function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = /** * Operation fakeOuterBooleanSerialize * - * @param bool $body Input boolean as post body (optional) + * @param bool|null $body Input boolean as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1368,7 +1368,7 @@ public function fakeOuterBooleanSerialize($body = null, string $contentType = se /** * Operation fakeOuterBooleanSerializeWithHttpInfo * - * @param bool $body Input boolean as post body (optional) + * @param bool|null $body Input boolean as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1491,7 +1491,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null, string $cont /** * Operation fakeOuterBooleanSerializeAsync * - * @param bool $body Input boolean as post body (optional) + * @param bool|null $body Input boolean as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1510,7 +1510,7 @@ function ($response) { /** * Operation fakeOuterBooleanSerializeAsyncWithHttpInfo * - * @param bool $body Input boolean as post body (optional) + * @param bool|null $body Input boolean as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1560,7 +1560,7 @@ function ($exception) { /** * Create request for operation 'fakeOuterBooleanSerialize' * - * @param bool $body Input boolean as post body (optional) + * @param bool|null $body Input boolean as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1645,7 +1645,7 @@ public function fakeOuterBooleanSerializeRequest($body = null, string $contentTy /** * Operation fakeOuterCompositeSerialize * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite|null $outer_composite Input composite as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1661,7 +1661,7 @@ public function fakeOuterCompositeSerialize($outer_composite = null, string $con /** * Operation fakeOuterCompositeSerializeWithHttpInfo * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite|null $outer_composite Input composite as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1784,7 +1784,7 @@ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null, /** * Operation fakeOuterCompositeSerializeAsync * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite|null $outer_composite Input composite as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1803,7 +1803,7 @@ function ($response) { /** * Operation fakeOuterCompositeSerializeAsyncWithHttpInfo * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite|null $outer_composite Input composite as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1853,7 +1853,7 @@ function ($exception) { /** * Create request for operation 'fakeOuterCompositeSerialize' * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite|null $outer_composite Input composite as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1938,7 +1938,7 @@ public function fakeOuterCompositeSerializeRequest($outer_composite = null, stri /** * Operation fakeOuterNumberSerialize * - * @param float $body Input number as post body (optional) + * @param float|null $body Input number as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1954,7 +1954,7 @@ public function fakeOuterNumberSerialize($body = null, string $contentType = sel /** * Operation fakeOuterNumberSerializeWithHttpInfo * - * @param float $body Input number as post body (optional) + * @param float|null $body Input number as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2077,7 +2077,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null, string $conte /** * Operation fakeOuterNumberSerializeAsync * - * @param float $body Input number as post body (optional) + * @param float|null $body Input number as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2096,7 +2096,7 @@ function ($response) { /** * Operation fakeOuterNumberSerializeAsyncWithHttpInfo * - * @param float $body Input number as post body (optional) + * @param float|null $body Input number as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2146,7 +2146,7 @@ function ($exception) { /** * Create request for operation 'fakeOuterNumberSerialize' * - * @param float $body Input number as post body (optional) + * @param float|null $body Input number as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2231,7 +2231,7 @@ public function fakeOuterNumberSerializeRequest($body = null, string $contentTyp /** * Operation fakeOuterStringSerialize * - * @param string $body Input string as post body (optional) + * @param string|null $body Input string as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2247,7 +2247,7 @@ public function fakeOuterStringSerialize($body = null, string $contentType = sel /** * Operation fakeOuterStringSerializeWithHttpInfo * - * @param string $body Input string as post body (optional) + * @param string|null $body Input string as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2370,7 +2370,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null, string $conte /** * Operation fakeOuterStringSerializeAsync * - * @param string $body Input string as post body (optional) + * @param string|null $body Input string as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2389,7 +2389,7 @@ function ($response) { /** * Operation fakeOuterStringSerializeAsyncWithHttpInfo * - * @param string $body Input string as post body (optional) + * @param string|null $body Input string as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2439,7 +2439,7 @@ function ($exception) { /** * Create request for operation 'fakeOuterStringSerialize' * - * @param string $body Input string as post body (optional) + * @param string|null $body Input string as post body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4284,16 +4284,16 @@ public function testClientModelRequest($client, string $contentType = self::cont * @param float $double None (required) * @param string $pattern_without_delimiter None (required) * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param int|null $integer None (optional) + * @param int|null $int32 None (optional) + * @param int|null $int64 None (optional) + * @param float|null $float None (optional) + * @param string|null $string None (optional) + * @param \SplFileObject|null $binary None (optional) + * @param \DateTime|null $date None (optional) + * @param \DateTime|null $date_time None (optional) + * @param string|null $password None (optional) + * @param string|null $callback None (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -4314,16 +4314,16 @@ public function testEndpointParameters($number, $double, $pattern_without_delimi * @param float $double None (required) * @param string $pattern_without_delimiter None (required) * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param int|null $integer None (optional) + * @param int|null $int32 None (optional) + * @param int|null $int64 None (optional) + * @param float|null $float None (optional) + * @param string|null $string None (optional) + * @param \SplFileObject|null $binary None (optional) + * @param \DateTime|null $date None (optional) + * @param \DateTime|null $date_time None (optional) + * @param string|null $password None (optional) + * @param string|null $callback None (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -4375,16 +4375,16 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi * @param float $double None (required) * @param string $pattern_without_delimiter None (required) * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param int|null $integer None (optional) + * @param int|null $int32 None (optional) + * @param int|null $int64 None (optional) + * @param float|null $float None (optional) + * @param string|null $string None (optional) + * @param \SplFileObject|null $binary None (optional) + * @param \DateTime|null $date None (optional) + * @param \DateTime|null $date_time None (optional) + * @param string|null $password None (optional) + * @param string|null $callback None (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4409,16 +4409,16 @@ function ($response) { * @param float $double None (required) * @param string $pattern_without_delimiter None (required) * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param int|null $integer None (optional) + * @param int|null $int32 None (optional) + * @param int|null $int64 None (optional) + * @param float|null $float None (optional) + * @param string|null $string None (optional) + * @param \SplFileObject|null $binary None (optional) + * @param \DateTime|null $date None (optional) + * @param \DateTime|null $date_time None (optional) + * @param string|null $password None (optional) + * @param string|null $callback None (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4459,16 +4459,16 @@ function ($exception) { * @param float $double None (required) * @param string $pattern_without_delimiter None (required) * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param int|null $integer None (optional) + * @param int|null $int32 None (optional) + * @param int|null $int64 None (optional) + * @param float|null $float None (optional) + * @param string|null $string None (optional) + * @param \SplFileObject|null $binary None (optional) + * @param \DateTime|null $date None (optional) + * @param \DateTime|null $date_time None (optional) + * @param string|null $password None (optional) + * @param string|null $callback None (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4692,15 +4692,15 @@ public function testEndpointParametersRequest($number, $double, $pattern_without * * To test enum parameters * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param float $enum_query_double Query parameter enum test (double) (optional) - * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array enum_query_model_array (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string|null $enum_header_string Header parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string|null $enum_query_string Query parameter enum test (string) (optional, default to '-efg') + * @param int|null $enum_query_integer Query parameter enum test (double) (optional) + * @param float|null $enum_query_double Query parameter enum test (double) (optional) + * @param \OpenAPI\Client\Model\EnumClass[]|null $enum_query_model_array enum_query_model_array (optional) + * @param string[]|null $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') + * @param string|null $enum_form_string Form parameter enum test (string) (optional, default to '-efg') * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -4717,15 +4717,15 @@ public function testEnumParameters($enum_header_string_array = null, $enum_heade * * To test enum parameters * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param float $enum_query_double Query parameter enum test (double) (optional) - * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string|null $enum_header_string Header parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string|null $enum_query_string Query parameter enum test (string) (optional, default to '-efg') + * @param int|null $enum_query_integer Query parameter enum test (double) (optional) + * @param float|null $enum_query_double Query parameter enum test (double) (optional) + * @param \OpenAPI\Client\Model\EnumClass[]|null $enum_query_model_array (optional) + * @param string[]|null $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') + * @param string|null $enum_form_string Form parameter enum test (string) (optional, default to '-efg') * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -4773,15 +4773,15 @@ public function testEnumParametersWithHttpInfo($enum_header_string_array = null, * * To test enum parameters * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param float $enum_query_double Query parameter enum test (double) (optional) - * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string|null $enum_header_string Header parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string|null $enum_query_string Query parameter enum test (string) (optional, default to '-efg') + * @param int|null $enum_query_integer Query parameter enum test (double) (optional) + * @param float|null $enum_query_double Query parameter enum test (double) (optional) + * @param \OpenAPI\Client\Model\EnumClass[]|null $enum_query_model_array (optional) + * @param string[]|null $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') + * @param string|null $enum_form_string Form parameter enum test (string) (optional, default to '-efg') * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4802,15 +4802,15 @@ function ($response) { * * To test enum parameters * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param float $enum_query_double Query parameter enum test (double) (optional) - * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string|null $enum_header_string Header parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string|null $enum_query_string Query parameter enum test (string) (optional, default to '-efg') + * @param int|null $enum_query_integer Query parameter enum test (double) (optional) + * @param float|null $enum_query_double Query parameter enum test (double) (optional) + * @param \OpenAPI\Client\Model\EnumClass[]|null $enum_query_model_array (optional) + * @param string[]|null $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') + * @param string|null $enum_form_string Form parameter enum test (string) (optional, default to '-efg') * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4847,15 +4847,15 @@ function ($exception) { /** * Create request for operation 'testEnumParameters' * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param float $enum_query_double Query parameter enum test (double) (optional) - * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string|null $enum_header_string Header parameter enum test (string) (optional, default to '-efg') + * @param string[]|null $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string|null $enum_query_string Query parameter enum test (string) (optional, default to '-efg') + * @param int|null $enum_query_integer Query parameter enum test (double) (optional) + * @param float|null $enum_query_double Query parameter enum test (double) (optional) + * @param \OpenAPI\Client\Model\EnumClass[]|null $enum_query_model_array (optional) + * @param string[]|null $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') + * @param string|null $enum_form_string Form parameter enum test (string) (optional, default to '-efg') * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5012,9 +5012,9 @@ public function testEnumParametersRequest($enum_header_string_array = null, $enu * @param int $required_string_group Required String in group parameters (required) * @param bool $required_boolean_group Required Boolean in group parameters (required) * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) + * @param int|null $string_group String in group parameters (optional) + * @param bool|null $boolean_group Boolean in group parameters (optional) + * @param int|null $int64_group Integer in group parameters (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -5036,9 +5036,9 @@ public function testGroupParameters($associative_array) * @param int $required_string_group Required String in group parameters (required) * @param bool $required_boolean_group Required Boolean in group parameters (required) * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) + * @param int|null $string_group String in group parameters (optional) + * @param bool|null $boolean_group Boolean in group parameters (optional) + * @param int|null $int64_group Integer in group parameters (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -5091,9 +5091,9 @@ public function testGroupParametersWithHttpInfo($associative_array) * @param int $required_string_group Required String in group parameters (required) * @param bool $required_boolean_group Required Boolean in group parameters (required) * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) + * @param int|null $string_group String in group parameters (optional) + * @param bool|null $boolean_group Boolean in group parameters (optional) + * @param int|null $int64_group Integer in group parameters (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5119,9 +5119,9 @@ function ($response) { * @param int $required_string_group Required String in group parameters (required) * @param bool $required_boolean_group Required Boolean in group parameters (required) * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) + * @param int|null $string_group String in group parameters (optional) + * @param bool|null $boolean_group Boolean in group parameters (optional) + * @param int|null $int64_group Integer in group parameters (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5163,9 +5163,9 @@ function ($exception) { * @param int $required_string_group Required String in group parameters (required) * @param bool $required_boolean_group Required Boolean in group parameters (required) * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) + * @param int|null $string_group String in group parameters (optional) + * @param bool|null $boolean_group Boolean in group parameters (optional) + * @param int|null $int64_group Integer in group parameters (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5989,7 +5989,7 @@ public function testJsonFormDataRequest($param, $param2, string $contentType = s * @param string[] $url url (required) * @param string[] $context context (required) * @param string $allow_empty allow_empty (required) - * @param array $language language (optional) + * @param array|null $language language (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -6010,7 +6010,7 @@ public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, * @param string[] $url (required) * @param string[] $context (required) * @param string $allow_empty (required) - * @param array $language (optional) + * @param array|null $language (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -6062,7 +6062,7 @@ public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $ * @param string[] $url (required) * @param string[] $context (required) * @param string $allow_empty (required) - * @param array $language (optional) + * @param array|null $language (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6087,7 +6087,7 @@ function ($response) { * @param string[] $url (required) * @param string[] $context (required) * @param string $allow_empty (required) - * @param array $language (optional) + * @param array|null $language (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6130,7 +6130,7 @@ function ($exception) { * @param string[] $url (required) * @param string[] $context (required) * @param string $allow_empty (required) - * @param array $language (optional) + * @param array|null $language (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index e1b2b026b623..d16440ad3c62 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -83,10 +83,10 @@ class FakeClassnameTags123Api * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index ad61536b2cc0..872b2f8607b6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -109,10 +109,10 @@ class PetApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -516,7 +516,7 @@ protected function getHostSettingsForaddPet(): array * Deletes a pet * * @param int $pet_id Pet id to delete (required) - * @param string $api_key api_key (optional) + * @param string|null $api_key api_key (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -534,7 +534,7 @@ public function deletePet($pet_id, $api_key = null, string $contentType = self:: * Deletes a pet * * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param string|null $api_key (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -583,7 +583,7 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null, string $contentT * Deletes a pet * * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param string|null $api_key (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -605,7 +605,7 @@ function ($response) { * Deletes a pet * * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param string|null $api_key (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -643,7 +643,7 @@ function ($exception) { * Create request for operation 'deletePet' * * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param string|null $api_key (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2053,8 +2053,8 @@ protected function getHostSettingsForupdatePet(): array * Updates a pet in the store with form data * * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param string|null $name Updated name of the pet (optional) + * @param string|null $status Updated status of the pet (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2072,8 +2072,8 @@ public function updatePetWithForm($pet_id, $name = null, $status = null, string * Updates a pet in the store with form data * * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param string|null $name Updated name of the pet (optional) + * @param string|null $status Updated status of the pet (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2122,8 +2122,8 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n * Updates a pet in the store with form data * * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param string|null $name Updated name of the pet (optional) + * @param string|null $status Updated status of the pet (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2145,8 +2145,8 @@ function ($response) { * Updates a pet in the store with form data * * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param string|null $name Updated name of the pet (optional) + * @param string|null $status Updated status of the pet (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2184,8 +2184,8 @@ function ($exception) { * Create request for operation 'updatePetWithForm' * * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param string|null $name Updated name of the pet (optional) + * @param string|null $status Updated status of the pet (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2294,8 +2294,8 @@ public function updatePetWithFormRequest($pet_id, $name = null, $status = null, * uploads an image * * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject|null $file file to upload (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2314,8 +2314,8 @@ public function uploadFile($pet_id, $additional_metadata = null, $file = null, s * uploads an image * * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject|null $file file to upload (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2441,8 +2441,8 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi * uploads an image * * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject|null $file file to upload (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2464,8 +2464,8 @@ function ($response) { * uploads an image * * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject|null $file file to upload (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2516,8 +2516,8 @@ function ($exception) { * Create request for operation 'uploadFile' * * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject|null $file file to upload (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2635,7 +2635,7 @@ public function uploadFileRequest($pet_id, $additional_metadata = null, $file = * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2655,7 +2655,7 @@ public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_ * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2782,7 +2782,7 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2805,7 +2805,7 @@ function ($response) { * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2857,7 +2857,7 @@ function ($exception) { * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) + * @param string|null $additional_metadata Additional data to pass to server (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 2070d4172652..583a05dd3227 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -92,10 +92,10 @@ class StoreApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 032b149c67ea..9dee8d40907a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -104,10 +104,10 @@ class UserApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 9a730baf2840..ad37762c1776 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -523,7 +523,7 @@ public function getHostSettings() * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 813c137bd0e4..759743d16d94 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('map_property', $data ?? [], null); $this->setIfExists('map_of_map_property', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php index 268d00f145d7..1be5cfdfb67c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('username', $data ?? [], null); $this->setIfExists('single_ref_type', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 582a0c569d68..185b249d6504 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('class_name', $data ?? [], null); $this->setIfExists('color', $data ?? [], 'red'); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index f7d2a11b5cf7..5cd142d37f81 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('code', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 4b9feb4bdaa9..bef40be1a894 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('array_array_number', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 79de9be69c37..9e4296251cee 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('array_number', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index ec0ec76c6fe1..fd8c93a9e18f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('array_of_string', $data ?? [], null); $this->setIfExists('array_array_of_integer', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index f8d780c024fe..249205a69ceb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -269,10 +269,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('small_camel', $data ?? [], null); $this->setIfExists('capital_camel', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index b41fd0ca68fc..28e1ed0ab075 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -231,10 +231,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 4a2798ee2b0e..b2a9339971db 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], 'default-name'); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index be3b2a3ba014..a206c8e895eb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('_class', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 5e3242f8381d..04a3c7c00fcd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php index 8d6f9e8bddf2..afdf8bac88c1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 9b2bfe32e0fa..5208153ddb8d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -231,10 +231,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 0be30445cb4d..cce59070e7c0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -275,10 +275,10 @@ public function getArrayEnumAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('just_symbol', $data ?? [], null); $this->setIfExists('array_enum', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index eb16d4e4a142..6f212e4a619c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -345,10 +345,10 @@ public function getEnumNumberAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('enum_string', $data ?? [], null); $this->setIfExists('enum_string_required', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FakeBigDecimalMap200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FakeBigDecimalMap200Response.php index 78b06abf0855..73488ba3c96c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FakeBigDecimalMap200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FakeBigDecimalMap200Response.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('some_id', $data ?? [], null); $this->setIfExists('some_map', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index b9f93b896b3d..eb6b4d53d8d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('source_uri', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 0dd5cc74e1d8..be769eef3ba6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('file', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 3030ebeaad16..e805e0b60a9f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bar', $data ?? [], 'bar'); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php index 89f4a537ece6..a2620e1efa4f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('string', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 03440f0606e4..f472a0744c80 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -329,10 +329,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('integer', $data ?? [], null); $this->setIfExists('int32', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index d7ef68772431..060d720998ff 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bar', $data ?? [], null); $this->setIfExists('foo', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 73005009a497..36e08a3be8d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('nullable_message', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 77c4dd3e186b..2320c054ab9f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -272,10 +272,10 @@ public function getMapOfEnumStringAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('map_map_of_string', $data ?? [], null); $this->setIfExists('map_of_enum_string', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 8850d3763f21..c1247fa1727a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('uuid', $data ?? [], null); $this->setIfExists('date_time', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 18e7f3384e8d..be1136204ae7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -246,10 +246,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('class', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index bad7f36f856d..f8276f3fced8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('_123_list', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 2a9910d6ab43..62952110f611 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('return', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 6521d3676916..6df80a08a5fd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -258,10 +258,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('snake_case', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index b4e26919b85a..6be16b482431 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -305,10 +305,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('integer_prop', $data ?? [], null); $this->setIfExists('number_prop', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 4c2f3d43f409..3353c46a3131 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('just_number', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php index d751c56b34a7..19561647a506 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('uuid', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 64b0b06e28c9..72da67d42c3c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -286,10 +286,10 @@ public function getStatusAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('pet_id', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 94962a6b2ab0..902fc37d75d9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('my_number', $data ?? [], null); $this->setIfExists('my_string', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index e67c03f88384..9cd59d64cd00 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 948cc87b26e2..e9eee2dffc3f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -286,10 +286,10 @@ public function getStatusAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/PropertyNameMapping.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/PropertyNameMapping.php index 80a6379986c6..5769091ed7b6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/PropertyNameMapping.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/PropertyNameMapping.php @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('http_debug_operation', $data ?? [], null); $this->setIfExists('underscore_type', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index ac0ea37dd748..442c3ee93bb3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bar', $data ?? [], null); $this->setIfExists('baz', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index ae284950d30d..0575912acd99 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('special_property_name', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 963822698c2c..511472573dd8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php index d28e12f5f8f5..2d4f59aefec6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('some_property', $data ?? [], null); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 0ed5d4b6b14a..eb42656aeabe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -281,10 +281,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('username', $data ?? [], null); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 2f6d640871c3..ab003a2351e0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -58,8 +58,8 @@ public static function setDateTimeFormat($format) * Serialize data * * @param mixed $data the data to serialize - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @param string|null $type the OpenAPIToolsType of the data + * @param string|null $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -404,7 +404,7 @@ public static function serializeCollection(array $collection, $style, $allowColl * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ diff --git a/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php index 9f5b68878537..82310e7f36a5 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php @@ -104,13 +104,13 @@ class AnotherFakeApi protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php b/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php index c00ed14d0bc5..a6f8ade11d99 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php @@ -104,13 +104,13 @@ class DefaultApi protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php index d3698a5681df..a24a6b2220dd 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php @@ -104,13 +104,13 @@ class FakeApi protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php index 06b0e2c7f192..a4a1f02a819f 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php @@ -104,13 +104,13 @@ class FakeClassnameTags123Api protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/Api/PetApi.php b/samples/client/petstore/php/psr-18/lib/Api/PetApi.php index e2908dcdc3cd..a6a9a0b85529 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/PetApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/PetApi.php @@ -104,13 +104,13 @@ class PetApi protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php b/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php index 9b6a41d0e36a..41a15e7b3bf6 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php @@ -104,13 +104,13 @@ class StoreApi protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/Api/UserApi.php b/samples/client/petstore/php/psr-18/lib/Api/UserApi.php index 27bff545840a..c1ce38301526 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/UserApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/UserApi.php @@ -104,13 +104,13 @@ class UserApi protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { diff --git a/samples/client/petstore/php/psr-18/lib/ApiException.php b/samples/client/petstore/php/psr-18/lib/ApiException.php index 2491ae3a1319..fcff01db9176 100644 --- a/samples/client/petstore/php/psr-18/lib/ApiException.php +++ b/samples/client/petstore/php/psr-18/lib/ApiException.php @@ -67,8 +67,8 @@ class ApiException extends RequestException public function __construct( $message, RequestInterface $request, - ResponseInterface $response = null, - Exception $previous = null + ?ResponseInterface $response = null, + ?Exception $previous = null ) { parent::__construct($message, $request, $previous); if ($response) { diff --git a/samples/client/petstore/php/psr-18/lib/Configuration.php b/samples/client/petstore/php/psr-18/lib/Configuration.php index 9a730baf2840..ad37762c1776 100644 --- a/samples/client/petstore/php/psr-18/lib/Configuration.php +++ b/samples/client/petstore/php/psr-18/lib/Configuration.php @@ -523,7 +523,7 @@ public function getHostSettings() * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; diff --git a/samples/client/petstore/php/psr-18/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/psr-18/lib/Model/AdditionalPropertiesClass.php index 813c137bd0e4..759743d16d94 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/psr-18/lib/Model/AdditionalPropertiesClass.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('map_property', $data ?? [], null); $this->setIfExists('map_of_map_property', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/AllOfWithSingleRef.php b/samples/client/petstore/php/psr-18/lib/Model/AllOfWithSingleRef.php index 268d00f145d7..1be5cfdfb67c 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/AllOfWithSingleRef.php +++ b/samples/client/petstore/php/psr-18/lib/Model/AllOfWithSingleRef.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('username', $data ?? [], null); $this->setIfExists('single_ref_type', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Animal.php b/samples/client/petstore/php/psr-18/lib/Model/Animal.php index 582a0c569d68..185b249d6504 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Animal.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Animal.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('class_name', $data ?? [], null); $this->setIfExists('color', $data ?? [], 'red'); diff --git a/samples/client/petstore/php/psr-18/lib/Model/ApiResponse.php b/samples/client/petstore/php/psr-18/lib/Model/ApiResponse.php index f7d2a11b5cf7..5cd142d37f81 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ApiResponse.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('code', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/psr-18/lib/Model/ArrayOfArrayOfNumberOnly.php index 4b9feb4bdaa9..bef40be1a894 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('array_array_number', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/psr-18/lib/Model/ArrayOfNumberOnly.php index 79de9be69c37..9e4296251cee 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ArrayOfNumberOnly.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('array_number', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/ArrayTest.php b/samples/client/petstore/php/psr-18/lib/Model/ArrayTest.php index ec0ec76c6fe1..fd8c93a9e18f 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ArrayTest.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('array_of_string', $data ?? [], null); $this->setIfExists('array_array_of_integer', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Capitalization.php b/samples/client/petstore/php/psr-18/lib/Model/Capitalization.php index f8d780c024fe..249205a69ceb 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Capitalization.php @@ -269,10 +269,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('small_camel', $data ?? [], null); $this->setIfExists('capital_camel', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Cat.php b/samples/client/petstore/php/psr-18/lib/Model/Cat.php index b41fd0ca68fc..28e1ed0ab075 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Cat.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Cat.php @@ -231,10 +231,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Category.php b/samples/client/petstore/php/psr-18/lib/Model/Category.php index 4a2798ee2b0e..b2a9339971db 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Category.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Category.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], 'default-name'); diff --git a/samples/client/petstore/php/psr-18/lib/Model/ClassModel.php b/samples/client/petstore/php/psr-18/lib/Model/ClassModel.php index be3b2a3ba014..a206c8e895eb 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ClassModel.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('_class', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/Client.php b/samples/client/petstore/php/psr-18/lib/Model/Client.php index 5e3242f8381d..04a3c7c00fcd 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Client.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Client.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/psr-18/lib/Model/DeprecatedObject.php index 8d6f9e8bddf2..afdf8bac88c1 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/psr-18/lib/Model/DeprecatedObject.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/Dog.php b/samples/client/petstore/php/psr-18/lib/Model/Dog.php index 9b2bfe32e0fa..5208153ddb8d 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Dog.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Dog.php @@ -231,10 +231,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); diff --git a/samples/client/petstore/php/psr-18/lib/Model/EnumArrays.php b/samples/client/petstore/php/psr-18/lib/Model/EnumArrays.php index 0be30445cb4d..cce59070e7c0 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/psr-18/lib/Model/EnumArrays.php @@ -275,10 +275,10 @@ public function getArrayEnumAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('just_symbol', $data ?? [], null); $this->setIfExists('array_enum', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/EnumTest.php b/samples/client/petstore/php/psr-18/lib/Model/EnumTest.php index eb16d4e4a142..6f212e4a619c 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/psr-18/lib/Model/EnumTest.php @@ -345,10 +345,10 @@ public function getEnumNumberAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('enum_string', $data ?? [], null); $this->setIfExists('enum_string_required', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/FakeBigDecimalMap200Response.php b/samples/client/petstore/php/psr-18/lib/Model/FakeBigDecimalMap200Response.php index 78b06abf0855..73488ba3c96c 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/FakeBigDecimalMap200Response.php +++ b/samples/client/petstore/php/psr-18/lib/Model/FakeBigDecimalMap200Response.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('some_id', $data ?? [], null); $this->setIfExists('some_map', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/File.php b/samples/client/petstore/php/psr-18/lib/Model/File.php index b9f93b896b3d..eb6b4d53d8d3 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/File.php +++ b/samples/client/petstore/php/psr-18/lib/Model/File.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('source_uri', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/psr-18/lib/Model/FileSchemaTestClass.php index 0dd5cc74e1d8..be769eef3ba6 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/psr-18/lib/Model/FileSchemaTestClass.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('file', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Foo.php b/samples/client/petstore/php/psr-18/lib/Model/Foo.php index 3030ebeaad16..e805e0b60a9f 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Foo.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Foo.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bar', $data ?? [], 'bar'); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/FooGetDefaultResponse.php b/samples/client/petstore/php/psr-18/lib/Model/FooGetDefaultResponse.php index 89f4a537ece6..a2620e1efa4f 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/FooGetDefaultResponse.php +++ b/samples/client/petstore/php/psr-18/lib/Model/FooGetDefaultResponse.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('string', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/FormatTest.php b/samples/client/petstore/php/psr-18/lib/Model/FormatTest.php index 03440f0606e4..f472a0744c80 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/psr-18/lib/Model/FormatTest.php @@ -329,10 +329,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('integer', $data ?? [], null); $this->setIfExists('int32', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/psr-18/lib/Model/HasOnlyReadOnly.php index d7ef68772431..060d720998ff 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/psr-18/lib/Model/HasOnlyReadOnly.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bar', $data ?? [], null); $this->setIfExists('foo', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/psr-18/lib/Model/HealthCheckResult.php index 73005009a497..36e08a3be8d3 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/psr-18/lib/Model/HealthCheckResult.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('nullable_message', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/MapTest.php b/samples/client/petstore/php/psr-18/lib/Model/MapTest.php index 77c4dd3e186b..2320c054ab9f 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/MapTest.php +++ b/samples/client/petstore/php/psr-18/lib/Model/MapTest.php @@ -272,10 +272,10 @@ public function getMapOfEnumStringAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('map_map_of_string', $data ?? [], null); $this->setIfExists('map_of_enum_string', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/psr-18/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 8850d3763f21..c1247fa1727a 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/psr-18/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('uuid', $data ?? [], null); $this->setIfExists('date_time', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Model200Response.php b/samples/client/petstore/php/psr-18/lib/Model/Model200Response.php index 18e7f3384e8d..be1136204ae7 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Model200Response.php @@ -246,10 +246,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('class', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/ModelList.php b/samples/client/petstore/php/psr-18/lib/Model/ModelList.php index bad7f36f856d..f8276f3fced8 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ModelList.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ModelList.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('_123_list', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/ModelReturn.php b/samples/client/petstore/php/psr-18/lib/Model/ModelReturn.php index 2a9910d6ab43..62952110f611 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ModelReturn.php @@ -240,10 +240,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('return', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/Name.php b/samples/client/petstore/php/psr-18/lib/Model/Name.php index 6521d3676916..6df80a08a5fd 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Name.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Name.php @@ -258,10 +258,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('snake_case', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/NullableClass.php b/samples/client/petstore/php/psr-18/lib/Model/NullableClass.php index b4e26919b85a..6be16b482431 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/psr-18/lib/Model/NullableClass.php @@ -305,10 +305,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('integer_prop', $data ?? [], null); $this->setIfExists('number_prop', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/NumberOnly.php b/samples/client/petstore/php/psr-18/lib/Model/NumberOnly.php index 4c2f3d43f409..3353c46a3131 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/psr-18/lib/Model/NumberOnly.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('just_number', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/psr-18/lib/Model/ObjectWithDeprecatedFields.php index d751c56b34a7..19561647a506 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ObjectWithDeprecatedFields.php @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('uuid', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/Order.php b/samples/client/petstore/php/psr-18/lib/Model/Order.php index 64b0b06e28c9..72da67d42c3c 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Order.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Order.php @@ -286,10 +286,10 @@ public function getStatusAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('pet_id', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/OuterComposite.php b/samples/client/petstore/php/psr-18/lib/Model/OuterComposite.php index 94962a6b2ab0..902fc37d75d9 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/psr-18/lib/Model/OuterComposite.php @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('my_number', $data ?? [], null); $this->setIfExists('my_string', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/psr-18/lib/Model/OuterObjectWithEnumProperty.php index e67c03f88384..9cd59d64cd00 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/psr-18/lib/Model/OuterObjectWithEnumProperty.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/Pet.php b/samples/client/petstore/php/psr-18/lib/Model/Pet.php index 948cc87b26e2..e9eee2dffc3f 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Pet.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Pet.php @@ -286,10 +286,10 @@ public function getStatusAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/PropertyNameMapping.php b/samples/client/petstore/php/psr-18/lib/Model/PropertyNameMapping.php index 80a6379986c6..5769091ed7b6 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/PropertyNameMapping.php +++ b/samples/client/petstore/php/psr-18/lib/Model/PropertyNameMapping.php @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('http_debug_operation', $data ?? [], null); $this->setIfExists('underscore_type', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/psr-18/lib/Model/ReadOnlyFirst.php index ac0ea37dd748..442c3ee93bb3 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/psr-18/lib/Model/ReadOnlyFirst.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bar', $data ?? [], null); $this->setIfExists('baz', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/SpecialModelName.php b/samples/client/petstore/php/psr-18/lib/Model/SpecialModelName.php index ae284950d30d..0575912acd99 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/psr-18/lib/Model/SpecialModelName.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('special_property_name', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/Tag.php b/samples/client/petstore/php/psr-18/lib/Model/Tag.php index 963822698c2c..511472573dd8 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/Tag.php +++ b/samples/client/petstore/php/psr-18/lib/Model/Tag.php @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php b/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php index d28e12f5f8f5..2d4f59aefec6 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php +++ b/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('some_property', $data ?? [], null); } diff --git a/samples/client/petstore/php/psr-18/lib/Model/User.php b/samples/client/petstore/php/psr-18/lib/Model/User.php index 0ed5d4b6b14a..eb42656aeabe 100644 --- a/samples/client/petstore/php/psr-18/lib/Model/User.php +++ b/samples/client/petstore/php/psr-18/lib/Model/User.php @@ -281,10 +281,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('username', $data ?? [], null); diff --git a/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php b/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php index 2f6d640871c3..ab003a2351e0 100644 --- a/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php @@ -58,8 +58,8 @@ public static function setDateTimeFormat($format) * Serialize data * * @param mixed $data the data to serialize - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @param string|null $type the OpenAPIToolsType of the data + * @param string|null $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -404,7 +404,7 @@ public static function serializeCollection(array $collection, $style, $allowColl * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ From d29196a1f0ad41fc17f5d4875650f87480d66a40 Mon Sep 17 00:00:00 2001 From: ASterdyniak Date: Fri, 6 Dec 2024 11:02:18 +0100 Subject: [PATCH 40/40] [typescript-fetch] [BUG] Fix duplication of ModelNamePrefix in import statements (#20109) --- .../TypeScriptFetchClientCodegen.java | 2 +- .../TypeScriptFetchClientCodegenTest.java | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 875c881a3970..69a0f3e80317 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -477,7 +477,7 @@ private List> toTsImports(CodegenModel cm, Set impor HashMap tsImport = new HashMap<>(); // TVG: This is used as class name in the import statements of the model file tsImport.put("classname", im); - tsImport.put("filename", toModelFilename(im)); + tsImport.put("filename", convertUsingFileNamingConvention(im)); tsImports.add(tsImport); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java index 411d35827e37..ac0560194f60 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java @@ -266,6 +266,22 @@ public void testApiFileNameInVariousFormat() { codegen.toApiFilename("FirstSimpleController")); } + @Test(description = "Verify names of files generated in kebab-case and imports with additional model prefix") + public void testGeneratedFilenamesInPascalCaseWithAdditionalModelPrefix() throws IOException { + + Map properties = new HashMap<>(); + properties.put("fileNaming", TypeScriptFetchClientCodegen.PASCAL_CASE); + properties.put(CodegenConstants.MODEL_NAME_PREFIX, "SomePrefix"); + + File output = generate(properties); + + Path pet = Paths.get(output + "/models/SomePrefixPet.ts"); + TestUtils.assertFileExists(pet); + TestUtils.assertFileContains(pet, "} from './SomePrefixPetCategory';"); + TestUtils.assertFileExists(Paths.get(output + "/models/SomePrefixPetCategory.ts")); + TestUtils.assertFileExists(Paths.get(output + "/apis/PetControllerApi.ts")); + } + @Test(description = "Verify names of files generated in kebab-case and imports") public void testGeneratedFilenamesInKebabCase() throws IOException { @@ -281,6 +297,22 @@ public void testGeneratedFilenamesInKebabCase() throws IOException { TestUtils.assertFileExists(Paths.get(output + "/apis/pet-controller-api.ts")); } + @Test(description = "Verify names of files generated in kebab-case and imports with additional model prefix") + public void testGeneratedFilenamesInKebabCaseWithAdditionalModelPrefix() throws IOException { + + Map properties = new HashMap<>(); + properties.put("fileNaming", TypeScriptFetchClientCodegen.KEBAB_CASE); + properties.put(CodegenConstants.MODEL_NAME_PREFIX, "SomePrefix"); + + File output = generate(properties); + + Path pet = Paths.get(output + "/models/some-prefix-pet.ts"); + TestUtils.assertFileExists(pet); + TestUtils.assertFileContains(pet, "} from './some-prefix-pet-category';"); + TestUtils.assertFileExists(Paths.get(output + "/models/some-prefix-pet-category.ts")); + TestUtils.assertFileExists(Paths.get(output + "/apis/pet-controller-api.ts")); + } + @Test(description = "Verify names of files generated in camelCase and imports") public void testGeneratedFilenamesInCamelCase() throws IOException { @@ -296,6 +328,22 @@ public void testGeneratedFilenamesInCamelCase() throws IOException { TestUtils.assertFileExists(Paths.get(output + "/apis/petControllerApi.ts")); } + @Test(description = "Verify names of files generated in camelCase and imports with additional model prefix") + public void testGeneratedFilenamesInCamelCaseWithAdditionalModelPrefix() throws IOException { + + Map properties = new HashMap<>(); + properties.put("fileNaming", TypeScriptFetchClientCodegen.CAMEL_CASE); + properties.put(CodegenConstants.MODEL_NAME_PREFIX, "SomePrefix"); + + File output = generate(properties); + + Path pet = Paths.get(output + "/models/somePrefixPet.ts"); + TestUtils.assertFileExists(pet); + TestUtils.assertFileContains(pet, "} from './somePrefixPetCategory';"); + TestUtils.assertFileExists(Paths.get(output + "/models/somePrefixPetCategory.ts")); + TestUtils.assertFileExists(Paths.get(output + "/apis/petControllerApi.ts")); + } + private static File generate(Map properties) throws IOException { File output = Files.createTempDirectory("test").toFile(); output.deleteOnExit();