private void SetExtensions(HttpRequestMessage req, IObjectFacade objectFacade, FieldFacadeAdapter parameter, RestControlFlags flags) {
            IDictionary<string, object> custom = null;

            if (IsUnconditionalChoices(parameter)) {
                custom = new Dictionary<string, object>();

                Tuple<IObjectFacade, string>[] choices = parameter.GetChoicesAndTitles(objectFacade, null);
                Tuple<object, string>[] choicesArray = choices.Select(tuple => new Tuple<object, string>(parameter.GetChoiceValue(OidStrategy, req, tuple.Item1, flags), tuple.Item2)).ToArray();

                OptionalProperty[] op = choicesArray.Select(tuple => new OptionalProperty(tuple.Item2, tuple.Item1)).ToArray();
                MapRepresentation map = MapRepresentation.Create(op);
                custom[JsonPropertyNames.CustomChoices] = map;
            }

            string mask = parameter.Mask;

            if (!string.IsNullOrWhiteSpace(mask)) {
                custom = custom ?? new Dictionary<string, object>();
                custom[JsonPropertyNames.CustomMask] = mask;
            }

            var multipleLines = parameter.NumberOfLines;

            if (multipleLines > 1) {
                custom = custom ?? new Dictionary<string, object>();
                custom[JsonPropertyNames.CustomMultipleLines] = multipleLines;
            }

            custom = RestUtils.AddRangeExtension(parameter.AsField, custom);

            Extensions = RestUtils.GetExtensions(friendlyname: parameter.Name,
                                                  description: parameter.Description,
                                                  pluralName: null,
                                                  domainType: null,
                                                  isService: null,
                                                  hasParams: null,
                                                  optional: !parameter.IsMandatory,
                                                  maxLength: parameter.MaxLength,
                                                  pattern: parameter.Pattern,
                                                  memberOrder: null,
                                                  dataType: parameter.DataType,
                                                  presentationHint: parameter.PresentationHint,
                                                  customExtensions: custom,
                                                  returnType: parameter.Specification,
                                                  elementType: parameter.ElementType,
                                                  oidStrategy: OidStrategy,
                                                  useDateOverDateTime: true);
        }