public ISchema GenerateSchema(Type type, ISchemaRepository schemaRepository) { var schemaId = _options.SchemaIdSelector(type); var reference = schemaRepository.GetOrAdd(type, schemaId, () => TypeSchemaFactory(type, schemaRepository)); return(reference); }
private Message GenerateMessageFromAttribute(MessageAttribute messageAttribute, ISchemaRepository schemaRepository) { if (messageAttribute?.PayloadType == null) { return(null); } var message = new Message { Payload = _schemaGenerator.GenerateSchema(messageAttribute.PayloadType, schemaRepository), Name = messageAttribute.Name ?? _options.SchemaIdSelector(messageAttribute.PayloadType), Title = messageAttribute.Title, Summary = messageAttribute.Summary, Description = messageAttribute.Description, }; return(message); }