public List <OperationTemplateParameter> CreateResponseHeaders(IDictionary <string, OpenApiHeader> headerPairs)
        {
            List <OperationTemplateParameter> headers = new List <OperationTemplateParameter>();

            foreach (KeyValuePair <string, OpenApiHeader> pair in headerPairs)
            {
                // use header examples to create values and default value
                OpenApiParameterHeaderIntersection param = new OpenApiParameterHeaderIntersection()
                {
                    Example  = pair.Value.Example,
                    Examples = pair.Value.Examples
                };
                OperationTemplateParameter headerTemplate = new OperationTemplateParameter()
                {
                    name         = pair.Key,
                    description  = pair.Value.Description,
                    type         = pair.Value.Schema.Type,
                    required     = pair.Value.Required,
                    values       = CreateParameterValues(param).ToArray(),
                    defaultValue = CreateParameterDefaultValue(param)
                };
                headers.Add(headerTemplate);
            }
            ;
            return(headers);
        }
        public List <OperationTemplateParameter> CreateTemplateParameters(IList <OpenApiParameter> parameters)
        {
            List <OperationTemplateParameter> templateParameters = new List <OperationTemplateParameter>();

            foreach (OpenApiParameter parameter in parameters)
            {
                // use parameter examples to create values and default value
                OpenApiParameterHeaderIntersection param = new OpenApiParameterHeaderIntersection()
                {
                    Example  = parameter.Example,
                    Examples = parameter.Examples
                };
                OperationTemplateParameter templateParameter = new OperationTemplateParameter()
                {
                    name         = parameter.Name,
                    description  = parameter.Description,
                    type         = parameter.Schema.Type,
                    required     = parameter.Required,
                    values       = CreateParameterValues(param).ToArray(),
                    defaultValue = CreateParameterDefaultValue(param)
                };
                templateParameters.Add(templateParameter);
            }
            return(templateParameters);
        }
        public List <OperationTemplateParameter> CreateFormParameters(OpenApiSchema schema)
        {
            List <OperationTemplateParameter> formParameters = new List <OperationTemplateParameter>();

            if (schema.Example != null)
            {
                foreach (KeyValuePair <string, OperationSchemaExample> pair in schema.Example as Dictionary <string, OperationSchemaExample> )
                {
                    OperationTemplateParameter formParameter = new OperationTemplateParameter()
                    {
                        name         = pair.Key,
                        required     = schema.Required.FirstOrDefault(val => val == pair.Key) != null,
                        defaultValue = (JsonConvert.SerializeObject(pair.Value.Value))
                    };
                    formParameters.Add(formParameter);
                }
                ;
            }
            return(formParameters);
        }