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

[BUG] nullable enum input validation #311

Closed
Jakub-Vacek opened this issue Dec 21, 2022 · 0 comments · Fixed by #312
Closed

[BUG] nullable enum input validation #311

Jakub-Vacek opened this issue Dec 21, 2022 · 0 comments · Fixed by #312

Comments

@Jakub-Vacek
Copy link
Member

Provide a general summary of the issue in the Title above

Expected Behavior

Perform should pass

Current Behavior

Profile defines input field units enum {C, F, K} (optional enum, can be null) but when you specify units as null during perform call:

await profile
    .getUseCase('GetCurrentWeatherInCity')
    .perform({
      city: null,
      units: null
    }, {
      provider: 'wttr-in'
    });

SDK throws error:

InputValidationError {
  kind: 'InputValidationError',
  message: 'Input validation failed:\nPath: input.units\nError: Invalid enum value: null',
  errors: [ { kind: 'enumValue', context: [Object] } ],
  name: 'InputValidationError'
}

Possible Solution

Not obligatory, but suggest a fix/reason for the bug

Steps to Reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Use profile with nullable enum as input
  2. Run perform with enum value set to null

Your Environment

Include as many relevant details about the environment you experienced the bug in. Preferably include:

  • 2.1.0, discovered on 2.2.0-rc.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant