Code Monkey home page Code Monkey logo

jsonrpc-lean's People

Contributors

bmod avatar uskr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jsonrpc-lean's Issues

'memset' not declared on Ubuntu

Nice library 🍰
When compiling with GCC C++14 flavour on Linux I had to make a small change in util.h in line 24

#include <string.h>

Apparently memset is part of <string.h> and not STL's <string>.
See also on Stackoverflow this answer:

You should use #include <string.h> in both C and C++, if you want to use ::memset. #include gets you std::memset, and if it also makes ::memset available, it does so by accident. The Standard permits it but does not require it to do so

Right now I have not time to compile on Mac and Windows, therefore I did not assemble a pull request though.

Number string parameters get detected as date

When giving a number as text (e.g. "33") for a request parameter the JSON parser interprets it as a date type.

E.g. (see examples/testserver.cpp)

std::string Concat(const std::string& a, const std::string& b) {
	return a + b;
}
dispatcher.AddMethod("concat", &Concat);
const char request[] = R"({"jsonrpc":"2.0","method":"concat","id":1,"params":["Hello, ","33"]})";
server.HandleRequest(concatRequest);
// -> {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"Invalid parameters"}}

jsonrpc::util::ParseIso8601DateTime as called from JSON reader in Value GetValue(const rapidjson::Value&) returns true which is wrong. Live demo here.

I did not expect treatment for data strings since IMO it is not part of the JSON standard. I guess interpreting strings as data and serializing dates into strings, would better done in the application layer, or I'd rather pick a whole other data format like MessagePack.

I would not be sad if support for Value::Type::DATE_TIME is simply kicked out of jsonrpc-lean. 😑

Make a release

Hi! Thank you for the library!

Can you please make a release of the library? It helps a lot with packaging your libray into dependency managers like Conan.

For packaging we require version of a library. Without your help we cannot do it, unfortunately.

Thank you a lot!

LGPL version 2.1 contradiction

Hello,
nice approach, but not really useful.

Since you advertise you library as header only, then I would suggest to change license LGPL v2.1 to LGPL v3.0. Because LGPL v2.1 requires to link library dynamically, which is problematic with headers only libraries and is solved in LGPL v3.0, as stated here:
http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ&oldid=1117#But_doesn.27t_the_LGPL_have_issues_with_code_that_is_in_header_files.2C_and_template_libraries.3F

uint32_t and uint64_t types

Is there a reason why uint32_t and uint64_t are omitted from Value type? I see they are being converted to int64_t and double receptively. The problem is I'm unable to 'AddMethod' following :

uint32_t foo() {}

Thank you,
J

server settings

Hi

Im trying to use your jsonrpc implementation, thanks for making that!!
But i may be missing something, because i don't see anywhere how to set the server ip and port.......
How can i know which ip and port are the server running??¿¿¿

Thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.