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

Update proposal for annotated types - also enables pydantic annotated types #66

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Quaditz
Copy link

@Quaditz Quaditz commented Oct 22, 2023

This would solve goal 1 of Issue 65.

#65

-> Annotated types are useful in combination with pydantic to validate dataclasses (e.g. ranges of int)
-> This PR makes it work with annotated types, but I think it feels quite "hard coded".
-> I tested it locally with different pydantic types and custom created types via typing_extensions.Annotated
-> Please feel free to use this PR as idea input and implement this functionality where it fits best in the code base.

@lucsorel
Copy link
Owner

thank you @Quaditz for your contribution 😃

As mentioned in the contributing guide (https://github.com/Quaditz/py2puml/tree/main#pull-requests, https://github.com/Quaditz/py2puml/blob/main/CONTRIBUTING.md), could you add unit tests demonstrating the effects of the contribution, please?

I can do the other stuff (updating the version number, adding yourself to the contributors, etc.); but the more I have to do myself, the longer it takes for your contribution to be added (opensource, freetime, etc.).

@lucsorel
Copy link
Owner

🙏 interesting topic, thanks for bringing it forward.

@Quaditz
Copy link
Author

Quaditz commented Oct 23, 2023

🙏 interesting topic, thanks for bringing it forward.

Thanks! @lucsorel

Could you take a look if everything is alright? I added a UT each for both of the two new usecases:

  • Type with Constraints from Pydantic
  • Custom created types with Annotated

The new UTs are Passed, but I saw that some of the current ones are Failed. Not sure if I did something wrong? Or maybe they are failed because some use-cases are not implemented yet?

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.

2 participants