Commit ee6322f2 authored by Matthieu Lamalle's avatar Matthieu Lamalle

Merge branch 'feature/64_zephir_cli' into 'develop'

Modify API v1 message arg to be positional

See merge request !4
parents 82ea3dee 004dfb93
......@@ -3,7 +3,7 @@ from collections import OrderedDict
from os.path import join, basename, dirname
from glob import glob
from tiramisu import StrOption, IntOption, BoolOption, ChoiceOption, OptionDescription, Config
from tiramisu import StrOption, IntOption, BoolOption, ChoiceOption, OptionDescription, Config, SymLinkOption
ROOTPATH = join('..')
......@@ -54,7 +54,10 @@ def _parse_args(message_def,
if arg.ref:
needs.setdefault(message_def.uri, {}).setdefault(arg.ref, []).append(name)
for name, arg in new_options.items():
options.append(_get_option(name, arg, file_path))
current_opt = _get_option(name, arg, file_path)
if arg.shortarg:
options.append(SymLinkOption(arg.shortarg, current_opt))
def _parse_responses(message_def,
......@@ -74,12 +77,12 @@ def _parse_responses(message_def,
param_type = param_type[2:]
if param_type in ['Dict', 'File']:
if message_def.response.parameters is not None:
for name, obj in message_def.response.parameters.items():
if name in responses:
raise Exception('multi response with name {} in {}'.format(name, file_path))
descr = obj.description.strip().rstrip()
keys['']['columns'][name] = {'description': obj.description,
'type': obj.type}
......@@ -139,7 +142,7 @@ def _get_root_option(optiondescriptions):
options_obj = [ChoiceOption('message',
'Sélectionner le message.',
properties=frozenset(['mandatory', 'positional']))]
for name, options_descr in optiondescriptions.items():
description, options = options_descr
if len(options) != 1:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment