Skip to content

How do I get arrays of nullable types to be represented with a nullable flag in "items" in swagger #3284

@Scarecrow7250

Description

@Scarecrow7250

What are you wanting to achieve?

I have a project which has a model in particular that contains arrays of nullable doubles.
When I generate the swagger for the project (using release 7.2.0), the arrays are marked as nullable, but the array items are not.

I have been reading through the issues that were resolved as part of release 7.1.0, and as far as I can tell the issue I'm experiencing should have been resolved as part of that release.

I must be missing something, but not sure what.

What code or approach do you have so far?

For example, this is a field in my project:
public double?[] Field1 { get; set; }
I would expect this to be represented like this in the swagger output:

"Field1": {
  "type": "array",
  "items": {
    "type": "number",
    "format": "double",
    "nullable": true  
  },
  "nullable": true
}

But instead it is represented like this:

"Field1": {
  "type": "array",
  "items": {
    "type": "number",
    "format": "double"
  },
  "nullable": true
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help-wantedA change up for grabs for contributions from the communityquestion

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions