The web service description.
Beispiel #1
0
        /// <summary>Initializes a new instance of the <see cref="SwaggerDocument"/> class.</summary>
        public SwaggerDocument()
        {
            Swagger             = "2.0";
            Info                = new SwaggerInfo();
            Schemes             = new List <SwaggerSchema>();
            Responses           = new Dictionary <string, SwaggerResponse>();
            SecurityDefinitions = new Dictionary <string, SwaggerSecurityScheme>();

            Info = new SwaggerInfo
            {
                Version = string.Empty,
                Title   = string.Empty
            };

            Definitions = new ObservableDictionary <string, JsonSchema4>();
            Definitions.CollectionChanged += (sender, args) =>
            {
                foreach (var pair in Definitions.Where(p => string.IsNullOrEmpty(p.Value.TypeNameRaw)))
                {
                    pair.Value.TypeNameRaw = pair.Key;
                }
            };

            Paths = new ObservableDictionary <string, SwaggerOperations>();
            Paths.CollectionChanged += (sender, args) =>
            {
                foreach (var path in Paths.Values)
                {
                    path.Parent = this;
                }
            };
        }
Beispiel #2
0
        /// <summary>Initializes a new instance of the <see cref="SwaggerDocument"/> class.</summary>
        public SwaggerDocument()
        {
            Swagger = "2.0";
            OpenApi = "3.0";

            Info       = new SwaggerInfo();
            Components = new OpenApiComponents(this);

            var paths = new ObservableDictionary <string, SwaggerPathItem>();

            paths.CollectionChanged += (sender, args) =>
            {
                foreach (var path in Paths.Values)
                {
                    path.Parent = this;
                }
            };
            Paths = paths;

            Info = new SwaggerInfo
            {
                Version = string.Empty,
                Title   = string.Empty
            };
        }
Beispiel #3
0
        /// <summary>Initializes a new instance of the <see cref="SwaggerDocument"/> class.</summary>
        public SwaggerDocument()
        {
            Swagger             = "2.0";
            Info                = new SwaggerInfo();
            Schemes             = new List <SwaggerSchema>();
            Responses           = new Dictionary <string, SwaggerResponse>();
            Parameters          = new Dictionary <string, SwaggerParameter>();
            SecurityDefinitions = new Dictionary <string, SwaggerSecurityScheme>();

            Info = new SwaggerInfo
            {
                Version = string.Empty,
                Title   = string.Empty
            };

            Definitions = new ObservableDictionary <string, JsonSchema4>();

            var paths = new ObservableDictionary <string, SwaggerOperations>();

            paths.CollectionChanged += (sender, args) =>
            {
                foreach (var path in Paths.Values)
                {
                    path.Parent = this;
                }
            };
            Paths = paths;
        }
Beispiel #4
0
        /// <summary>Initializes a new instance of the <see cref="SwaggerService"/> class.</summary>
        public SwaggerService()
        {
            Swagger = "2.0";
            Schemes = new List<SwaggerSchema>();
            Responses = new Dictionary<string, SwaggerResponse>();
            SecurityDefinitions = new Dictionary<string, SwaggerSecurityScheme>();

            Info = new SwaggerInfo
            {
                Version = string.Empty,
                Title = string.Empty
            };

            Definitions = new ObservableDictionary<string, JsonSchema4>();
            Definitions.CollectionChanged += (sender, args) =>
            {
                foreach (var pair in Definitions.Where(p => string.IsNullOrEmpty(p.Value.TypeName)))
                    pair.Value.TypeName = pair.Key;
            };

            Paths = new ObservableDictionary<string, SwaggerOperations>();
            Paths.CollectionChanged += (sender, args) =>
            {
                foreach (var path in Paths.Values)
                    path.Parent = this;
            };
        }
Beispiel #5
0
        /// <summary>Initializes a new instance of the <see cref="SwaggerDocument"/> class.</summary>
        public SwaggerDocument()
        {
            Swagger = "2.0";
            Info = new SwaggerInfo();
            Schemes = new List<SwaggerSchema>();
            Responses = new Dictionary<string, SwaggerResponse>();
            SecurityDefinitions = new Dictionary<string, SwaggerSecurityScheme>();

            Info = new SwaggerInfo
            {
                Version = string.Empty,
                Title = string.Empty
            };

            Definitions = new ObservableDictionary<string, JsonSchema4>();

            Paths = new ObservableDictionary<string, SwaggerOperations>();
            Paths.CollectionChanged += (sender, args) =>
            {
                foreach (var path in Paths.Values)
                    path.Parent = this;
            };
        }