Skip to content

Resource inheritance: can't include derived types after create resource #1640

Closed
@bkoelman

Description

@bkoelman

DESCRIPTION

Using the models described in #1639, the following request:

POST /vehicles?include=lights

{ ... }

fails with status 500 (Internal Error):

{
  "links": {
    "self": "http://localhost/vehicles?include=lights"
  },
  "errors": [
    {
      "id": "84b108ae-c1a7-4eaa-9b96-3f239a5c2201",
      "status": "500",
      "title": "An unhandled error occurred while processing this request.",
      "detail": "Property 'System.Collections.Generic.ISet`1[Models.BicycleLight] Lights' is not defined for type 'Models.Vehicle' (Parameter 'property')"
    }
  ],
  "included": []
}

EXPECTED BEHAVIOR

No error, the response includes the related resources.

ACTUAL BEHAVIOR

Crash.

VERSIONS USED

  • JsonApiDotNetCore version: 5.6.0
  • ASP.NET Core version: 8.0
  • Entity Framework Core version: 8.0
  • Database provider: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy