Example #1
0
        /// <inheritdoc/>
        protected override void SetParameters(OpenApiOperation operation)
        {
            base.SetParameters(operation);

            if (EdmOperation.IsFunction())
            {
                IEdmFunction function = (IEdmFunction)EdmOperation;

                if (OperationSegment.ParameterMappings != null)
                {
                    IList <OpenApiParameter> parameters = Context.CreateParameters(function, OperationSegment.ParameterMappings);
                    foreach (var parameter in parameters)
                    {
                        AppendParameter(operation, parameter);
                    }
                }
                else
                {
                    IDictionary <string, string> mappings   = ParameterMappings[OperationSegment];
                    IList <OpenApiParameter>     parameters = Context.CreateParameters(function, mappings);
                    if (operation.Parameters == null)
                    {
                        operation.Parameters = parameters;
                    }
                    else
                    {
                        foreach (var parameter in parameters)
                        {
                            AppendParameter(operation, parameter);
                        }
                    }
                }
            }
        }
Example #2
0
        /// <inheritdoc/>
        protected override void SetParameters(OpenApiOperation operation)
        {
            base.SetParameters(operation);

            if (EdmOperation.IsFunction())
            {
                IEdmFunction             function   = (IEdmFunction)EdmOperation;
                IList <OpenApiParameter> parameters = Context.CreateParameters(function);
                if (operation.Parameters == null)
                {
                    operation.Parameters = parameters;
                }
                else
                {
                    foreach (var parameter in parameters)
                    {
                        operation.Parameters.Add(parameter);
                    }
                }
            }
        }