Attention is currently required from: dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36505?usp=email )
Change subject: HTTP_Adapter: allow body to be "omit" ......................................................................
Patch Set 2:
(2 comments)
File library/HTTP_Adapter.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36505/comment/cd661cf5_aab37... PS1, Line 85: msg.request := {
I am not agreeing here. […]
why can't you just do something like:
function f_ts_body_or_empty(template (omit) body) return template (value) charstring { if (istemplatekind(body, "omit") { return ""; } return body }
template (value) HTTPMessage ts_HTTP_Req(charstring url, charstring method := "GET", template charstring body := omit, integer v_maj := 1, integer v_min := 1, charstring host, HeaderLines custom_hdr := { }) := { .request := { client_id := omit, method := method, uri := url, version_major := v_maj, version_minor := v_min, header := valueof(f_ts_HTTP_Header(body, host, custom_hdr)) body := f_ts_body_or_empty(body) } } Btw, I wonder why can't just also just pass a "body := omit" to it? What's wrong with that?
File library/HTTP_Adapter.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36505/comment/9db23800_68289... PS2, Line 100: if (ispresent(body)) { I'm not that sure this ispresent(body) directly on a variable is what you are actually want. Did you validate it? You may need istemplatekind("omit")?
You are also already using templatekind for the same stuff way up in the file.