Skip to content

Fix Avalanche Problems in Observations Schema#1174

Closed
kevinherdez wants to merge 1 commit into
NWACus:mainfrom
kevinherdez:kevinherdez/fixAvyProblemZodError
Closed

Fix Avalanche Problems in Observations Schema#1174
kevinherdez wants to merge 1 commit into
NWACus:mainfrom
kevinherdez:kevinherdez/fixAvyProblemZodError

Conversation

@kevinherdez

Copy link
Copy Markdown
Collaborator

A Zod Error came in that uncovered an issue with the observation -> advanced_fields -> avalanche_problems -> type schema where if the type didn't match the specific AvalancheProblems enum, then we failed to parse.

The problem was that one of the avalanche problems had a type of 'Cornice' instead of 'Cornice Fall'

Obs that had the issue:
https://nwac.us/observations/#/view/observations/9801b523-356b-440c-9f30-1fe0607ce9fa

Zod Error:

ZodError: [
  {
    "code": "too_big",
    "maximum": 0,
    "type": "string",
    "inclusive": true,
    "exact": true,
    "message": "String must contain exactly 0 character(s)",
    "path": [
      "advanced_fields",
      "avalanche_problems",
      2,

@kevinherdez

Copy link
Copy Markdown
Collaborator Author

I actually need to see if this is the proper fix. CorniceFall might need to be changed to Cornice in AvalancheProblemName. I want to make sure that that won't mess anything up with the avalanche forecast problems though

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 this pull request may close these issues.

1 participant