Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fix for cpp-restsdk #130

Open
wants to merge 404 commits into
base: master
Choose a base branch
from

Conversation

fedeitc
Copy link

@fedeitc fedeitc commented Apr 26, 2022

A specialization for the shared_ptr<datetime> data type was added to
ModelBase member functions fromString, fromJson, toJson and
toHttpContent.

As ModelBase was auto generated, the real fix should be addressed by
OpenAPI-Generator.

mateuszosojca and others added 30 commits October 31, 2019 23:09
BadRequestException was being thrown due to "Wrong format of time_start parameter" in Ohlcv_historical_data(string, string, DateTime, DateTime, int). The data format was hard-coded to "yyyy-MM-dd HH:ss:mm", which is invalid. It was changed to dateFormat, which is what it appears to have been changed to in all other methods.
Corrections, no semi-colons in python, please
Svisstack and others added 20 commits December 31, 2021 13:35
)

* Add AskBid model to orderbooks instead of objects

* Add book5, book20, book50 support

* Add BidAskL3 model and update OrderBook3

* Upgrade project version to 2.0.0
* Update CoinApiWsClient.cs

* Update CoinAPI.WebSocket.V1.csproj
* Update Symbol.cs

* Update CoinAPI.REST.V1.csproj
* support for reconnecting has been added

* Update pom.xml

Co-authored-by: Artur Pietrzyk <Svisstack@users.noreply.github.com>
A specialization for the shared_ptr<datetime> data type was added to
ModelBase member functions fromString, fromJson, toJson and
toHttpContent.

As ModelBase was auto generated, the real fix should be addressed by
OpenAPI-Generator.
@fedeitc
Copy link
Author

fedeitc commented Apr 26, 2022

This should fix these errors:

In file included from coinapi-sdk/oeml-sdk/cpp-restsdk/model/Fills.h:23,
                 from coinapi-sdk/oeml-sdk/cpp-restsdk/model/Fills.cpp:15:
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h: In instantiation of 'static web::json::value org::openapitools::client::model::ModelBase::toJson(const std::shared_ptr<_Tp>&) [with T = utility::datetime]':
coinapi-sdk/oeml-sdk/cpp-restsdk/model/Fills.cpp:50:85    required from here
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h:185:23: error: 'using element_type = class utility::datetime' {aka 'class utility::datetime'} has no member named 'toJson'
         retVal = val->toJson();
                  ~~~~~^~~~~~
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h: In instantiation of 'static bool org::openapitools::client::model::ModelBase::fromJson(const web::json::value&, std::shared_ptr<_Tp>&) [with T = utility::datetime]':
coinapi-sdk/oeml-sdk/cpp-restsdk/model/Fills.cpp:74:62    required from here
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h:233:22: error: 'using element_type = class utility::datetime' {aka 'class utility::datetime'} has no member named 'fromJson'; did you mean 'from_string'?
         ok = outVal->fromJson(val);
              ~~~~~~~~^~~~~~~~
              from_string
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h: In instantiation of 'static std::shared_ptr<org::openapitools::client::model::HttpContent> org::openapitools::client::model::ModelBase::toHttpContent(const string_t&, const std::shared_ptr<_Tp>&, const string_t&) [with T = utility::datetime; utility::string_t = std::__cxx11::basic_string<char>]':
coinapi-sdk/oeml-sdk/cpp-restsdk/model/Fills.cpp:110:114:   required from here
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h:285:125: error: 'using element_type = class utility::datetime' {aka 'class utility::datetime'} has no member named 'toJson'
  new std::stringstream( utility::conversions::to_utf8string( value->toJson().serialize() ) ) ) );
                                                              ~~~~~~~^~~~~~

coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h: In instantiation of 'static bool org::openapitools::client::model::ModelBase::fromString(const string_t&, std::shared_ptr<_Tp>&) [with T = utility::datetime; utility::string_t = std::__cxx11::basic_string<char>]':
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h:321:22:   required from 'static bool org::openapitools::client::model::ModelBase::fromHttpContent(std::shared_ptr<org::openapitools::client::model::HttpContent>, std::shared_ptr<_Tp>&) [with T = utility::datetime]'
coinapi-sdk/oeml-sdk/cpp-restsdk/model/Fills.cpp:134:123:   required from here
coinapi-sdk/oeml-sdk/cpp-restsdk/ModelBase.h:219:22: error: 'using element_type = class utility::datetime' {aka 'class utility::datetime'} has no member named 'fromJson'; did you mean 'from_string'?
         ok = outVal->fromJson(web::json::value::parse(val));
              ~~~~~~~~^~~~~~~~
              from_string

fedeitc added a commit to fedeitc/openapi-generator that referenced this pull request Apr 26, 2022
A specialization for the shared_ptr<datetime> data type was added to
ModelBase member functions fromString, fromJson, toJson and
toHttpContent.

This should fix compilation errors on generated source code.
See coinapi/coinapi-sdk#130
@fedeitc
Copy link
Author

fedeitc commented Apr 26, 2022

A patch was submitted to OpenAPITools/openapi-generator#12247

wing328 pushed a commit to OpenAPITools/openapi-generator that referenced this pull request Apr 30, 2022
A specialization for the shared_ptr<datetime> data type was added to
ModelBase member functions fromString, fromJson, toJson and
toHttpContent.

This should fix compilation errors on generated source code.
See coinapi/coinapi-sdk#130
@Svisstack
Copy link
Contributor

This do not make sense to merge it as it will be replaced again with the openapi generator on the next change. Good to see that the fix was merged in the generator repository; lets keep this open to not lose information that this is a known issue.

@fedeitc
Copy link
Author

fedeitc commented May 6, 2022

Yes, once it will be regenerated with the latest openapi generator, it will be fixed.

@Svisstack Svisstack force-pushed the master branch 2 times, most recently from 819b4fc to ded59d3 Compare March 30, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.