Azure / Azure/azure-functions-openapi-extension

Bug report, feature request or other request

Open
#449 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

**Describe the issue**
The type name is not valid when having a type with a nullable jagged array. The type is named "list_nullable`1" in the Open API spec which cannot be imported to e.g. Azure API Management

**To Reproduce**
The following function will produce an invalid type name in the Open API spec

```csharp
[FunctionName(nameof(FunctionReturnsNullableJaggedArray))]
[OpenApiOperation(nameof(FunctionReturnsNullableJaggedArray))]
[OpenApiResponseWithBody(HttpStatusCode.OK, "application/json", typeof(NullableJaggedArray))]
public async Task FunctionReturnsNullableJaggedArray([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req)
{
return new OkResult();
}

public class NullableJaggedArray
{
public float?[][] Bar { get; set; }
}
```

The following open api spec is produced:
```json
"definitions": {
"list_nullable`1": {
"type": "array",
"items": {
"format": "float",
"type": "number"
}
},
"nullableJaggedArray": {
"type": "object",
"properties": {
"bar": {
"type": "array",
"items": {
"$ref": "#/definitions/list_nullable`1"
}
}
}
}
}
```

The type ```list_nullable`1``` cannot be imported into Azure API Management

**Expected behavior**
A valid type is excpected (like "list_nullable_float")

**Environment**
- Version 1.3.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.