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

Fix JSON Schema for list, tuple, and set, improving interoperability #540



None yet
2 participants
Copy link

commented May 23, 2019

Change Summary

Fix JSON Schema for plain list, tuple, and set. Adding {"items": {}}.

This makes the schemas for these "plain" sequence types (instead of List[some_type]) compatible with OpenAPI while keeping compatible with JSON Schema.

Related issue number


  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • HISTORY.rst has been updated
    • if this is the first change since a release, please add a new section
    • include the issue number or this pull request number #<number>
    • include your github username @<whomever>

This comment has been minimized.

Copy link

commented May 23, 2019

Codecov Report

Merging #540 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #540   +/-   ##
  Coverage     100%   100%           
  Files          15     15           
  Lines        2457   2457           
  Branches      488    488           
  Hits         2457   2457

@tiangolo tiangolo referenced this pull request May 23, 2019


Display pydantic types #118

@samuelcolvin samuelcolvin merged commit cd8c764 into samuelcolvin:master May 23, 2019

4 of 7 checks passed

Header rules No header rules processed
Pages changed 1 new file uploaded
Redirect rules No redirect rules processed
Mixed content No mixed content detected
codecov/project 100% remains the same compared to d2f6073
continuous-integration/travis-ci/pr The Travis CI build passed
deploy/netlify Deploy preview ready!

This comment has been minimized.

Copy link

commented May 23, 2019

awesome. Thanks.

@tiangolo tiangolo deleted the tiangolo:improve-sequence-json-schemas branch May 23, 2019


This comment has been minimized.

Copy link
Collaborator Author

commented May 23, 2019

Thank you! 🎉

gangefors added a commit to gangefors/pydantic that referenced this pull request May 31, 2019

Merge remote-tracking branch 'upstream/master'
* upstream/master: (138 commits)
  add 'none-any.whl' to pypi upload (samuelcolvin#564)
  update benchmarks (samuelcolvin#563)
  cython (samuelcolvin#548)
  Fix issue with unspecified generic type (samuelcolvin#554)
  Run dataclass' original __post_init__ before validation (samuelcolvin#560)
  try to stop annoying warnings in azure pipeline (samuelcolvin#549)
  azure pipeline failOnStderr: false
  Azure Pipelines - tests for windows (samuelcolvin#538)
  Fix JSON Schema for list, tuple, and set, improving interoperability (samuelcolvin#540)
  Colors (samuelcolvin#516)
  Fix to schema generation for IPv{4,6}{Address,Interface,Network} (samuelcolvin#532)
  Fix __fields_set__ not using alias field names (samuelcolvin#517) (samuelcolvin#518)
  Change return type hint for create_model (samuelcolvin#526)
  Tuple ellipsis (samuelcolvin#512)
  Fix to schema generation for IPvAny{Address,Interface,Network} (samuelcolvin#498) (samuelcolvin#510)
  Scheduled monthly dependency update for May (samuelcolvin#499)
  Implement const keyword in Schema. (samuelcolvin#469)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.