Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import API validation exception #479

Closed
robotdan opened this issue Feb 12, 2020 · 0 comments
Closed

Import API validation exception #479

robotdan opened this issue Feb 12, 2020 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@robotdan
Copy link
Member

robotdan commented Feb 12, 2020

Import API validation exception

Description

If you import a user with a registration missing the applicationId property and an exception occurs.

Steps to reproduce

Import example JSON

{
  "users": [
    {
      "active": true,
      "email": "bob@example.com",
      "password": "password",
      "registrations": [
      {

      }
      ]
    }
  ]
}

Symptom in the log

Feb 12, 2020 5:20:05.990 PM ERROR io.fusionauth.app.primeframework.error.ExceptionExceptionHandler - An unhandled exception was thrown
java.lang.NullPointerException: null
at io.fusionauth.api.service.user.DefaultUserService.validateBulk(DefaultUserService.java:1169)
at io.fusionauth.app.action.api.user.ImportAction.validate(ImportAction.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Expected behavior

A 400 response with a nice JSON error.

{
  "fieldErrors" : {
    "user.registration.applicationId" : [ {
      "code" : "[missing]user.registration.applicationId",
      "message" : "You must specify the [user.registration.applicationId] property for each user registration."
    } ]
  }
}

Workaround

Specify the applicationId for each registration.

Screenshots

N/A

Additional context

N/A

@robotdan robotdan self-assigned this Feb 12, 2020
@robotdan robotdan added the bug Something isn't working label Feb 12, 2020
@robotdan robotdan added this to Backlog in FusionAuth Issues via automation Feb 12, 2020
@robotdan robotdan added this to the 1.15.0 milestone Feb 12, 2020
@robotdan robotdan moved this from Backlog to Code complete in FusionAuth Issues Feb 12, 2020
FusionAuth Issues automation moved this from Code complete to Done Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
FusionAuth Issues
  
Delivered
Development

No branches or pull requests

1 participant