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

[BUG] String methods are mixed in #53

Open
1 task done
moltar opened this issue Oct 6, 2021 · 0 comments
Open
1 task done

[BUG] String methods are mixed in #53

moltar opened this issue Oct 6, 2021 · 0 comments
Assignees
Labels

Comments

@moltar
Copy link

moltar commented Oct 6, 2021

  • Before submitting a bug report, double-check that your Typescript version is at least 3.7.

Describe the bug

I am seeing String methods are mixed in with the object properties.

To Reproduce

import { createSchema, TsjsonParser } from "ts-json-validator"

const username = createSchema({ type: "string", minLength: 2 })
const password = createSchema({ type: "string" })

export const register = createSchema({
  type: "object",
  properties: {
    username,
    password,
  },
  required: ["username", "password"]
})

const registerParser = new TsjsonParser(register)
const body = registerParser.parse('{}')

Expected behavior

To have only username and password props.

Actual behavior

Lots of unrelated props, from the String object.

Screenshots

screenshot-20211006T124310-BMsyOhDz

Additional context

packages:

    "typescript": "4.4.3"
    "ts-json-validator": "0.7.1",
    "tsconfigs": "5.0.0"

tsconfig.json

{
  "extends": "tsconfigs/agnostic-module",
  "compilerOptions": {
    "jsx": "react"
  },
  "include": [
    "src/**/*",
    "lambda/**/*"
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants