MMLib.SwaggerForOcelot icon indicating copy to clipboard operation
MMLib.SwaggerForOcelot copied to clipboard

Consul integration with serviceName prefix and ConsulClient library

Open rabdulatif opened this issue 4 months ago • 3 comments

Overview:

This PR introduces several key updates related to Consul service discovery and Swagger endpoint handling within the Ocelot setup.

Changes:

  1. Added MMLib.ServiceDiscovery.Consul:

    • Introduced a new project for Consul service auto-discovery.
    • This enables clients who don't define Swagger endpoints in their ocelot.json to use Consul for discovery.
  2. Updated MMLib.SwaggerForOcelot in ServiceCollectionExtensions:

    • Modified the AddSwaggerForOcelot method to include conditional handling for Consul.
    • Now checks if Consul is being used, to configure Swagger appropriately.
  3. Introduced ConsulSwaggerEndpointProvider:

    • This new class retrieves Swagger endpoints from Consul for clients using Consul or PollConsul as the discovery type.
    • It ensures proper Swagger integration with Consul-managed services.

Summary by CodeRabbit

  • New Features

    • Introduced multiple new projects for enhanced service discovery and API management, including MMLib.ServiceDiscovery.Consul, ConsulAutoDiscovery, ConsulApiGateway, and AutoDiscoveryApi.
    • Added Swagger support for API documentation in new projects.
    • Implemented a weather forecast endpoint in the AutoDiscoveryApi.
  • Bug Fixes

    • Removed outdated Ocelot package references from several projects to streamline dependencies.
  • Documentation

    • New configuration files for development and production settings in AutoDiscoveryApi and ConsulApiGateway.
  • Chores

    • Restructured Swagger UI configuration in the OrderService for better organization and clarity.

rabdulatif avatar Oct 15 '24 06:10 rabdulatif