Skip to content

Error Response Generated wrongly if error response is array of errors #563

@ThaDaVos

Description

@ThaDaVos

The API (Snelstart B2B API) I am implementing returns a list of validation errors on a 400 response - I tried to model this (as their OpenAPI document is missing it) as follows:

      "Snelstart.B2B.Api.V2.Models.BadRequestEntry": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          }
        },
        "description": "BadRequestEntry"
      },
      "Snelstart.B2B.Api.V2.Models.BadRequestResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Snelstart.B2B.Api.V2.Models.BadRequestEntry"
        }
      },

But this results in the following docs to be generated:

<exception cref="List<global::[PROJECT_NAMESPACE].Http.Models.SnelStart.B2B.Api.V2.Models.BadRequestEntry>">When receiving a 400 status code</exception>

As far as I know one cannot throw a list of exceptions - add to that it doesn't even resolve it correctly, it's all empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions