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

docs: added docs on how to extend a validator #4489

Merged
merged 6 commits into from
Jul 18, 2023

Conversation

shahednasser
Copy link
Member

Added documentation on how to extend validators of endpoints.

Closes DOCS-735

@shahednasser shahednasser requested a review from a team as a code owner July 10, 2023 14:17
@changeset-bot
Copy link

changeset-bot bot commented Jul 10, 2023

⚠️ No Changeset found

Latest commit: 857347f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jul 10, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Jul 18, 2023 3:18pm


:::tip

Validators are defined in the same file as the endpoint. To find the validator you need to override, find the endpoint file under `@medusajs/medusa/dist/api/routes` and import the validator in that file.
Copy link
Member Author

Choose a reason for hiding this comment

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

note: would be nice to add some reference for this at some point, but this will do for now

Copy link
Member

Choose a reason for hiding this comment

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

I would hold off this change for now as we are changing that to mutualise it with the fields and relations override in @riqwan pr

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah got it, I'll close this for now then until that PR is merged. cc @olivermrbl

@shahednasser shahednasser reopened this Jul 18, 2023
@shahednasser shahednasser merged commit 195ad13 into develop Jul 18, 2023
16 checks passed
@shahednasser shahednasser deleted the docs/extend-validator branch July 18, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants