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

Chore: remove "dataPath" from data OpenAPI data errors. #5272

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Nov 6, 2023

The dataPath was present (but not in the type) in previous versions of the
error library that we use. But with the recent major upgrade, it's
been removed and the instancePath property has finally come into use.

This PR removes all the handling for the previous property and
replaces it with instancePath. Because the dataPath used full
stops and the instancePath uses slashes, we need to change a little
bit of the handling too.

The `dataPath` was present (but not typed) in previous versions of the
error library that we use. But with the recent major upgrade, it's
been removed and the `instancePath` property has finally come into use.

This PR removes all the handling for the previous property and
replaces it with `instancePath`. Because the `dataPath` used full
stops and the `instancePath` uses slashes, we need to change a little
bit of the handling too.
Copy link

vercel bot commented Nov 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Nov 6, 2023 7:47am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Nov 6, 2023 7:47am


const youSent = JSON.stringify(input);
const description = `The \`.${propertyName}\` property ${errorMessage}. You sent ${youSent}.`;
const description = `The \`${propertyName}\` property ${errorMessage}. You sent ${youSent}.`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No other property descriptors start with a full stop, and because the new format uses slashes, I'll remove it for now.

Copy link
Contributor

@sjaanus sjaanus left a comment

Choose a reason for hiding this comment

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

LG

@thomasheartman thomasheartman merged commit b3054c9 into main Nov 7, 2023
@thomasheartman thomasheartman deleted the chore/remove-old-openapi-error-expecations branch November 7, 2023 08:26
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.

2 participants