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

Duplicate "is extraneous" errors #66

Open
darkalor opened this issue Oct 24, 2022 · 0 comments
Open

Duplicate "is extraneous" errors #66

darkalor opened this issue Oct 24, 2022 · 0 comments

Comments

@darkalor
Copy link
Contributor

darkalor commented Oct 24, 2022

Can't share exact code, but this should be roughly it

Types

interface Data {
  description: string
  properties: FieldsMap
}

type fieldName = string
type FieldsMap = { [key: fieldName]: Field}

interface Field {
  description: string
}

Data:

const data = {
  description: 'test',
  properties: {
    "some.field": {
      description: 'test',
      extraFields: { boop: false },
    }
  }
}

strictValidate output

[
   {
      "path":"value.properties",
      "message":"is not a FieldsMap",
      "nested":[
         {
            "path":"value.properties.some.field",
            "message":"is not a Field",
            "nested":[
               {
                  "path":"value.properties.some.field.extraFields",
                  "message":"is extraneous"
               },
               {
                  "path":"value.properties.some.field.extraFields",
                  "message":"is extraneous"
               }
            ]
         }
      ]
   }
]
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

No branches or pull requests

1 participant