Skip to content

Conversation

selimb
Copy link
Contributor

@selimb selimb commented Nov 30, 2019

Change Summary

Allow Config.schema_extra to be a callable so that the generated schema can be post-processed.
Also includes some fixes to the dev scripts for Windows development (I'm on Windows with cmder). Those can be moved to another PR if needed.

Related issue number

fix #889, fix #1051

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/1054-selimb.md file added describing change
    (see changes/README.md for details)

@selimb
Copy link
Contributor Author

selimb commented Nov 30, 2019

Was going to include functions for schema_extra to address both #889 and #1051, but it proved less trivial than I thought to handle all cases.

Could take a stab at it in another PR if you think it'd be useful?

@selimb selimb mentioned this pull request Nov 30, 2019
@codecov
Copy link

codecov bot commented Nov 30, 2019

Codecov Report

Merging #1054 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #1054   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          20      20           
  Lines        3349    3352    +3     
  Branches      661     662    +1     
======================================
+ Hits         3349    3352    +3
Impacted Files Coverage Δ
pydantic/schema.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d059fde...fce78b8. Read the comment docs.

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

otherwise LGTM.

@samuelcolvin
Copy link
Member

Was going to include functions for schema_extra to address both #889 and #1051, but it proved less trivial than I thought to handle all cases.

Could take a stab at it in another PR if you think it'd be useful?

Humm, thanks but I think it get's complicated if we start providing functions for these cases within pydantic, there are hundreds of different changes that people might want. I think best to leave things like this up to package users.

@selimb
Copy link
Contributor Author

selimb commented Dec 2, 2019

Thanks! Believe the comments have been addressed.

Humm, thanks but I think it get's complicated if we start providing functions for these cases within pydantic, there are hundreds of different changes that people might want. I think best to leave things like this up to package users.

Agreed. Sounds good.

@samuelcolvin samuelcolvin merged commit bdc3973 into pydantic:master Dec 9, 2019
@samuelcolvin
Copy link
Member

great, thank you.

@selimb
Copy link
Contributor Author

selimb commented Dec 10, 2019

Thanks to you! Cheers.

andreshndz pushed a commit to cuenca-mx/pydantic that referenced this pull request Jan 17, 2020
* fixes for Windows development

* Allow Config.schema_extra to be a callable
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supress title generation Is it possible to have a schema with no $ref references ?
2 participants