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

feat: allow validate object literal (#1378) #2066

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

christian-forgacs
Copy link

@christian-forgacs christian-forgacs commented Apr 27, 2023

Description

Add possibility to validate object literal with all decorators inclusive @ValidateNested. Base solution for this issue is from flisboac.

Checklist

  • the pull request title describes what this PR does (not a vague title like Update index.md)
  • the pull request targets the default branch of the repository (develop)
  • the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • tests are added for the changes I made (if any source code was modified)
  • documentation added or updated
  • I have run the project locally and verified that there are no errors

Fixes

fixes #1378

@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch 2 times, most recently from a76b8c9 to 3975774 Compare April 28, 2023 05:21
@christian-forgacs christian-forgacs changed the title feat: allow validate plain object (#1378) feat: allow validate plain objects (#1378) Apr 28, 2023
@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch from 3975774 to d4a83be Compare April 28, 2023 07:17
@christian-forgacs christian-forgacs marked this pull request as draft April 28, 2023 08:37
@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch 4 times, most recently from a80dcac to 568f41e Compare April 28, 2023 09:20
@christian-forgacs christian-forgacs changed the title feat: allow validate plain objects (#1378) feat: allow validate object literal (#1378) Apr 28, 2023
@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch from 568f41e to 4b1c5d5 Compare April 28, 2023 09:23
@christian-forgacs christian-forgacs marked this pull request as ready for review April 28, 2023 09:23
@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch 4 times, most recently from fc003a5 to 62fc1f7 Compare May 3, 2023 08:59
@christian-forgacs
Copy link
Author

@NoNameProvided sorry if I bother you about this. We need this feature for a project we are working on. Currently we are using a workaround which could be removed after merging the pull request and a release.

Do you already know when this pull request can be processed?

@scholz-timo
Copy link

We also require this feature for a project.

@scholz-timo
Copy link

@christian-forgacs can you create a temporary release from your fork?

@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch from 62fc1f7 to 54dc120 Compare May 12, 2023 15:35
@christian-forgacs
Copy link
Author

christian-forgacs commented May 12, 2023

@scholz-timo you can use my fork from GitHub. The only thing to do is to install it with this command, build it and move some folders:

npm install https://github.com/christian-forgacs/class-validator\#54dc1204fa5c04653ebcd1021d10db4eb243a4c1
cd node_modules/class-validator
npm install
npm run build:cjs && npm run build:es2015 && npm run build:esm5 && npm run build:types && npm run build:umd
mv build/* .
rm -r build node_modules

Now you use the fork in your project temporarily 😉

@christian-forgacs christian-forgacs force-pushed the feat/nested-validator-with-objects branch from 54dc120 to 4bc65e0 Compare May 16, 2023 11:11
@sentientmachin3
Copy link

Oh I'd like this feature to be merged, looks promising to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

question: validate objects as if they're maps
3 participants