public override void Visit()

in src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/DictionaryObjectTypeVisitor.cs [35:114]


        public override void Visit(IAcceptor acceptor, KeyValuePair<string, Type> type, NamingStrategy namingStrategy, params Attribute[] attributes)
        {
            var name = this.Visit(acceptor, name: type.Key, title: null, dataType: "object", dataFormat: null, attributes: attributes);

            if (name.IsNullOrWhiteSpace())
            {
                return;
            }

            var instance = acceptor as OpenApiSchemaAcceptor;
            if (instance.IsNullOrDefault())
            {
                return;
            }

            // Gets the schema for the underlying type.
            var underlyingType = type.Value.GetUnderlyingType();
            var types = new Dictionary<string, Type>()
            {
                { underlyingType.GetOpenApiReferenceId(underlyingType.IsOpenApiDictionary(), underlyingType.IsOpenApiArray(), namingStrategy), underlyingType }
            };
            var schemas = new Dictionary<string, OpenApiSchema>();

            OpenApiSchemaAcceptor subAcceptor;
            if (!this.visitedTypes.ContainsKey(underlyingType))
            {
                subAcceptor = new OpenApiSchemaAcceptor()
                {
                    Types = types, RootSchemas = instance.RootSchemas, Schemas = schemas,
                };
                this.visitedTypes.Add(underlyingType, subAcceptor);
                subAcceptor.Accept(this.VisitorCollection, namingStrategy);
            }
            else
            {
                subAcceptor = this.visitedTypes[underlyingType];
            }

            var properties = subAcceptor.Schemas.First().Value;

            // Forces to remove the title value from the additionalProperties attribute.
            properties.Title = null;

            // Adds the reference to the schema for the underlying type.
            if (this.IsReferential(underlyingType))
            {
                var reference = new OpenApiReference()
                {
                    Type = ReferenceType.Schema,
                    Id = underlyingType.GetOpenApiReferenceId(underlyingType.IsOpenApiDictionary(), underlyingType.IsOpenApiArray(), namingStrategy)
                };

                properties.Reference = reference;
            }

            instance.Schemas[name].AdditionalProperties = properties;

            // Adds schemas to the root.
            var schemasToBeAdded = subAcceptor.Schemas
                                              .Where(p => p.Value.IsOpenApiSchemaObject()
                                                       || p.Value.IsOpenApiSchemaArray()
                                                       || p.Value.IsOpenApiSchemaDictionary()
                                                    )
                                              .ToDictionary(p => p.Key, p => p.Value);

            if (!schemasToBeAdded.Any())
            {
                return;
            }

            foreach (var schemaToBeAdded in schemasToBeAdded)
            {
                if (instance.RootSchemas.ContainsKey(schemaToBeAdded.Key))
                {
                    continue;
                }

                instance.RootSchemas.Add(schemaToBeAdded.Key, schemaToBeAdded.Value);
            }
        }