Giter Site home page Giter Site logo

erlang-rfc4627's People

Contributors

0x6e6562 avatar avkhozov avatar dnet avatar evolchek avatar matwey avatar olcai avatar sedinin avatar tonyg avatar zkessin 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  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  avatar  avatar  avatar  avatar  avatar  avatar

erlang-rfc4627's Issues

Respository Name and application name conflicts

Hi,

This is not a critical bug, but just a information when I tried to add this as dependency with repository name "erlang-rfc4627" to my rebar.config of my project it raised me the below error.

Pulling "erlang-rfc4627" from {git,"git://github.com/marutha/erlang-rfc4627.git",
                                    "master"}
Initialized empty Git repository in /rfc_test/deps/erlang-rfc4627/.git/
ERROR: Dependency dir /rfc_test/deps/erlang-rfc4627 failed application validation with reason:
{name_mismatch,{"/rfc_test/deps/erlang-rfc4627/ebin/rfc4627_jsonrpc.app",
                 {expected,"erlang-rfc4627"},
                {has,rfc4627_jsonrpc}}}.

ERROR: 'get-deps' failed while processing /rfc_test/: rebar_abort

after changing the value to rfc4627_jsonrpc in rebar config the error disappeared.

I guess either repository name has to be changed or some note on read me would be helpful for new users.

Thanks,
Marutha

deprecated tests...

I read http://tonyg.github.com/erlang-rfc4627/doc/index.html to try play with code...

make all test-compile
erlc -I include -o ebin -Dnew_inets -Wall +debug_info test/test_jsonrpc_inets.erl test/test_rfc4627.erl
test/test_jsonrpc_inets.erl:50: Warning: call to httpd:start/1 will fail, since it was removed in R14B; use inets:start/2,3

Eshell V5.8.4 (abort with ^G)
1> test_jsonrpc_inets:start_httpd().
** exception error: undefined function httpd:start/1
in function test_jsonrpc_inets:start_httpd/0

I hope you find time to fix this little misunderstanding :)

when using chinese

7> rfc4627:decode( " {"user":"ๅ“ˆๅ“ˆ"}" ).
** exception exit: {ucs,{bad_utf8_character_code}}
in function xmerl_ucs:from_utf8/1 (xmerl_ucs.erl, line 185)
in call from rfc4627:unicode_decode/1 (lib/json/rfc4627.erl, line 323)
in call from rfc4627:decode/1 (lib/json/rfc4627.erl, line 258)

Build failed at 17.0: wrong httpd.hrl location

Hi,

It seems that the location of httpd.hrl is determined wrongly at 17.0

[   54s] Building for OTP release 17.
[   54s] Using path to INETS httpd.hrl that existed before R14A.
[   54s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627.erl
[   54s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_registry.erl
[   54s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc.erl
[   54s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_mochiweb.erl
[   54s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_cowboy.erl
[   54s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_sup.erl
[   55s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_http.erl
[   55s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_inets.erl
[   55s] erlc -I include -o ebin -Dinets_pre_r14a -Wall +debug_info  src/rfc4627_jsonrpc_app.erl
[   55s] src/rfc4627_jsonrpc_inets.erl:95: can't find include lib "inets/src/httpd.hrl"
[   55s] src/rfc4627_jsonrpc_inets.erl:110: record mod undefined
[   55s] src/rfc4627_jsonrpc_inets.erl:111: variable 'OldData' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:112: variable 'OldData' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:124: record mod undefined
[   55s] src/rfc4627_jsonrpc_inets.erl:132: variable 'ConfigDb' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:133: variable 'PathAndQuery' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:141: variable 'InetsHeaders' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:142: variable 'SocketType' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:148: variable 'HttpMethod' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:151: variable 'PeerPort' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:152: variable 'PeerName' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:158: variable 'Body' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:160: variable 'OldData' is unbound
[   55s] src/rfc4627_jsonrpc_inets.erl:172: variable 'OldData' is unbound
[   55s] Makefile:36: recipe for target 'ebin/rfc4627_jsonrpc_inets.beam' failed

to_records recurrsive not working

Hello @tonyg

cannot convert to record from json if record is nested.

eg.

record

-record(inputuser,{t= <<"TL_inputUserContact">>,
  user_id=null :: integer(),
  access_hash = null :: integer()}).

-record(getfulluser,{
  id= #inputuser{}}).

code =

JSONReqa = <<"{\"id\":{\"t\":\"TL_inputUserContact\",\"access_hash\":0,\"user_id\":143444}}">>,
 ?DEBUG("re quersd ~p",[JSONReqa]),
Object23=erlang:element(2,rfc4627:decode(JSONReqa))
?DEBUG("object = ~p",[Object23]),
?DEBUG("record = ~p",[?RFC4627_TO_RECORD(getfulluser,Object23)]),

output is

 mod_contacts:gs().
18:38:04.695 [debug] re quersd <<"{\"id\":{\"t\":\"TL_inputUserContact\",\"access_hash\":0,\"user_id\":143444}}">>
18:38:04.697 [debug] object = {ok,{obj,[{"id",{obj,[{"t",<<"TL_inputUserContact">>},{"access_hash",0},{"user_id",143444}]}}]},[]}
18:38:04.697 [debug] object = {obj,[{"id",{obj,[{"t",<<"TL_inputUserContact">>},{"access_hash",0},{"user_id",143444}]}}]}
18:38:04.697 [debug] record = {getfulluser,{obj,[{"t",<<"TL_inputUserContact">>},{"access_hash",0},{"user_id",143444}]}}
{getfulluser,{obj,[{"t",<<"TL_inputUserContact">>},
                   {"access_hash",0},
                   {"user_id",143444}]}}

can @0x6e6562 @olcai @tonyg @paulj @matwey please help i really appreciate your help.

it should decode the inner record as well. any pointers will help.

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.