Пример #1
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
            };
        }
Пример #2
0
        /// <summary>Initializes a new instance of the <see cref="OpenApiDocument"/> class.</summary>
        public OpenApiDocument()
        {
            Swagger    = "2.0";
            OpenApi    = "3.0.0";
            Components = new OpenApiComponents(this);

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

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

            Paths = paths;
            Info  = new OpenApiInfo();
        }