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

Support boolean attributes in json & text renderings #85

Open
mdutoo opened this issue Sep 28, 2016 · 0 comments
Open

Support boolean attributes in json & text renderings #85

mdutoo opened this issue Sep 28, 2016 · 0 comments
Assignees

Comments

@mdutoo
Copy link

mdutoo commented Sep 28, 2016

For now boolean attributes raise a "badarg" error (*), first because xs:boolean is not allowed in priv/schemas/occi.xsd .

However, boolean attributes are allowed in json (3.5 p8) and text (4.3 p6 "bool") renderings - as well as in OCCIware Cloud Designer.

Workaround : rather use an enum. This is actually a good practice from a semantic point of view (example : having a VM.isStarted attribute and later discovering that there are additional lifecycle states besides started and stopped).

(*) error :

=INFO REPORT==== 21-Sep-2016::22:25:44 ===
[erocci_backend_dbus] models()
=INFO REPORT==== 21-Sep-2016::22:25:44 ===
Calling <<"/">>:<<"org.ow2.erocci.backend.core">>.<<"Models">>([])
[{occi_parser_xml,parse,1,[{file,"src/occi_parser_xml.erl"},{line,33}]},{occi_rendering,parse,3,[{file,"src/occi_rendering.erl"},{line,60}]},{erocci_backend_dbus,parse_models,3,[{file,"src/erocci_backend_dbus.erl"},{line,312}]},{erocci_backend,handle_call,3,[{file,"src/erocci_backend.erl"},{line,410}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,647}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]

=ERROR REPORT==== 21-Sep-2016::22:25:44 ===
[line 16] parse error: {xml, <<"Unexpected error: badarg">>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants