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

Fix error reporting for unresolved property #1054

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

guycnicholas
Copy link
Contributor

Unresolved property errors failed to return the name of the property

@gnichola
Copy link

gnichola commented Mar 20, 2025

With the change speakers is an unevaluated property

{
  status: 400,
  errors: [
    {
      path: '/body/speakers',
      message: 'must NOT have unevaluated properties',
      errorCode: 'unevaluatedProperties.openapi.validation'
    }
  ]
}

Without the change

{
  status: 400,
  errors: [
    {
      path: '/body',
      message: 'must NOT have unevaluated properties',
      errorCode: 'unevaluatedProperties.openapi.validation'
    }
  ]
}

Copy link
Owner

@cdimascio cdimascio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

const path =
required ?? additionalProperty ?? e.instancePath ?? e.schemaPath;
required ?? additionalProperty ?? unevaluatedProperty?? e.instancePath ?? e.schemaPath;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required ?? additionalProperty ?? unevaluatedProperty?? e.instancePath ?? e.schemaPath;
required ?? additionalProperty ?? unevaluatedProperty ?? e.instancePath ?? e.schemaPath;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arggg... sorry about that.

@cdimascio cdimascio merged commit 2910393 into cdimascio:master Mar 21, 2025
5 checks passed
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.

4 participants