Esempio n. 1
0
        internal static SecurityScheme Map(IDictionary <string, object> security)
        {
            if (security == null)
            {
                return(null);
            }

            return(new SecurityScheme(security["name"] as string, security["type"] as string, security["displayName"] as string,
                                      security["description"] as string, ParameterMapper.Map(security["headers"] as object[]),
                                      ParameterMapper.Map(security["queryParameters"] as object[]),
                                      ResponseMapper.Map(security["responses"] as object[]), SettingsMapper.Map(security["settings"] as IDictionary <string, object>),
                                      ShapeMapper.Map(security["queryString"] as IDictionary <string, object>)));
        }
Esempio n. 2
0
        private static Operation Map(IDictionary <string, object> operation)
        {
            if (operation == null)
            {
                return(null);
            }

            return(new Operation(operation["method"] as string, operation["name"] as string, operation["description"] as string,
                                 operation["deprecated"] == null ? false : Convert.ToBoolean(operation["deprecated"]), operation["summary"] as string,
                                 DocumentationMapper.Map(operation["documentation"] as IDictionary <string, object>),
                                 StringEnumerationMapper.Map(operation["schemes"] as object[]), StringEnumerationMapper.Map(operation["accepts"] as object[]),
                                 StringEnumerationMapper.Map(operation["contentType"] as object[]), RequestMapper.Map(operation["request"] as IDictionary <string, object>),
                                 ResponseMapper.Map(operation["responses"] as object[]), SecuritySchemeMapper.Map(operation["security"] as object[])));
        }