Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Quickstart example presented in the README does not work #124

Closed

Description

@acwoss

Checklist

  • The bug is reproducible against the latest release and/or master.
  • There are no similar issues or pull requests to fix it yet.

Describe the bug

The quickstart example presented in the README does not work.

To reproduce

import typesystem

class Artist(typesystem.Schema):
    name = typesystem.String(max_length=100)

class Album(typesystem.Schema):
    title = typesystem.String(max_length=100)
    release_date = typesystem.Date()

album = Album.validate({
    "title": "Double Negative",
    "release_date": "2018-09-14"
})

print(album)
# Album(title='Double Negative', release_date=datetime.date(2018, 9, 14), artist=Artist(name='Low'))

Expected behavior

Return would be expected

Album(title='Double Negative', release_date=datetime.date(2018, 9, 14), artist=Artist(name='Low'))

Actual behavior

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    album = Album.validate({
TypeError: validate() missing 1 required positional argument: 'value'

Debugging material

Environment

  • OS: Any
  • Python version: 3.8.2 and 3.10
  • Typesystem version: 0.4.1

Additional context

Activity

  1. aminalaee commented on Feb 10, 2022

    @aminalaee
    Contributor

    I think you're referring to the example provided in the README, right?

    If you look at the documentation the Quickstart has the new style which works.
    The README is out of date and needs to be updated.

    PRs are welcome to fix that according to the docs.

  2. changed the title [-]Quickstart example presented in the documentation does not work[/-] [+]Quickstart example presented in the README does not work[/+] on Feb 10, 2022
  3. linked a pull request that will close this issueFix the outdated readme. #125on Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions