When i try to generate the swagger documentation for the code below i get only see the endpoint of the first function in my swagger ui (and in the generated swagger / openAPI files.) The first endpoint of a second file is also shown, but the following functions in that file is not included as well. Any suggestion of what i do wrong?
using ...
namespace IngestionApi.Functions
{
public class DatasetsApi
{
private ILogger<DatasetsApi> _logger;
private IDatasetService _DatasetService;
/// <summary> Initializes a new instance of DatasetsApi. </summary>
/// <param name="logger"> Class logger. </param>
/// <exception cref="ArgumentNullException"> <paramref name="logger"/> is null. </exception>
public DatasetsApi(ILogger<DatasetsApi> logger)
{
if (logger == null)
{
throw new ArgumentNullException(nameof(logger));
}
_logger = logger;
//_IDatasetService = new DatasetsApi();
}
// /// <summary> 1) validate data 2) generate datasetId 3) add meta data to `datasetMeta` bucket + update `createdAt` and `datasetID` field 4) create new container(s) in storage and store `containerId/Url` to meta data (raw and processed) 5) return `datasetId`?. </summary>
// /// <param name="body"> Meta data to create new datasset. </param>
// /// <param name="req"> Raw HTTP Request. </param>
// /// <param name="cancellationToken"> The cancellation token provided on Function shutdown. </param>
// /// <exception cref="ArgumentNullException"> <paramref name="body"/> is null. </exception>
[FunctionName(nameof(DatasetsApi.CreateDatasetAsync))]
[OpenApiOperation(operationId: "CreateDatasetAsync", tags: new[] { "datasets" }, Summary = "Gets the name")]
public async Task<IActionResult> CreateDatasetAsync([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "datasets")] HttpRequest req, CancellationToken cancellationToken = default)
{
_logger.LogInformation("HTTP trigger function processed a request.");
// TODO: Handle Documented Responses.
// Spec Defines: HTTP 200
// Spec Defines: HTTP 400
Console.WriteLine("HTTP trigger function: CreateDatasetAsync");
Console.WriteLine( req.Query);
string requestBody = String.Empty;
using (StreamReader streamReader = new StreamReader(req.Body))
{
requestBody = await streamReader.ReadToEndAsync();
}
dynamic data = JsonConvert.DeserializeObject(requestBody);
Console.WriteLine(data);
throw new NotImplementedException();
}
[FunctionName(nameof(DatasetsApi.CreateNewDatasetVersionAsync))]
[OpenApiOperation(operationId: "CreateNewDatasetVersionAsync", tags: new[] { "datasets" }, Summary = "Gets the name 1", Description = "This gets the name.", Visibility = OpenApiVisibilityType.Important)]
//[OpenApiParameter(name: "name", In = ParameterLocation.Query, Required = true, Type = typeof(string), Summary = "The name", Description = "The name", Visibility = OpenApiVisibilityType.Important)]
//[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
//[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "text/plain", bodyType: typeof(string), Summary = "The response", Description = "This returns the response")]
public async Task<IActionResult> CreateNewDatasetVersionAsync(string datasetId, [HttpTrigger(AuthorizationLevel.Anonymous, "put", Route = "datasets1/{datasetId}")] HttpRequest req, CancellationToken cancellationToken = default)
{
_logger.LogInformation("HTTP trigger function processed a request.");
// TODO: Handle Documented Responses.
// Spec Defines: HTTP 200
// Spec Defines: HTTP 400
throw new NotImplementedException();
}
....more fumctions with same tag.....
}
}