Skip to content

Commit

Permalink
Fix a bug in cpprest-sdk generator (Issue #8450)
Browse files Browse the repository at this point in the history
  • Loading branch information
shayan-eftekhari committed Aug 31, 2021
1 parent 9b963b9 commit 7d8f842
Show file tree
Hide file tree
Showing 42 changed files with 589 additions and 568 deletions.
2 changes: 1 addition & 1 deletion docs/generators/fsharp-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sourceFolder|source folder for generated code| |OpenAPI\src|

## IMPORT MAPPING

Expand Down
2 changes: 1 addition & 1 deletion docs/generators/fsharp-giraffe-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageVersion|F# package version.| |1.0.0|
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sourceFolder|source folder for generated code| |OpenAPI\src|
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false|
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/java-inflector.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/gen/java|
|sourceFolder|source folder for generated code| |src\gen\java|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|

## IMPORT MAPPING
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/jaxrs-cxf-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/gen/java|
|sourceFolder|source folder for generated code| |src\gen\java|
|useBeanValidation|Use BeanValidation API annotations| |false|
|useGenericResponse|Use generic response| |false|
|useGzipFeatureForTests|Use Gzip Feature for tests| |false|
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/swift5.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result, Combine are available.| |null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|swiftPackagePath|Set a custom source path instead of OpenAPIClient/Classes/OpenAPIs.| |null|
|swiftPackagePath|Set a custom source path instead of OpenAPIClient\Classes\OpenAPIs.| |null|
|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null|
|useBacktickEscapes|Escape reserved words using backticks (default: false)| |false|
|useClasses|Use final classes for models instead of structs (default: false)| |false|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: false).| |null|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources\{{projectName}} (default: false).| |null|

## IMPORT MAPPING

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/R/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.travis.yml
DESCRIPTION
NAMESPACE
README.md
R/api_client.R
R/api_response.R
R/category.R
Expand All @@ -14,7 +15,6 @@ R/store_api.R
R/tag.R
R/user.R
R/user_api.R
README.md
docs/Category.md
docs/ModelApiResponse.md
docs/Order.md
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/client/ModelBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal )
}
bool ModelBase::fromJson( const web::json::value& val, int64_t & outVal )
{
outVal = !val.is_null() ? std::numeric_limits<int64_t>::quiet_NaN() : val.as_number().to_int64();
outVal = !val.is_number() ? std::numeric_limits<int64_t>::quiet_NaN() : val.as_number().to_int64();
return val.is_number();
}
bool ModelBase::fromJson( const web::json::value& val, utility::string_t & outVal )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ docs/Model/SpecialModelName.md
docs/Model/Tag.md
docs/Model/User.md
git_push.sh
lib/ApiException.php
lib/Api/AnotherFakeApi.php
lib/Api/DefaultApi.php
lib/Api/FakeApi.php
lib/Api/FakeClassnameTags123Api.php
lib/Api/PetApi.php
lib/Api/StoreApi.php
lib/Api/UserApi.php
lib/ApiException.php
lib/Configuration.php
lib/HeaderSelector.php
lib/Model/AdditionalPropertiesClass.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./lib/Api</directory>
<directory suffix=".php">./lib/Model</directory>
<directory suffix=".php">./lib\/Api</directory>
<directory suffix=".php">./lib\/Model</directory>
</whitelist>
</filter>
<php>
Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/powershell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ Class | Method | HTTP request | Description

## Documentation for Models

- [PSPetstore/Model.ApiResponse](docs/ApiResponse.md)
- [PSPetstore/Model.Category](docs/Category.md)
- [PSPetstore/Model.Order](docs/Order.md)
- [PSPetstore/Model.Pet](docs/Pet.md)
- [PSPetstore/Model.Tag](docs/Tag.md)
- [PSPetstore/Model.User](docs/User.md)
- [PSPetstore\Model.ApiResponse](docs/ApiResponse.md)
- [PSPetstore\Model.Category](docs/Category.md)
- [PSPetstore\Model.Order](docs/Order.md)
- [PSPetstore\Model.Pet](docs/Pet.md)
- [PSPetstore\Model.Tag](docs/Tag.md)
- [PSPetstore\Model.User](docs/User.md)


## Documentation for Authorization
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/powershell/docs/PSPetApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSPetApi
# PSPetstore.PSPetstore\Api.PSPetApi

All URIs are relative to *http://petstore.swagger.io:80/v2*

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/powershell/docs/PSStoreApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSStoreApi
# PSPetstore.PSPetstore\Api.PSStoreApi

All URIs are relative to *http://petstore.swagger.io:80/v2*

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/powershell/docs/PSUserApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSUserApi
# PSPetstore.PSPetstore\Api.PSUserApi

All URIs are relative to *http://petstore.swagger.io:80/v2*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface Capitalization {
sCAETHFlowPoints?: string;
/**
* Name of the pet
* @type {string}
* @memberof Capitalization
*/
Expand Down
78 changes: 39 additions & 39 deletions samples/openapi3/client/elm/src/Api/Data.elm
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,33 @@ import Json.Encode
-}
type alias Absent =
{ default : Maybe String
, required : String
, nullable : Maybe String
, requiredNullable : Maybe String
}
, required : String
, nullable : Maybe String
, requiredNullable : Maybe String
}


{-| Model with arrays
-}
type alias Array =
{ array : List (String)
, arrayOfArray : List (List (String))
, arrayOfPrimitve : Maybe (List (Primitive))
, arrayOfEnum : Maybe (List (Enum))
}
, arrayOfArray : List (List (String))
, arrayOfPrimitve : Maybe (List (Primitive))
, arrayOfEnum : Maybe (List (Enum))
}


{-| Composed model
-}
type alias Composed =
{ base : Float
, value : Maybe String
}
, value : Maybe String
}


type alias ComposedBase =
{ base : Float
}
}


{-| Discriminated model
Expand All @@ -119,19 +119,19 @@ type Discriminated

type alias BaseDiscriminated =
{ kind : String
}
}


type alias DiscriminatedA =
{ baseDiscriminated: BaseDiscriminated
, a : Maybe String
}
, a : Maybe String
}


type alias DiscriminatedB =
{ baseDiscriminated: BaseDiscriminated
, b : Maybe String
}
, b : Maybe String
}


type Enum
Expand Down Expand Up @@ -166,8 +166,8 @@ enumericVariants =
-}
type alias Maybe_ =
{ type_ : Maybe String
, if_ : Maybe Bool
}
, if_ : Maybe Bool
}


{-| One of two models
Expand All @@ -180,33 +180,33 @@ type OneOf

type alias OneOfA =
{ a : Maybe String
}
}


type alias OneOfB =
{ b : Maybe String
}
}


{-| Model with primitive properties
-}
type alias Primitive =
{ string : Maybe String
, number : Maybe Float
, float : Maybe Float
, double : Maybe Float
, integer : Maybe Int
, short : Maybe Int
, long : Maybe Int
, boolean : Maybe Bool
}
, number : Maybe Float
, float : Maybe Float
, double : Maybe Float
, integer : Maybe Int
, short : Maybe Int
, long : Maybe Int
, boolean : Maybe Bool
}


type alias Recursion =
{ maybe : RecursionMaybe
, list : RecursionList
, ref : RecursionRef
}
, list : RecursionList
, ref : RecursionRef
}


type RecursionMaybe = RecursionMaybe (Maybe Recursion)
Expand All @@ -232,7 +232,7 @@ unwrapRecursionRef (RecursionRef ref) = ref

type alias RecursionLoop =
{ ref : RecursionLoopRef
}
}


type RecursionLoopRef = RecursionLoopRef (Maybe Recursion)
Expand All @@ -246,13 +246,13 @@ unwrapRecursionLoopRef (RecursionLoopRef ref) = ref
-}
type alias UnsafeCharacters =
{ prefix : Maybe String
, suffix : Maybe String
, rnd0mTff : Maybe String
, before : Maybe String
, after : Maybe String
, both : Maybe String
, inTheMiddle : Maybe String
}
, suffix : Maybe String
, rnd0mTff : Maybe String
, before : Maybe String
, after : Maybe String
, both : Maybe String
, inTheMiddle : Maybe String
}


-- ENCODER
Expand Down
Loading

0 comments on commit 7d8f842

Please sign in to comment.