0
私はswaggerで私のapi文書を持っています。私はPHPとjavaのオプションをClient sdkドロップダウンでユーザに提供したいと思います。以下は私のコードです。swaggerUIでClient sdkのDropDownを表示
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSingleton(provider => Configuration);
services.AddTransient<IRegistrationRepository, ServiceUtilities>();
services.AddTransient<IClientServiceConnector, ClientServiceValidation>();
services.AddTransient<IEmailSender, EmailSender>();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
{
Title = "Onboarding API",
Version = "V1",
Description = "API to generate lead and return the url",
TermsOfService = "Please see terms and conditions",
Contact = new Swashbuckle.AspNetCore.Swagger.Contact {Name = "teggggrap",Email = "[email protected]",Url= "https://www.dd.com.au/" }
});
var basePath = PlatformServices.Default.Application.ApplicationBasePath;
var xmlPath = Path.Combine(basePath, "gf.RegistrationApplication.xml");
c.IncludeXmlComments(xmlPath);
});
services.AddCors(options =>
{
options.AddPolicy("AllowAll", policy =>
{
policy.AllowAnyOrigin();
policy.AllowAnyHeader();
policy.AllowAnyMethod();
});
});
}
あなたの質問はあいまいです。 Swaggerで生成されたメタデータでは、特定の関数(get、post、deleteなど)を実行する前に、これらのオプション(php、java)の1つを選択する必要がありますか? – Usman
APIを消費するクライアントSDKを生成したい。ユーザーがPHP開発者である場合、彼はPHP SDKをダウンロードして使用できます。 – maxspan