You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
When I include path parameters, the file generated does not meet OpenApi spec because the "required: true" is omitted. It looks like the "Required" is being ignored entirely for this parameter, as it also doesn't have a required annotation in the Swagger UI.
To Reproduce
Steps to reproduce the behavior:
[OpenApiOperation(
operationId: "ListUnread",
tags: new[] { "notification" },
Summary = "Lists unread notifications",
Description = "Lists all unread notifications assigned to the calling user."
)]
[OpenApiParameter("tenantId", Description = "The tenant ID of the current customer.", Type = typeof(Guid), Required = true, In = ParameterLocation.Path)]
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(IEnumerable<NotificationTableEntity>), Summary = "Unread notifications", Description = "This returns a list of notifications.")]
[Function("ListUnread")]
public IActionResult ListUnread(
[HttpTrigger(AuthorizationLevel.User, "get", Route = "{tenantId:guid}/notification/unread")] HttpRequest req, Guid tenantId,
ILogger log)
{
Generate a v3.yaml (or any other output) file:
paths:
'/{tenantId}/notification/unread':
get:
tags:
- notification
summary: Lists unread notifications
description: Lists all unread notifications assigned to the calling user.
operationId: ListUnread
parameters:
- name: tenantId
in: path
description: The tenant ID of the current customer.
schema:
type: string
format: uuid
responses:
'200':
description: This returns a list of notifications.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/notificationTableEntity'
x-ms-summary: Unread notifications
Expected behavior
The "parameters" section should have "required: true" under the parameter.
Environment (please complete the following information, if applicable):
OS: happens on local Windows build and building on ubuntu-latest
Version v1.5.1, v2.0.0-preview2
The text was updated successfully, but these errors were encountered:
Describe the issue
When I include path parameters, the file generated does not meet OpenApi spec because the "required: true" is omitted. It looks like the "Required" is being ignored entirely for this parameter, as it also doesn't have a required annotation in the Swagger UI.
To Reproduce
Steps to reproduce the behavior:
Generate a v3.yaml (or any other output) file:
Expected behavior
The "parameters" section should have "required: true" under the parameter.
Environment (please complete the following information, if applicable):
The text was updated successfully, but these errors were encountered: