internal void Walk()

in src/Microsoft.OpenApi/Services/OpenApiWalker.cs [746:805]


        internal void Walk(OpenApiSchema schema, bool isComponent = false)
        {
            if (schema == null || ProcessAsReference(schema, isComponent))
            {
                return;
            }

            if (_schemaLoop.Contains(schema))
            {
                return;  // Loop detected, this schema has already been walked.
            }
            else
            {
                _schemaLoop.Push(schema);
            }

            _visitor.Visit(schema);

            if (schema.Items != null)
            {
                Walk("items", () => Walk(schema.Items));
            }

            if (schema.AllOf != null)
            {
                Walk("allOf", () => Walk(schema.AllOf));
            }

            if (schema.AnyOf != null)
            {
                Walk("anyOf", () => Walk(schema.AnyOf));
            }

            if (schema.OneOf != null)
            {
                Walk("oneOf", () => Walk(schema.OneOf));
            }

            if (schema.Properties != null)
            {
                Walk("properties", () =>
                {
                    foreach (var item in schema.Properties)
                    {
                        Walk(item.Key, () => Walk(item.Value));
                    }
                });
            }

            if (schema.AdditionalProperties != null)
            {
                Walk("additionalProperties", () => Walk(schema.AdditionalProperties));
            }

            Walk(OpenApiConstants.ExternalDocs, () => Walk(schema.ExternalDocs));

            Walk(schema as IOpenApiExtensible);

            _schemaLoop.Pop();
        }