Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot validate values of type "NULL" automatically #2731

@norkunas

Description

@norkunas

When calling a collection post operation and if forgot to include a body then the api should handle this gracefully and return a 400 error instead of 500.

Currently it tries to validate "null" because controller result is null and symfony validator obviously doesn't like it.

Response from api:

{  
   "@context":"\/contexts\/Error",
   "@type":"hydra:Error",
   "hydra:title":"An error occurred",
   "hydra:description":"Cannot validate values of type \u0022NULL\u0022 automatically. Please provide a constraint."
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions